The code is on Github,
https://github.com/wqking/markdownutil
Your feedback and contributes are welcome.
The scripts
addtoc2md.pl
Adds table of contents to Github flavored Markdown files.
Features
- Use <a> anchor tag as the TOC target. It doesn't depend on Github auto anchor feature.
- Can selectively generate TOC for lengthy article with enough headings. (The --min-headings option)
- Repeating the command on the same file will replace the previous TOC instead of adding more TOC.
- Code blocks can be handled correctly, the code lines start with '#' won't be treated as headings.
doku2md.pl
Converts Dokuwiki page files to Github flavored Markdown files.
Features
- Support basic heading and format syntax.
- Support URL link syntax.
- Support image syntax.
- Customizable.