# Creating a simple markdown log system

26 January 2019

I spent a while today working on what amounts to a form of static site generator for the /log section of this website. Now, instead of writing every log entry in raw HTML, they can be written in markdown. The markdown is run through a Python program that will substitute it into a template a produce an appropriately-named HTML file, which is then placed in the correct directory. At the directory level, I also wrote a Python program to read the title of every entry file (that's the purpose of the 'title:' comment on oeach of these pages). The second program will determine how many entry pages there are, index all of them, and write all of the appropriate links into the index page for the directory. These programs are not particularly polished and are very not portable for other workloads, so I won't put any site generation code on display until such time as the programs need to be updated properly. That said, if you feel so inclined to read the index-generator code, check out gen.py. The other [page] generator is too trival to include, as it just runs one file through a markdown processor and then dumps the contents and a date through a template file. It doesn't need to do any of the fancy sorting and title extracting that the linked generator program does.