Summary: Presents a wiki page in Markdown format instead of HTML
Prerequisites: PmWiki 2.2.0-beta series, untested on 2.1.27 and earlier
Questions answered by this recipe
- How can I generate "pretty" plain text from a wiki page?
MarkdownOutput uses Milian Wolff's Markdownify HTML to Markdown converter to convert a page's HTML to the Markdown syntax.
As an example, take a look at what this page (
Cookbook.MarkdownOutput) looks likeΔ in Markdown.
To install this recipe:
- download markdown-output.zipΔ and extract it to your cookbook directory
- you should end up with a folder named 'markdown-output'
- add the following line to your config file:
- To test, use the provided action "
markdown" to view a page of your wiki (by adding
?action=markdown to the end of the page's url)
The following variables may be set in your config file to configure the way MarkdownOutput works. The values shown are the defaults and the descriptions are mostly taken from Milian Wolff's page.
- Support for PHP Markdown Extra output, which implements some features currently not available with the plain Markdown syntax (tables, definition lists, etc.).
- A boolean which decides whether link definitions shall be displayed after each block element.
- An integer or
FALSE and sets the width to which the outputted Markdown text shall be wordwrapped. This feature is not yet finished!
- A boolean which tells Markdownify whether to keep non-markdownable HTML tags or to discard them.
?action=markdown to the end of the url of the page you wish to see in Markdown format.
MarkdownOutput first parses the page's wikimarkup into HTML, then passes it to Markdownify to convert to Markdown. All of the page permissions,
(:if:) statements and everything else is processed as normal. Only the actual page contents are included in the output.
If you have any comments or criticisms about how the output is formatted, you should direct those to Markdownify's author -- MarkdownOutput is really just a shell.
- 2008-02-15-2 - change handling of page title to now actually check
$TmplDisplay['PageTitleFmt'] instead of looking for
(:notitle:) in page markup
- 2008-02-15 - now includes PHP Markdown extra syntax additions by default
- 2008-02-14 - first release
See discussion at MarkdownOutput-Talk
User notes? : 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.