A Look at JamesCMS: Markdown Tricks

Posted Friday, April 5, 2013 in Old JamesCMS Posts

When I went through the process of determining the architecture for the blog system I picked out a few features I wanted to achieve:

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.