Table of Contents
DokuWiki Commonmark Plugin
Compatible with DokuWiki
- 2022-07-31 "Igor" yes
- 2020-07-29 "Hogfather" yes
- 2018-04-22 "Greebo" unknown
- 2017-02-19 "Frusterick Manners" unknown
Similar to markdowku, markdownextra, mdpage
Installation
Install the plugin using the Plugin Manager and the download URL above, which points to latest version of the plugin. Refer to Plugins on how to install plugins manually.
Examples/Usage
This is an another plugin that tries to implement Commonmark syntax to DokuWiki ecosystem. Unlike others, this plugin takes different approach for the goal:
- the plugin will find whether the Markdown doctype indicator (
<!DOCTYPE markdown>
) is included in document - if found, the document will be passed to Commonmark-to-DokuWiki renderer before main DW parser; all the markups compatible to markdown must be parsed
- after pre-render, the resultant DokuWiki document will be passed into DW parser; all the remaining process should be processed as usual
Syntax
This plugin can process all the basic Commonmark syntax, plus footnote / table / strikethrough markup.
Configuration and Settings
Currently, there is no adjustable settings here.
Development
Change Log
- version 1.2.1 (2022-10-08 09:32)fix hr rendering error after list (#16) fix indented code block rendering issues (thanks to francis@daoine.org)
- version 1.2.0 (2022-04-14 05:03)Add force_commonmark option (#10, #11)
- version 1.1.0 (2022-02-01 10:18)Add toolbar for Commonmark. Fix footnote (#7) and inline code rendering issues (#8).
- version 1.0.0 (2021-07-19 18:10)Add table syntax. First full-working extension.
- v0.3.0 (2021-07-12 14:35)fix credit & typo
Known Bugs and Issues
For bugs, discussions, and feature requests, please open new here.
ToDo/Wish List
- Add toolbar button for Markdown syntax
- Config for footnote style (e.g. refnotes)
FAQ
Why another Markdown plugin?
There is no DokuWiki extension that accepts Markdown syntax with complete compatibility. Also, the way DokuWiki parser works, i.e. token-based process, cannot fit the Markdown syntax (e.g. footnote and nested lists). This plugin is based on the assumption that every Commonmark document can be converted to DokuWiki markup without any issue, while its reversal is not guaranteed.
.md extension
There is no way for store DW documents with other extension rather than .txt, due to its core policy. You may modify the local code, it you want to.
About performance
Due to the concept that adding pre-render procedure for Commonmark-to-DW conversion, this plugin would have additional computational cost. However, I think DokuWiki and PHP Commonmark parser is sufficiently fast; it will add a little bit of additional process time.
Ambiguities
This plugin aims for complete compatibility of Markdown in DokuWiki. Most Markdown syntax have corresponding DW syntax, so it will work without problem; but in some cases, Markdown syntax do not matches DW specification one-by-one, or vice versa. Here is a list of known ambiguities between Commonmark and DokuWiki, and its implements in the plugin:
- Raw HTML blocks are ignored because DW does not parse raw HTML without the
htmlok
config. - If
html
is used for a code fence it will be converted to dokuwiki's <HTML> block and rendered as HTML.nowiki
anddokuwiki
behave in a similar fashion respectively.- e.g.
```dokuwiki **this text** will be rendered as //dokuwiki// **not** //markdown//. ```