Closed rattletat closed 5 years ago
I'm not sure I understand, where are these supposed be available? in the GitHub previews of the documentation?
Exactly.
I use a local website generated with pandoc. Atleast file links like
file:///home/user/site/index.html#Notes
do not jump to their respectice header and links like
file:///home/user/site/exercises#Exercise%20II..html
do not work at all.
The last one is generated when following a link.
Also, with linked local files (i.e. pdfs) it is always a .html
attached, resulting in file.pdf.html
, but this could be a pandoc config thing.
Pandoc has some options to control how the headings anchor IDs in the final document are generated, and these will always be linkable. I don't remember the various options out of my head (I'll look them up), but you should be able to look at the generated HTML source and extract those anchors.
You should also be careful about case-sensitiveness, for usually anchors are converted to lowercase.
Let me check Pandoc docs and I'll be back with some options discussion...
Thanks I'll look into it!
There are various options regarding the algorithms used to produce a valid anchor.
What I find strange is that it doesn't mention the HTML output for those extensions, but I know as a fact that it supports it.
If you tell pandoc to autogenerate a TOC for the html docs/web-pages you can easily test how these links work.
Let me know if you managed to solve it.
Hi, thanks for your help again! I managed to use the header identifiers. I initally used vimwikis nameing convention, which does not work with pandoc. Maybe I will look into writing a converter, for now I just look the identifer up or just write simpler headers :laughing:
The .html
problem was fixed by writing a filter. Mine is
sed 's/\(jpg\|pdf\).html/\1/g' | sed -e 's/\(href=".*\)\.html/\1/g'
Relative page links like
https://github.com/tajmone/pandoc-goodies/tree/master/templates/html5/github#primer-css
orhttps://github.com/tajmone/pandoc-goodies#gnu-general-public-license
would be awesome.