%%-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
text
as the entire text between%%
-markers (so excluding such markers) - if
text
contains the|
-character, thenshowText
is the part before, andrefText
is the part behind that character. - else,
showText = text
andrefText = 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
reftext
refers 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.