Open Havvy opened 6 years ago
This sounds like something which would be perfect for a pre-processor plugin to do. Technically it could be added as part of the html renderer, but it sounds more like something you'd do as part of pre-processing before sending the document to the renderer...
I am looking for this specifically. Has anyone started on a pre-processor like this yet? If not, I'd gladly make this contribution.
I think this may be accomplished by using the default #include
behavior to add a set of links to the bottom of your files:
{{#include reflinks.md}}
of course this process isn't totally automatic.
In the Rust Reference, but presumably in other books as well, there is a lot of cross-linking. Every page has to copy this link around, and if the link changes, every page that links to it has to be updated. I'd rather there be a central list of these common links.
As such, much like there's a
SUMMARY.md
, I'd like to see a new special filed added calledLINKS.md
orLINKS.mdbook.md
orLINKS.mdbook
or something similar. This special page would only be able to only contain reference links of the style[name]: url
. This page would then be appended (not prepended) to each normal markdown page (so not SUMMARY.md) before passed to the markdown renderer.The reason for being appended is that the first reference link definition is used, so if a page defines one itself that clashes with one from the common list, it should be the one that is used.
Thoughts?