Pandoc: universal document converter
johnmacfarlane.net
johnmacfarlane.net
And you can easily script it in Haskell - I wrote one plugin that archives external links in the Internet Archive & WebCitation, and another link which adds interwiki syntax to markdown, eg. '[Plato](!Wikipedia)' or '[abstruse](!Wiktionary)' or '[scanl](!Hoogle)' or '[gitit](!Hackage)'.
If you extended Pandoc, do you mind giving a pointer to your source? I write Haskell poorly, so an example would be appreciated.
https://github.com/jgm/gitit/blob/master/plugins/Interwiki.h...
https://github.com/jgm/gitit/blob/master/plugins/Subst.hs
https://github.com/jgm/gitit/blob/master/plugins/WebArchiver...
They are meant for use with Gitit, but they are easily adapted for other purposes. For example, the archive code was easily adapted into a script to read Markdown files and spit out external links to stdout: http://groups.google.com/group/pandoc-discuss/browse_thread/...
http://leanpub.com/learn-python/
The whole process took about two minutes (pandoc converted all the HTML to basically perfect Markdown). I've told the guys who run leanpub about pandoc, hopefully they'll use it to compile all of its formats down to LaTeX so you can publish books much more easily.
Instead, I started writing markdown and wrote a script that used Pandoc to convert it to LaTeX, insert headers/footers and company logo etc, and finally used latexmk to output PDFs. This looked far more professional than the word documents we shipped previously.
It also successfully separated content (markdown text files) from presentation (handled by script), making sure all PDFs had a consistent look.
With documentation being just another buffer in emacs it was more often written/sketched when implementing, instead of being a task to do last when you had already run out of time.
It is also much easier for developers to follow changes to the documentation in the version control system, and merges are a breeze instead of a time-sink.