Text::...arkdown(3pm)

πŸ“¦
version 1.000035 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Text::MultiMarkdown πŸ’–

okay bestie, this is the manual page for Text::MultiMarkdown, and yes it's a Perl module (3pm energy, user-contributed docs, the whole vibe). grab a strawberry πŸ“ and let's go, because this one actually slaps.


✨ NAME ✨

Text::MultiMarkdown β€” converts MultiMarkdown syntax into (X)HTML. that's the whole job. that's the assignment. πŸ’…

✨ SYNOPSIS ✨

here's the quick-start, all four flavors, copy these exactly bestie:

use Text::MultiMarkdown 'markdown';
my $html = markdown($text);

use Text::MultiMarkdown 'markdown';
my $html = markdown( $text, {
    empty_element_suffix => '>',
    tab_width => 2,
    use_wikilinks => 1,
} );

use Text::MultiMarkdown;
my $m = Text::MultiMarkdown->new;
my $html = $m->markdown($text);

use Text::MultiMarkdown;
my $m = Text::MultiMarkdown->new(
    empty_element_suffix => '>',
    tab_width => 2,
    use_wikilinks => 1,
);
my $html = $m->markdown( $text );

✨ DESCRIPTION ✨

so Markdown is a text-to-HTML filter β€” it takes this easy-to-read / easy-to-write structured text format and turns it into HTML. and the text format? it's giving plain text email, lowkey. it supports headers, emphasis, code blocks, blockquotes, and links. iconic behavior honestly.

Markdown's syntax was designed not as some generic markup language, but specifically to be a front-end to (X)HTML. which means: you can use span-level HTML tags anywhere in a Markdown document, and you can use block level HTML tags (<div>, <table> etc.) too. but heads up β€” by default Markdown isn't interpreted inside HTML block-level elements, unless you add a markdown=1" attribute to the element. see Text::Markdown for the details on that one 🫢

this module implements the MultiMarkdown markdown syntax extensions from:

http://fletcherpenney.net/multimarkdown/

✨ SYNTAX ✨

want more info about (original) Markdown's syntax? it's right here:

http://daringfireball.net/projects/markdown/

this module implements MultiMarkdown, which is an extension to Markdown..

the extension is documented at:

http://fletcherpenney.net/multimarkdown/

and it borrows from php-markdown, which lives at:

http://michelf.com/projects/php-markdown/extra/

and yes, this documentation is going to be moved/copied into this module for clearer reading in a future release.. (future us is gonna handle it, no cap πŸ“Œ)

✨ OPTIONS ✨

MultiMarkdown 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, or in a hash with the individual calls to the markdown method. the synopsis up there shows examples of both styles, king behavior πŸ‘‘

the options for the processor are:

  • use_metadata β€” controls the metadata options below.
  • strip_metadata β€” if true, any metadata in the input document gets removed from the output document. (note: does not take effect in complete document format.)
  • empty element suffix β€” this option can be used to generate normal HTML output. by default it's ' />', which is xHTML β€” change it to '>' for normal HTML.
  • img_ids β€” controls if <img> tags generated have an id attribute. defaults to true. turn it off for compatibility with the original markdown.
  • heading_ids β€” controls if <hX> tags generated have an id attribute. defaults to true. turn it off for compatibility with the original markdown.
  • bibliography_title β€” the title of the generated bibliography, defaults to 'Bibliography'.
  • tab_width β€” controls indent width in the generated markup, defaults to 4.
  • disable_tables β€” if true, this disables the MultiMarkdown table handling.
  • disable_footnotes β€” if true, this disables the MultiMarkdown footnotes handling.
  • disable_bibliography β€” if true, this disables the MultiMarkdown bibliography/citation handling.
  • disable_definition_lists β€” if true, this disables the MultiMarkdown definition list handling.

a number of possible items of metadata can also be supplied as options. but note πŸ‘€ β€” if use_metadata is true, then the metadata in the document will overwrite the settings on command line. so like, the document wins, okay?

