Here's the best I can come up with so far, that looks possible:
Required: Permanent links, TOC, searchable
Desired: Minimal source structure, hard to break.
Not important: Platform independence (documentation source need not work as-is with other software).
For permanent links, we have fixed file names, and anchor IDs embedded in the source. Something like:
[permalink]: how-to-boot
# How to boot?
Insert SD card...
We process the output of mkdocs so that where "permalink" was in the source, the next anchor is replaced with what we specified.
The link source markdown could be generated by our scripts, then put in the source document. The writer then wouldn't need to create the link text. If it is missing it won't break anything.
The rules for editing docs, to avoid breaking links, are:
- Do not change file names
- Do not edit permalink line, or separate it from the section's text
- Do not move a permalink'd section to another file
([id] or [anchor] might be preferred over [permalink]. The tag could go after the title if preferred. I think this uses valid markdown syntax.)
Edit: These tags are optional, only necessary if we have external links to the documentation section, and if the section title is changed and no longer matches what was linked. If we wanted to avoid cluttering the source with these tags, we could have our scripts generate these lines only for any links that were in the previous mkdocs output but not the new one, indicating a possible change to the section title. These tags would essentially indicate the original section title.
[permalink]: how-to-boot
# Booting your device
After ensuring your power supply...