Obsah

MarkdownExtra Plugin

Compatible with DokuWiki

2012-10-13 "Adora Belle"

plugin Parses PHP Markdown Extra blocks

Last updated on
2016-02-02
Provides
Syntax
Repository
Source
Conflicts with
mdpage

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Similar to commonmark, markdowku, markdown, mdpage, rst

Tagged with formatting, markdown, markup_language

Download and Installation

Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.

This plugin is available on both GitHub and Bitbucket:

Usage

If the page name ends with .md suffix, it gets automatically parsed using PHP Markdown Extra. To use that markup in other pages, the content must be embedded in a markdown block. For example:

<markdown>
Header 1
========

~~~
some code
~~~

Paragraph

Header 2
--------

- A
- simple
- list

1. And
2. numbered
3. list

Quite intuitive? *emphasis*, **strong**, etc.
</markdown>

For syntax, refer to http://michelf.com/projects/php-markdown/extra/

Front matter

This feature was added in version 2013-01-02, it's turned off by default. You may turn it on in dokuwiki config page.

I love this markdown extra plugin, the best feature is .md suffix. And I love tag plugin too, but I can't use it with page with .md suffix as {{tag>tat1 tag2 tag3}} syntax will not work within <markdown></markdown>. So I added this front matter feature.

Front matter is a text block at the top of dokuwiki page with .md suffix. It begins and ends with '---'. Looks like this:

---
{{tag>test}}
---

Content between --- will be placed outside <markdown></markdown> so it will be accessible by tag plugin or any other plugin.

Discussion

Feature requests

Bugs

FAQ / Support

I uploaded a file with .md extension into the pages directory, but it is not listed in the wiki. What else do I have to do?
The file must have both .md and .txt extensions like something.md.txt. Dokuwiki needs the .txt to recognise the file as a page, while the plugin needs the .md to recognise the syntax. Filenames should also be lowercase and with no spaces. If you're using DokuWiki's web interface, just name your page something.md, but the file will actually be named something.md.txt.

How do I put links in .md pages to other sections of the wiki?
Like this: [this is a link](?id=anotherpage.md) or [this is a link](./anotherpage.md)

But what about the „normal“ link style [[anotherpage]]?
The „normal“ link style is not Markdown syntax, so you have to choose: use Markdown, or not.

How do I generate a table of contents on top of the page?
Should work now (2012-11-25), thanks to Jiang Le.

How do I embed an image from the wiki?

![alt text](lib/exe/fetch.php?media=namespace:image.png)
If you have enabled URL rewriting mode 1 (webserver), you can use _media/ as a shorthand for lib/exe/fetch.php?media=, so you only need to type ![alt text](_media/namespace/image.png)

If you want to link the image (e.g. to the DokuWiki details page), you have to wrap the entire image markup in a link:

[![alt text](lib/exe/fetch.php?media=namespace:image.png)](lib/exe/detail.php?media=namespace:image.png)
with URL rewriting mode 1, the shorter form is [![alt text](_media/namespace/image.png)](_detail/namespace/image.png)

Updating to latest PHP Markdown

The included version of PHP Markdown in this plugin is 1.2.8 from November 29, 2013. This is the latest version and supports a few new features like classes and IDs for headers, images, links and fenced code blocks; multiple references to the same footnote; as well as bugfixes.

If there are future releases, to update, just replace markdown.php in lib/plugins/markdownextra with the new version (though likely there will not be a new release). Make sure to use classic version PHP Markdown Extra x.x.x, not PHP Markdown Lib.