My goal is to create a locally-browsable clone of the bitbucket's wiki browser. Pages are written using creole syntax.
I'm using python-creole to render the files into html. It works relatively fine, but there is a difference between the way python-creole and bitbucket render internal links.
On the Bitbucket site, an internal link with spaces like [[system programming]] will render to something like <a href="/wiki/system_programming">system programming</a> (spaces are replaced by _ ) while using python-creole this will render to <a href="system programming">system programming</a>.
Can I tweak python-creole into replacing spaces by _ and how?
I think I have found a quite dirty way to do this. Looking to creole source-code, the code which turns links to html is here:
In a python shell I have tried the following code:
The exact code to replace spaces by '_' is left as an exercice to the reader...
I'm still looking for a more correct way to do this in "the official way".