When I went through the process of determining the architecture for the blog system I picked out a few features I wanted to achieve:
- Non-html markup
- Easy code formatting and highlighting
- Easy to export and import
- Ability to inject my own functionality into text processing
- Markup is easy enough for me to choose my own text editor
For this I chose MarkdownDeep as the format of each text post. Markdown wasn’t something I was familiar with but I had used LaTeX and AsciiDoc so I wanted to achieve something similar. However, there was still some tinkering that needed to be done to simplify code formatting and to add in my own functionality.
For code formatting I chose to use prettify. MarkdownDeep had a post about integratting prettify so the setup went smoothly. The general use of MarkdownDeep can be seen here.
I also added the ability to access my Picasa repository class to retrieve photos and to recognize and process UrlHelper formatted links. To do this I had to inherit the markdown class and overload the OnQualifyUrl method. If the url started with “getphoto=” I would create a Url using my Picasa repository. Otherwise if the url contained either a tilde or comma I would use the UrlHelper class to generate a url. This allowed me to add Picasa images simply by specifying their title. I could also avoid using static urls for internal links without having to worry about what page my link showed up on.
