Before i used pandoc/markdown, i've written an individual script with similar intentions