DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:commonmark

DokuWiki Commonmark Plugin

Compatible with DokuWiki

  • 2024-02-06 "Kaos" unknown
  • 2023-04-04 "Jack Jackrum" yes
  • 2022-07-31 "Igor" yes
  • 2020-07-29 "Hogfather" yes

plugin Add (almost complete) Commonmark compatibility on DokuWiki

Last updated on
2023-09-16
Provides
Action
Repository
Source
Conflicts with
mdpage

Similar to markdowku, markdownextra, mdpage

Tagged with markdown

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.3.1 (2023-09-16 20:04)
    update Commonmark library version to 2.4.1 fix list rendering issue with strikethrough text (#22) fix spurious spaces around inline elements (#25) fix HTML code rendering (#26)
  • Version 1.3.0 (2023-05-28 22:57)
    update commonmark library version to 2.4 (#17) add frontmatter-based tag syntax(#18) add support for slash link ([wikilink](wiki/link)) for better markdown compatibility (ac4825f) fix empty lang file issue (#21)
  • 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).

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 and dokuwiki behave in a similar fashion respectively.
      • e.g.
        ```dokuwiki
        **this text** will be rendered as //dokuwiki// **not** //markdown//.
        ```
plugin/commonmark.txt · Last modified: 2023-09-16 20:02 by 110.14.71.6

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki