GSoC/GCI Archive
Google Code-in 2012 The NetBSD Project

Write a markdown - curses converter

completed by: Michał Zieliński

mentors: Julian Coleman, Julian Fagir

This task is not strictly for NetBSD, but another project named libsoldout: http://fossil.instinctive.eu/libsoldout/index

libsoldout is a markdown converter written in C and published under public domain. Though there are already other tools which would do this task, they either have a licence that is not usable by NetBSD or have too many dependencies (like pandoc).

As we maybe want to use libsoldout for shell usage, and mdoc is too slow to be parsed, we want a converter which directly translates markdown directly to something terminal-readable, i.e. either bold or underlined text and indentation. The overall look should look like mdoc.

Markdown itself is already plaintext-readable, but there are some things which could be more nice. Additionally, we have to parse it anyway to use links. All in all, it's mainly about specifying some tags you use for inserting and putting it in C code.

You can take the html or the mdoc converter as a template for this:
http://fossil.instinctive.eu/libsoldout/artifact/fd100c723c722189d62fd9bf261d67db69240043 and http://fossil.instinctive.eu/libsoldout/artifact/1e22b7962dfba92c28f4916609746045dbe29a90 respectively.

Though this task seems large, the task itself is rather small. You have to analyze the converters for mdoc and html and replace their tags by the appropriate curses ones.

If you've never worked with curses, feel free to ask. You won't need many tags, only the formatting things like bold font, coloured font. Knowing curses is not a prerequisite.

 

You don't have to fully cover markdown. Some tags (links and images at least) cannot be displayed, but you should provide hooks for everything and leaving those, which cannot be used, empty.