${root}
+- docs/
+- docs-glossarified/ (Generated)
+- node_modules/
|- glossarify-md.conf.json
|- package.json
'- .gitignore
npm i --save glossarify-md
glossarify-md.conf.json
{
"$schema": "./node_modules/glossarify-md/conf/v5/schema.json",
"baseDir": "./docs",
"outDir": "../docs-glossarified",
"glossaries": [{ "file": "./glossary.md" }],
"linking": {
"paths": "none",
"headingIdPandoc": true,
"headingIdAlgorithm": "md5-7",
"byReferenceDefinition": false,
"headingAsLink": false
}
}
When pandoc 🌎 merges multiple files into a single file we need to take care for link stability and paths.
linking.paths: "none"
disables the use of paths and uses heading ids (anchors), onlyheadingIdPandoc: true
adds pandoc-style{# foo}
attributes taken by pandoc 🌎 for its own linkingheadingIdAlgorithm: "md5"
generates a heading ID based on a hashsum which is unique accross the file set and therefore within a pandoc-merged file, too. Other values may bemd5-7, sha256, sha256-7
.byReferenceDefinition: false
disables link reference definitions and enables inline link urls. Reference numbers are not unique, either and would lose their referential purpose in a pandoc-merged file.
Optional
headingAsLink: false
disables headings being wrapped into links. Linkable headings may not required when there isheadingIdPandoc: true
.
After having set these options, files can be merged, e.g. with
pandoc --from=markdown -o out.html ./docs-glossarified/**/*.md