table of contents
| MD-UTILS(1p) | User Contributed Perl Documentation | MD-UTILS(1p) |
NAME¶
md-utils - Render markdown as HTML
SYNOPSIS¶
md-utils [options] [markdown-file]
DESCRIPTION¶
Utility to add a table of contents and other goodies to your GitHub flavored markdown.
- Add "@TOC@" where you want to see your TOC.
- Add "@TOC_BACK@" to insert an internal link to TOC.
- Add "@DATE(format-str)@" where you want to see a formatted date.
- Add "@GIT_USER@" where you want to see your git user name.
- Add "@GIT_EMAIL@" where you want to see your git email address.
- Use the --render option to render the HTML for the markdown
EXAMPLES¶
md-utils README.md.in > README.md md-utils -r README.md.in
OPTIONS¶
- -B, --body
- Default is to add body tag, use --nobody to prevent.
- -b, --both
- Interpolates intermediate file and renders HTML.
- -c, --css
- CSS file.
- -e, --engine
- Engine to use, options: github, text_markdown (default: text_markdown).
- -h, --help
- Help.
- -i, --infile
- Input file, default: STDIN
- -m, --mode
- For GitHub API mode is 'gfm' or 'markdown' (default: markdown).
- -N, --nocss
- Do not add any CSS link
- -n, --no-title
- Do not print a title for the table of contents.
- -o, --outfile
- Output file, default: STDOUT.
- -r, --render
- Render only, does NOT interpolate keywords.
- -R, --raw
- Return raw HTML from engine.
- -t, --title
- String to use for a custom title, default: "Table of Contents".
- -v, --version
- Version.
TIPS¶
- Use "!#" to prevent a header from being include in the table of contents. Add your own custom back to TOC message "@TOC_BACK(Back to Index)@".
- Date format strings are based on format strings supported by the Perl module Date::Format. The default format is "%Y-%m-%d" if no format is given.
- Use the --nobody tag to return the HTML without the "<html><body></body></html>" wrapper. --raw mode will also return HTML without wrapper.
SEE ALSO¶
Markdown::Render
AUTHOR AND LICENSE¶
Rob Lauer - rlauer6@comcast.net
This program is free software; you can use it and/or distribute it under the same terms as Perl itself.
| 2025-03-14 | perl v5.40.1 |