2

I want to create a index in markdown, which are anchors to the chapters, like:

1. Greeting
2. Main Part

...

## 1. Greeting
some txt
## 2. Main Part
other txt

I've already done this:

1. [Greeting](#greeting)
...
## 1. Greeting {#greeting}
some txt

In markdown and md-preview it's working. For converting, I'm using Remarkable. I like the css-options, so the most online-tools will be useless. If I trying to convert the md-file to pdf, the pdf-file contents the inline-links, but it doesn't linked correctly. So it will open the folder in which the file saved, if I click on the index-link. Also, I tried to converting to html first, html to pdf second, but it's doesn't linking correctly either.

Some online-uses of markdown index (like github) will create own html-id to set anchors.

I'm looking for solution that works local over commmand line or other programm. The solution should be abe to convert md with custom css style and anchors / inline lines to pdf.

1 Answers1

0

If you look at the generated HTML you see that the generated id is actually 1-greeting, so this worked for me:

1. [Greeting](#1-greeting)
...

## 1. Greeting
some txt

See also How to link to a named anchor in Multimarkdown?

Henryk Gerlach
  • 146
  • 1
  • 4