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 ;).