Writing a filter that will render markdown or highlight source code, the way GitHub does it, more or less. I find that my repos sometimes have "important" information in files other than README.md.
Oh ye Gods of Algorythms and Elegance, forgive me for I have sinned! This blog post shows how to have #cgit highlight source code and render Markdown. If you can read code, please don't click. If you host cgit, you might want to take a look?
https://alexschroeder.ch/wiki/2018-06-11_Highlighting_Code_and_Rendering_Markdown_for_cgit
@kensanata I see you caught the Python bug after all.
@deshipu The two existing source files were written in Python and I donโt have the urge to rewrite anything to Perl. There just wasnโt ever a reason use Python and I donโt think I would use it for a new project unless the library situation pushes me to do. But increasingly, it does... (like Mastodon.py)
@kensanata Any reason why you use sys.stdout.write() and not just print()?
@deshipu No reason except thatโs what the existing code used. I wondered myself. Just for symmetry because of the sys.stdin code?
@kensanata Personally I like to use the fileinput module โ it basically gives you what Perl has by default โ standard input or passed files. https://docs.python.org/2/library/fileinput.html
Also I hate typos! But that goes without saying, right?