metadata options supported are:

  • document_format
  • use_wikilinks
  • base_url
  • self_url β€” the document url is prepended to the "#" anchor of footnotes.

✨ METADATA ✨

MultiMarkdown supports the concept of 'metadata', which lets you specify a number of formatting options within the document itself. metadata should be placed in the top few lines of a file, one value per line, as colon separated key/value pairs. and the metadata has to be separated from the document with a blank line. (blank line = the boundary, don't forget it πŸ’€)

most metadata keys are also supported as options to the constructor, or options to the markdown method itself. (note: as metadata, keys contain spaces, whereas as options the keys are underscore separated. yes really.)

you can attach arbitrary metadata to a document, which is output in HTML <META> tags if unknown β€” see t/11document_format.t for more info.

a list of 'known' metadata keys, and their effects, is below:

  • document format
    • if set to 'complete', MultiMarkdown will render an entire xHTML page, otherwise it will render a document fragment.
    • css β€” sets a CSS file for the file, if in 'complete' document format.
    • title β€” sets the page title, if in 'complete' document format.
  • use wikilinks β€” if set to '1' or 'on', causes links that are WikiWords to automatically be processed into links.
  • base url β€” this is the base URL for referencing wiki pages. in this is not supplied, all wiki links are relative.

✨ METHODS ✨

πŸ’« new πŸ’«

a simple constructor β€” see the SYNTAX and OPTIONS sections for more information.

πŸ’« markdown πŸ’«

the main function as far as the outside world is concerned. see the SYNOPSIS for details on use. this is the main character fr.

✨ BUGS ✨

to file bug reports or feature requests please send email to:

bug-Text-Markdown@rt.cpan.org

and bestie please include with your report: (1) the example input; (2) the output you expected; (3) the output Markdown actually produced. receipts, all three, every time πŸ™

✨ VERSION HISTORY ✨

see the Changes file for detailed release notes for this version.

✨ AUTHOR ✨

John Gruber
http://daringfireball.net/

PHP port and other contributions by Michel Fortin
http://michelf.com/

MultiMarkdown changes by Fletcher Penney
http://fletcher.freeshell.org/

CPAN Module Text::MultiMarkdown (based on Text::Markdown by Sebastian
Riedel) originally by Darren Kulp (http://kulp.ch/)

This module is maintained by: Tomas Doran http://www.bobtfish.net/

✨ THIS DISTRIBUTION ✨

okay important: please note that this distribution is a fork of Fletcher Penny's MultiMarkdown project, and it *is not* in any way blessed by him. (respect where respect is due 🫑)

whilst this code aims to be compatible with the original MultiMarkdown (and incorporates and passes the MultiMarkdown test suite) whilst fixing a number of bugs in the original β€” there may be differences between the behaviour of this module and MultiMarkdown. if you find any differences where you believe Text::MultiMarkdown behaves contrary to the MultiMarkdown spec, please report them as bugs. we want the tea β˜•

✨ SOURCE CODE ✨

you can find the source code repository for Text::Markdown and Text::MultiMarkdown on GitHub at <http://github.com/bobtfish/text-markdown>. go star it or whatever, iykyk ⭐

okay legal era, let's get through it:

Original Code Copyright (c) 2003-2004 John Gruber <http://daringfireball.net/> All rights reserved.

MultiMarkdown changes Copyright (c) 2005-2006 Fletcher T. Penney <http://fletcher.freeshell.org/> All rights reserved.

Text::MultiMarkdown changes Copyright (c) 2006-2009 Darren Kulp <http://kulp.ch> and Tomas Doran <http://www.bobtfish.net>

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.


πŸŽ€ that's the whole page bestie, you ate πŸ’…

sign-off time: this was rendered as perl v5.36.0, dated 2022-11-21, and the page title tag thingy is Text::...arkdown(3pm) β€” that's the footer energy, now go write some markdown πŸ¦‹