redimp / otterwiki

A minimalistic wiki powered by python, markdown and git.
https://otterwiki.com
MIT License
202 stars 22 forks source link

Plugin example: move wikilink processing #96

Closed weaversam8 closed 4 months ago

weaversam8 commented 4 months ago

CC @redimp - what do you think? This should be a really easy/simple hook to start with.

redimp commented 4 months ago

I'm running out of superlatives. This is brilliant.

preprocess_markdown is a well picked as proof of concept.

TBH: Using preprocessing for handling the wiki links was a workaround, because at this time my approaches to extend mistune were not working as I expected. Happy to see that this somehow became useful. 😅

Still need to understand how pluggy works exactly, but that will be easy with this PR. Will merge as soon as I get the hang of it.

I'll check tomorrow or at the weekend to see what other places there are that are suitable for hooks. I look forward to your suggestions.