Extension:WikiMarkdown
WikiMarkdown Release status: stable |
|
---|---|
Implementation | Tag , ContentHandler |
Description | Allows for markdown syntax to be used on wiki pages |
Author(s) | Nathan Kuenzig (kuenzigntalk) |
Latest version | 1.0.0 |
Compatibility policy | Master maintains backward compatibility. |
MediaWiki | 1.35+ |
Database changes | No |
License | MIT License |
Download | GitHub: README on GitHub |
|
|
<markdown> |
|
The WikiMarkdown extension allows for markdown syntax to be used on wiki pages using the <markdown>
tag.
It is powered by the Parsedown library.
Usage
Once installed, you can use <markdown>
tags on wiki pages. For example,
EmphasisThis is bold text This is bold text This is italic text This is italic text
|
is the result of the following wikitext markup:
<markdown>
## Emphasis
**This is bold text**
__This is bold text__
*This is italic text*
_This is italic text_
~~Strikethrough~~
</markdown>
Markdown content handler
The extension adds a content handler for markdown pages, which can be edited using a markdown editor when CodeEditor is installed.
Markdown error category
The extension adds pages that encountered errors during markdown parsing to a tracking category.
Parameters
inline
The attribute indicates that the markdown should be inline as part of a paragraph (as opposed to being its own block).
Installation
- Download and move the extracted
WikiMarkdown
folder to yourextensions/
directory.
Developers and code contributors should install the extension from Git instead, using:cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiMarkdown - Only when installing from Git, run Composer to install PHP dependencies, by issuing
composer install --no-dev
in the extension directory. (See task T173141 for potential complications.) - Add the following code at the bottom of your LocalSettings.php file:
wfLoadExtension( 'WikiMarkdown' ); $wgAllowMarkdownExtra = true; // allows usage of Parsedown Extra
- Configure as required.
- Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Configuration
$wgAllowMarkdownExtra
- To enable Parsedown Extra support, set
$wgAllowMarkdownExtra = true;
(default is "false")
SyntaxHighlight integration
When SyntaxHighlight is installed, the extension will automatically apply its highlighting to markdown code blocks. The code blocks will render the same as the SyntaxHighlight code blocks and will support all the same languages.
VisualEditor integration
The extension enables direct editing with VisualEditor.
A popup is opened when a user wants to edit <markdown>
sections.
For this to work, VisualEditor must be installed and configured from the latest Git version, same for Parsoid.
See also
- Stable extensions
- Tag extensions
- ContentHandler extensions
- MIT licensed extensions
- Extensions in GitHub version control
- ParserFirstCallInit extensions
- ResourceLoaderRegisterModules extensions
- ContentHandlerDefaultModelFor extensions
- CodeEditorGetPageLanguage extensions
- All extensions
- Extensions requiring Composer with git
- Markdown extensions
- Extensions with VisualEditor support
- Extensions with SyntaxHighlight support