The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

pmarkdown – Very configurable Markdown processor written in pure Perl, supporting the CommonMark spec and many extensions.

SYNOPSIS

  pmarkdown [-o key=value] ... < in_file.md > out_file.html_fragment

DESCRIPTION

Currently pmarkdown can only read a single input from its standard input and will write its output on the standard output. Both are assumed to be encoded in UTF-8.

If needed, See the GitHub pmarkdown page for installation instructions.

OPTIONS

--help, -h

Show a short help message about the program.

--helpfull

Show the complete man page of the program.

--list-options

Show the documentation of all the existing options of the Markdown processor. This is the same content that can be found on the Markdown::Perl::Options page.

These options can be passed to the program with the --options flag.

--version, -v

Show the version of this program.

--mode mode, -m

Specify a mode for the Markdown processor. A mode is a set of configuration options working together, typically to replicate the semantics of another existing Markdown processor. See the "MODES" section in this page for a list of available modes.

When a mode is applied, is set specific values for some options but any value for these options set through the --option flag will take precedence.

--option option=value, -o

Specify the value for one particular option. The --option flag can be passed multiple times. If an option is specified multiple times, the last value takes precedence.

The options are described in the Markdown::Perl::Options page. You can see it with the pmarkdown --list-options command.

When specifying an option value, boolean options should be passed as either 0, 1, false, or true.

Note that all options are applied on top of the selected mode. Even if the options are passed before the --mode flag, the mode will not override options set through --option.

MODES

default

The default mode if no other mode is specified. This mode uses the default value for all the options (as per their documentation). The default syntax is documented in the GitHub repository of the project: https://github.com/mkende/pmarkdown/blob/main/Syntax.md

Note that, in practice, setting the mode to default is equivalent to not setting a mode at all, except that subsequent calls to set a mode will raise a warning about the mode being overwritten.

cmark

This mode implements the full CommonMark spec.

github

This mode implements the GitHub Flavored Markdown variant of the CommonMark spec.

markdown

This mode implements the original Markdown syntax.

Note that this mode is not 100% similar to the original Markdown.pl script as that script has some buggy behavior that we are not reproducing.

AUTHOR

This program has been written by Mathias Kende.

LICENCE

Copyright 2024 Mathias Kende

This program is distributed under the MIT (X11) License: http://www.opensource.org/licenses/mit-license.php

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

SEE ALSO

cmark(1), CommonMark Spec