1Text::MultiMarkdown(3)User Contributed Perl DocumentationText::MultiMarkdown(3)
2
3
4
6 Text::MultiMarkdown - Convert MultiMarkdown syntax to (X)HTML
7
9 use Text::MultiMarkdown 'markdown';
10 my $html = markdown($text);
11
12 use Text::MultiMarkdown 'markdown';
13 my $html = markdown( $text, {
14 empty_element_suffix => '>',
15 tab_width => 2,
16 use_wikilinks => 1,
17 } );
18
19 use Text::MultiMarkdown;
20 my $m = Text::MultiMarkdown->new;
21 my $html = $m->markdown($text);
22
23 use Text::MultiMarkdown;
24 my $m = Text::MultiMarkdown->new(
25 empty_element_suffix => '>',
26 tab_width => 2,
27 use_wikilinks => 1,
28 );
29 my $html = $m->markdown( $text );
30
32 Markdown is a text-to-HTML filter; it translates an easy-to-read /
33 easy-to-write structured text format into HTML. Markdown's text format
34 is most similar to that of plain text email, and supports features such
35 as headers, *emphasis*, code blocks, blockquotes, and links.
36
37 Markdown's syntax is designed not as a generic markup language, but
38 specifically to serve as a front-end to (X)HTML. You can use span-level
39 HTML tags anywhere in a Markdown document, and you can use block level
40 HTML tags ("<div>", "<table>" etc.). Note that by default Markdown
41 isn't interpreted in HTML block-level elements, unless you add a
42 "markdown=1"" attribute to the element. See Text::Markdown for details.
43
44 This module implements the MultiMarkdown markdown syntax extensions
45 from:
46
47 http://fletcherpenney.net/multimarkdown/
48
50 For more information about (original) Markdown's syntax, see:
51
52 http://daringfireball.net/projects/markdown/
53
54 This module implements MultiMarkdown, which is an extension to
55 Markdown..
56
57 The extension is documented at:
58
59 http://fletcherpenney.net/multimarkdown/
60
61 and borrows from php-markdown, which lives at:
62
63 http://michelf.com/projects/php-markdown/extra/
64
65 This documentation is going to be moved/copied into this module for
66 clearer reading in a future release..
67
69 MultiMarkdown supports a number of options to it's processor which
70 control the behaviour of the output document.
71
72 These options can be supplied to the constructor, on in a hash with the
73 individual calls to the markdown method. See the synopsis for examples
74 of both of the above styles.
75
76 The options for the processor are:
77
78 use_metadata
79 Controls the metadata options below.
80
81 strip_metadata
82 If true, any metadata in the input document is removed from the
83 output document (note - does not take effect in complete document
84 format).
85
86 empty element suffix
87 This option can be used to generate normal HTML output. By default,
88 it is ' />', which is xHTML, change to '>' for normal HTML.
89
90 img_ids
91 Controls if <img> tags generated have an id attribute. Defaults to
92 true. Turn off for compatibility with the original markdown.
93
94 heading_ids
95 Controls if <hX> tags generated have an id attribute. Defaults to
96 true. Turn off for compatibility with the original markdown.
97
98 bibliography_title
99 The title of the generated bibliography, defaults to
100 'Bibliography'.
101
102 tab_width
103 Controls indent width in the generated markup, defaults to 4
104
105 disable_tables
106 If true, this disables the MultiMarkdown table handling.
107
108 disable_footnotes
109 If true, this disables the MultiMarkdown footnotes handling.
110
111 disable_bibliography
112 If true, this disables the MultiMarkdown bibliography/citation
113 handling.
114
115 disable_definition_lists
116 If true, this disables the MultiMarkdown definition list handling.
117
118 A number of possible items of metadata can also be supplied as options.
119 Note that if the use_metadata is true then the metadata in the document
120 will overwrite the settings on command line.
121
122 Metadata options supported are:
123
124 document_format
125 use_wikilinks
126 base_url
127 self_url - The document url is prepended to the "#" anchor of
128 footnotes.
129
131 MultiMarkdown supports the concept of 'metadata', which allows you to
132 specify a number of formatting options within the document itself.
133 Metadata should be placed in the top few lines of a file, on value per
134 line as colon separated key/value pairs. The metadata should be
135 separated from the document with a blank line.
136
137 Most metadata keys are also supported as options to the constructor, or
138 options to the markdown method itself. (Note, as metadata, keys contain
139 space, whereas options the keys are underscore separated.)
140
141 You can attach arbitrary metadata to a document, which is output in
142 HTML <META> tags if unknown, see t/11document_format.t for more info.
143
144 A list of 'known' metadata keys, and their effects are listed below:
145
146 document format
147 If set to 'complete', MultiMarkdown will render an entire xHTML
148 page, otherwise it will render a document fragment
149
150 css Sets a CSS file for the file, if in 'complete' document format.
151
152 title
153 Sets the page title, if in 'complete' document format.
154
155 use wikilinks
156 If set to '1' or 'on', causes links that are WikiWords to
157 automatically be processed into links.
158
159 base url
160 This is the base URL for referencing wiki pages. In this is not
161 supplied, all wiki links are relative.
162
164 new
165 A simple constructor, see the SYNTAX and OPTIONS sections for more
166 information.
167
168 markdown
169 The main function as far as the outside world is concerned. See the
170 SYNOPSIS for details on use.
171
173 To file bug reports or feature requests please send email to:
174
175 bug-Text-Markdown@rt.cpan.org
176
177 Please include with your report: (1) the example input; (2) the output
178 you expected; (3) the output Markdown actually produced.
179
181 See the Changes file for detailed release notes for this version.
182
184 John Gruber
185 http://daringfireball.net/
186
187 PHP port and other contributions by Michel Fortin
188 http://michelf.com/
189
190 MultiMarkdown changes by Fletcher Penney
191 http://fletcher.freeshell.org/
192
193 CPAN Module Text::MultiMarkdown (based on Text::Markdown by Sebastian
194 Riedel) originally by Darren Kulp (http://kulp.ch/)
195
196 This module is maintained by: Tomas Doran http://www.bobtfish.net/
197
199 Please note that this distribution is a fork of Fletcher Penny's
200 MultiMarkdown project, and it *is not* in any way blessed by him.
201
202 Whilst this code aims to be compatible with the original MultiMarkdown
203 (and incorporates and passes the MultiMarkdown test suite) whilst
204 fixing a number of bugs in the original - there may be differences
205 between the behaviour of this module and MultiMarkdown. If you find any
206 differences where you believe Text::MultiMarkdown behaves contrary to
207 the MultiMarkdown spec, please report them as bugs.
208
210 You can find the source code repository for Text::Markdown and
211 Text::MultiMarkdown on GitHub at
212 <http://github.com/bobtfish/text-markdown>.
213
215 Original Code Copyright (c) 2003-2004 John Gruber
216 <http://daringfireball.net/> All rights reserved.
217
218 MultiMarkdown changes Copyright (c) 2005-2006 Fletcher T. Penney
219 <http://fletcher.freeshell.org/> All rights reserved.
220
221 Text::MultiMarkdown changes Copyright (c) 2006-2009 Darren Kulp
222 <http://kulp.ch> and Tomas Doran <http://www.bobtfish.net>
223
224 Redistribution and use in source and binary forms, with or without
225 modification, are permitted provided that the following conditions are
226 met:
227
228 * Redistributions of source code must retain the above copyright
229 notice,
230 this list of conditions and the following disclaimer.
231
232 * Redistributions in binary form must reproduce the above copyright
233 notice, this list of conditions and the following disclaimer in the
234 documentation and/or other materials provided with the distribution.
235
236 * Neither the name "Markdown" nor the names of its contributors may
237 be used to endorse or promote products derived from this software
238 without specific prior written permission.
239
240 This software is provided by the copyright holders and contributors "as
241 is" and any express or implied warranties, including, but not limited
242 to, the implied warranties of merchantability and fitness for a
243 particular purpose are disclaimed. In no event shall the copyright
244 owner or contributors be liable for any direct, indirect, incidental,
245 special, exemplary, or consequential damages (including, but not
246 limited to, procurement of substitute goods or services; loss of use,
247 data, or profits; or business interruption) however caused and on any
248 theory of liability, whether in contract, strict liability, or tort
249 (including negligence or otherwise) arising in any way out of the use
250 of this software, even if advised of the possibility of such damage.
251
252
253
254perl v5.36.0 2023-01-20 Text::MultiMarkdown(3)