=head1 NAME Text::MarkMoreDown - Convert MarkMoreDown syntax to HTML =head1 SYNOPSIS use Text::MarkMoreDown 'markmod'; my $html = markmod($text); use Text::MarkMoreDown 'markmod'; my $html = markmod( $text, { empty_element_suffix => '>', tab_width => 2, } ); use Text::MarkMoreDown; my $m = Text::MarkMoreDown->new; my $html = $m->markdown($text); use Text::MarkMoreDown; my $m = Text::MarkMoreDown->new( empty_element_suffix => '>', tab_width => 2, ); my $html = $m->markdown( $text ); =head1 DESCRIPTION MarkMoreDown is a free MIT-licensed perl library for parsing and converting a superset of Markdown. It is supports standard Markdown (with some minor modifications) and various extensions that have inspired by PHP Markdown Extra, MultiMarkdown, kramdown and etc. =head1 SYNTAX =head2 Headings Headings from h1 through h6 are constructed with a # for each level: # h1 Heading ## h2 Heading ### h3 Heading #### h4 Heading ##### h5 Heading ###### h6 Heading
Lorem ipsum dolor sit amet, graecis denique ei vel, at duo primis mandamus. Et legere ocurreret pri, animal tacimates complectitur ad cum. Cu eum inermis inimicus efficiendi.
Labore officiis his ex, soluta officiisconcludaturque ei qui, vide sensibus vim ad.
Lorem ipsum dolor sit amet, graecis denique ei vel, at duo primis mandamus. Et legere ocurreret pri, animal tacimates complectitur ad cum. Cu eum inermis inimicus efficiendi.
Labore officiis his ex, soluta officiisconcludaturque ei qui, vide sensibus vim ad.
printf()
function.
=head3 Code Blocks
Pre-formatted code blocks are used for writing about programming or markup
source code. Rather than forming normal paragraphs, the lines of a code block
are interpreted literally. Markdown wraps a code block in both and
tags.
To produce a code block in Markdown, simply indent every line of the block by
at least 4 spaces or 1 tab. For example, given this input:
This is a normal paragraph:
This is a code block.
Markdown will generate:
This is a normal paragraph:
This is a code block.
One level of indentation — 4 spaces or 1 tab — is removed from each line of the
code block. For example, this:
Here is an example of AppleScript:
tell application "Foo"
beep
end tell
will turn into:
Here is an example of AppleScript:
tell application "Foo"
beep
end tell
=head3 separator
you can separate code blocks with ^
code block1
code block1
^
code block2
code block2
=head3 Block code "fences"
Use "fences" ``` to block in multiple lines of code.
```
codes...
```
or
``` perl
code...
code...
code...
```
code...
code...
code...
and
``` :class-name
some codes...
```
some codes...
=head2 Tables
| | Grouping ||
| First Header | Second Header | Third Header |
| ------------ | :-----------: | -----------: |
| Content | *Long Cell* ||
| Content | **Cell** | Cell |
| New section | More | Data |
=head2 Maths
=head3 Math block
$$
MathML
$$
or
\\[
MathML
\\]
=head3 inline Maths
$ Math formula $
or
\\(
formula
\\)
=head1 OPTIONS
MarkMoreDown supports a number of options to it's processor which control the behaviour of the output document.
These options can be supplied to the constructor, on in a hash with the individual calls to the markdown method.
See the synopsis for examples of both of the above styles.
The options for the processor are:
=over
=item empty element suffix
This option can be used to generate normal HTML output. By default, it is '>',
which is HTML, change to ' />' for xHTML.
=item img_ids
Controls if tags generated have an id attribute. Defaults to true.
Turn off for compatibility with the original markdown.
=item heading_ids
Controls if tags generated have an id attribute. Defaults to true.
Turn off for compatibility with the original markdown.
=item tab_width
Controls indent width in the generated markup, defaults to 4
=item disable_tables
If true, this disables the MarkMoreDown table handling.
=item disable_footnotes
If true, this disables the MarkMoreDown footnotes handling.
=item disable_bibliography
If true, this disables the MarkMoreDown bibliography/citation handling.
=item disable_definition_lists
If true, this disables the MarkMoreDown definition list handling.
=back
=head1 METHODS
=head2 new
A simple constructor, see the SYNTAX and OPTIONS sections for more information.
=head2 markmod
The main function as far as the outside world is concerned. See the SYNOPSIS
for details on use.
=head1 AUTHOR
John Gruber
http://daringfireball.net/
PHP port and other contributions by Michel Fortin
http://michelf.com/
MultiMarkdown by Fletcher Penney
http://fletcher.freeshell.org/
kramdown by Thomas Leitner
http://kramdown.gettalong.org/
CPAN Module Text::MultiMarkdown by Tomas Doran
http://www.bobtfish.net/
MarkMoreDown by Kiavash Mazi
http://kiavash.one
=head1 THIS DISTRIBUTION
Please note that this distribution is a fork of Fletcher Penny's MarkMoreDown project,
and it *is not* in any way blessed by him.
Whilst this code aims to be compatible with the original MarkMoreDown (and incorporates
and passes the MarkMoreDown test suite) whilst fixing a number of bugs in the original -
there may be differences between the behaviour of this module and MarkMoreDown. If you find
any differences where you believe Text::MarkMoreDown behaves contrary to the MarkMoreDown spec,
please report them as bugs.
=head1 SOURCE CODE
You can find the source code repository for L and L
on GitHub at .
=head1 COPYRIGHT AND LICENSE
Original Code Copyright (c) 2003-2004 John Gruber
All rights reserved.
MultiMarkdown changes Copyright (c) 2005-2006 Fletcher T. Penney
All rights reserved.
Text::MarkMoreDown changes Copyright (c) 2018 Kiavash Mazi
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name "Markdown" nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
This software is provided by the copyright holders and contributors "as
is" and any express or implied warranties, including, but not limited
to, the implied warranties of merchantability and fitness for a
particular purpose are disclaimed. In no event shall the copyright owner
or contributors be liable for any direct, indirect, incidental, special,
exemplary, or consequential damages (including, but not limited to,
procurement of substitute goods or services; loss of use, data, or
profits; or business interruption) however caused and on any theory of
liability, whether in contract, strict liability, or tort (including
negligence or otherwise) arising in any way out of the use of this
software, even if advised of the possibility of such damage.
=cut