Markdown-Render
view release on metacpan or search on metacpan
README.md.in view on Meta::CPAN
@TOC@
__Updated @DATE(%Y-%m-%d)@__ by @GIT_USER@ <@GIT_EMAIL@>
# README
A quick search regarding how to get a table of contents into my
markdown yielded only a few hits or projects that seemed a little weighty
to me, so here's a little Perl script with just a few
dependencies that you might find useful. See [Usage](#usage) for more
information.
The script will render your markdown as HTML using either the [GitHub
API](https://docs.github.com/en/rest/markdown) or the Perl module [Text::Markdown::Discount](https://metacpan.org/pod/Text::Markdown::Discount)
A default stylesheet will be applied but you can provide your own
style sheet as well.
# Installation
## Prerequisites
The script has been tested with these versions, but others might work
too.
| Module | Version |
|--------------------------|---------|
| `CLI::Simple | 1.0.11 |
| `Class::Accessor::Fast` | 0.51 |
| `Config::Tiny` | 2.30 |
| `Date::Format` | 2.24 |
| `HTTP::Request` | 6.00 |
| `IO::Scalar` | 2.113 |
| `IO::Socket::SSL` | |
| `JSON` | 4.03 |
| `HTTP::Tiny` | 6.36 |
| `Net::SSLeay` | |
| `Readonly` | 2.05 |
## Building and Deploying
The build will now create a CPAN distribution.
```
git clone https://github.com/rlauer6/markdown-utils.git
make && make cpan
```
To deploy the application use `cpanm`
```
curl -L https://cpanmin.us | perl - --sudo App::cpanminus
cpanm -n -v cpan/Markdown-Render-*.tar.gz
```
## Building from CPAN
```
cpanm -v Markdown::Render
```
# Usage
```
Usage:
md-utils.pl options [markdown-file]
Utility to add a table of contents and other goodies to your GitHub
flavored markdown.
* @TOC@ where you want to see your TOC.
* @TOC_BACK@ to insert an internal link to TOC
* @DATE(format-str)@ where you want to see a formatted date
* @GIT_USER@ where you want to see your git user name
* @GIT_EMAIL@ where you want to see your git email address
* the --render option to render the HTML for the markdown
Examples:
md-utils.pl README.md.in > README.md
md-utils.pl -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 github, text_markdown (default: github)
-h help
-i, --infile input file, default: STDIN
( run in 0.659 second using v1.01-cache-2.11-cpan-6aa56a78535 )