Here is the script I use to convert the markdown source of the BikINI specification to Internet Draft format. It is named mdwn-to-html-to-id.sh (shocking choice, I know ;).
To run the script you will need awk, Markdown.pl, w3m, csplit, and par.
You can download the latest version of my script as a gzipped tarball.
You can also browse its git repository.