%%-references pre-processing
When writing documentation, it frequently occurs that I make some mistakes that might be resolved by some (pre)processing of %%-references. Also, it frequently occurs that I have the same text before and after the | separator.
To make it much easier for authors, I suggest we do the following:
- Assume we have
textas the entire text between%%-markers (so excluding such markers) - if
textcontains the|-character, thenshowTextis the part before, andrefTextis the part behind that character. - else,
showText = textandrefText = text. - make
refText all lowercase, and replace every space(s), i.e./\s+/g-sequences, with a single-`-character. - if the file to which the resulting
reftextrefers does not exist, it would be nice to have this condition logged (and presented at the end of processing), preferably with the filename, line and columnnumbers of the%%-structure that caused the event.
I have tried to do this (except for point 4) myself, but I keep getting Unhandled promise rejection errors, and also (but less frequently) ReferenceError: useBaseUrl is not defined errors.
Edited by Rieks Joosten