Searching for a way to automatically fetch foreign sources

I would like to have references to RFCs automatically fetched into my space (e.g., Attachments/RFC/123 ). Whenever I add [[RFC123]] (or perhaps [[RFC:123]]) reference to a document, I would like the link point to the Attachments/RFC/123 page automaticaly. If the page Attachments/RFC/123 does not exist, it will be (1) created, (2) the content of foreign source clean-text file will be fetched from the Internet and (3) the fetched content will be wrapped in fenced code block (because I want to fetch the clean-text versions of the RFCs) and (4) the page will be marked as read-only (if this can be done yet). How to achieve it, preferebly in Lua? Using some hooks? I’m a little lost in this case… Thanks for any ideas.

I want something similar, but without fetching, for manual pages. I usually write man(1) (in backticks, lost here) in my documents to express what user should follow to. I would love to make this a hyperlink to Attachments/MAN/<section>/<name> which would be prepopulated by me. I could live with this syntax too: [[fdisk(8)]], so the problem is partially similar to the above.


OT: By the way, is there any way to “hook” something on attributes, e.g., just [RFC:123] and when clicked …

I think you can use the editor:pageCreating event for this? Page templates in v2 - #2 by zef

1 Like