Brett on 21 Nov, 2019 07:50 PM
The entire concatenated file should be processed, but there's no
individual processing for included files. Does that answer your
question? If not, could you give me some more details on exactly how
you're including files and what your preprocessor setup is?
Thanks for a speedy response. In light of your answer, I can now see I hadn’t quite tested enough to realise what was happening.
You’re right, of course, that when I include a file using the standard syntax (e.g. <<[Testing 321.txt]) everything is processed.
I use a simple preprocessor to do one or two things to notes in nvALT, like turning [[Links]] into Markdown links that will still link back to those original notes in previews, etc. (You actually helped me with the regex for that one moons ago – thanks again!)
What I want to achieve is to have functional [[Links]] to the files in nvALT (or ULTRA!) that would turn into includes in the preview. To do that, I’ve attempted using a regex in a preprocessor that will take any [[Link]] followed directly by a symbol (◇) and turn it into the include syntax – thus, instead of being turned into a Markdown link by the preprocessor, it gets turned into an include.
All that is working fine, but for the fact that the file included is not then processed by the preprocessor as it would be if the include syntax actually appeared in the main file rather than being “created” as it were at this stage.
Perhaps this is just a really stupid thing to attempt! But I’ve been working on the basis of something that would be very useful for me. Is it just impossible?
Brett on 21 Nov, 2019 09:57 PM
Well, preprocessing every individual file is very complicated from
Marked's perspective, so I doubt anything will change there. And you're
right, by the time Marked runs the preprocessor, it's already checked
for includes and won't process new ones.
You do have the option, of course, of inserting the text yourself. If
you're already doing a search and replace, you should be able to `cat`
the actual note into place. It would still get all of the regular
processing, but if you needed to preprocess the included note as well
then things get a step more complicated. But just inserting the text of
files you have a path for shouldn't be impossible.
BTW, in nvUltra the MMD transclusion syntax works in the preview