Giter Site home page Giter Site logo

Comments (8)

tajmone avatar tajmone commented on August 16, 2024

I'm not sure I understand, where are these supposed be available? in the GitHub previews of the documentation?

from pandoc-goodies.

tajmone avatar tajmone commented on August 16, 2024

You mean like this?

from pandoc-goodies.

rattletat avatar rattletat commented on August 16, 2024

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.

from pandoc-goodies.

tajmone avatar tajmone commented on August 16, 2024

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...

from pandoc-goodies.

tajmone avatar tajmone commented on August 16, 2024

http://pandoc.org/MANUAL.html#extension-auto_identifiers

http://pandoc.org/MANUAL.html#heading-identifiers

from pandoc-goodies.

rattletat avatar rattletat commented on August 16, 2024

Thanks I'll look into it!

from pandoc-goodies.

tajmone avatar tajmone commented on August 16, 2024

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.

from pandoc-goodies.

rattletat avatar rattletat commented on August 16, 2024

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 😆

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'

from pandoc-goodies.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.