Cookbook /
MarkdownMarkupExtension
Summary: Use Markdown markup with PmWiki
Version: 2021-11-12
Prerequisites: pmwiki-2.0
Last-tested-with: pmwiki-2.2.144
Status: stable
Maintainer:
Votes:
Discussion: MarkdownMarkupExtension-Talk
Question
How to use John Grubers Markdown markup?
Answer
Installation
- download markdownpmw.phpΔ and put it into your
cookbook/
folder - include this file with
include_once("
in your$FarmD
/cookbook/markdownpmw.php");config.php
For the translation itself we use Michel Fortin's PHP Markdown library.
- download PHP Markdown Lib from https://michelf.ca/projects/php-markdown/ and put the
Michelf/
folder yourcookbook/
folder- Alternatively: download PHP Markdown Extra (classic) from https://michelf.ca/projects/php-markdown/classic/ and put
markdown.php
in yourcookbook/
folder
- Alternatively: download PHP Markdown Extra (classic) from https://michelf.ca/projects/php-markdown/classic/ and put
Configuration
Several config options are available. Each of these must be set in config.php
, before including markdownpmw.php
.
$MarkdownMarkupUseClassicParser
(default:false
)- If set to
true
, the Classic version of the parser is used. (PHP Markdown Classic must be installed.) $MarkdownMarkupMarkdownExtraEnabled
(default:false
)- If set to
true
, Markdown Extra is enabled. $MarkdownMarkupParserOptions
(default: empty)- An array of parser configuration options.
MarkdownMarkupDirectiveArgumentsEnabled
(default:false
)- If set to
true
, parser options may be set via arguments to the(:markdown:)
directive (as well as theextra
andclassic
arguments, which override the values of$MarkdownMarkupUseClassicParser
and$MarkdownMarkupMarkdownExtraEnabled
respectively).
Usage
The Markdown markup can be used by enclosing it in (:markdown:)
and (:markdownend:)
:
(:markdown:) Test ==== (:markdownend:)
If you want to use it on many pages without PmWiki markup maybe you want to put these into your GroupHeader/GroupFooter
.
Notes
See Also
Contributors
Comments
See discussion at MarkdownMarkupExtension-Talk
User notes -1: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.