Newcomen

Description A static content generator.
Newcomen > Perl Modules > Newcomen::Formatter::MultiMarkdown
Source

Index


NAME ^

Newcomen::Formatter::MultiMarkdown - MultiMarkdown formatter.

DESCRIPTION ^

Formatter backends are usually not called directly. See Newcomen::Formatter for the frontend documentation.

This module provides a formatter backend to apply MultiMarkdown formatting to a piece of text. It uses Text::MultiMarkdown to do the actual formatting.

Note: The formatted text will be post-processed to remove <p> tags around the following HTML tags:

<address> <article> <aside> <footer> <header>

A simple search/replace regular expression is used to get rid of the <p> immediately preceding or following the aforementioned tags. It may not work in all cases, please file a detailed bug report if required.

OPTIONS ^

{
   'formatter'        => {
      'multimarkdown' => {
         'use_cache'  => 1,
      },
   },
}

These are the default options set by this backend. They may be overridden by user configuration.

The use_cache option (defaults to 1) may be used to disable the caching for this formatter backend - if required - by setting it to a false value.

Apart from that, the formatter/multimarkdown hashref may contain any options supported by Text::MultiMarkdown. For example:

{
   'formatter'                   => {
      'multimarkdown'            => {
         'empty_element_suffix'  => '>',
         'tab_width'             => 2,
         'use_wikilinks'         => 1,
      },
   },
}

The formatter/multimarkdown hashref will be passed to markdown() (of the Text::MultiMarkdown module) as specified in the configuration, with the use_cache key deleted if it was included. If formatter/multimarkdown is undef, an empty hashref will be used, but you should only set it to undef if you know what you are doing.

CACHING ^

Results of this backend may be cached by the formatter frontend. The formatting only depends on the options, for effective caching the same options should be used for all pages. Note that even if Text::MultiMarkdown's behaviour does not change for some options (for example, when including default values in the options hashref), different options will cause separate cached values, so don't do this. Keeping this in mind, it is save to include this formatter early in the formatting chain as far as the caching is concerned.

Caching may be disabled for this backend (see above), it may also be disabled globally (see Newcomen::Formatter).

CLASS AND INSTANCE METHODS ^

See Newcomen::Formatter::Backend.

SEE ALSO ^

Text::MultiMarkdown, Newcomen::Content, Newcomen::Formatter, Newcomen::Formatter::Backend

VERSION ^

This is version 2014052501.

AUTHOR ^

Stefan Goebel - newcomen {at} subtype {dot} de

COPYRIGHT AND LICENSE ^

Copyright 2013-2014 Stefan Goebel.

This file is part of Newcomen.

Newcomen is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the license, or (at your option) any later version.

Newcomen is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Newcomen. If not, see <http://www.gnu.org/licenses/>.