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.1.3 |
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
editOnce installed, you can use <markdown>
tags on wiki pages. For example,
EmphasiseditThis 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
editThe extension adds a content handler for markdown pages, which can be edited using a markdown editor when CodeEditor is installed.
Markdown error category
editThe extension adds pages that encountered errors during markdown parsing to a tracking category.
Parameters
editinline
editThe attribute indicates that the markdown should be inline as part of a paragraph (as opposed to being its own block).
Installation
editInstall Dependencies
editMake sure your OS has Composer 2.0+
. Installation guide
Add the line "extensions/WikiMarkdown/composer.json"
to the "composer.local.json" file in the root directory of your wiki, e.g.
{
"extra": {
"merge-plugin": {
"include": [
"extensions/WikiMarkdown/composer.json"
]
}
}
}
Then run composer update
in the root directory of your wiki. This will install any dependencies (i.e. the Parsedown, Parsedown Extra, and Parsedown Extended libraries).
Install the extension
edit- Download extension from github and unpack it into 'extensions' folder.
- Download the GitHub repo and place the file(s) in a directory called
WikiMarkdown
in yourextensions/
folder. - 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 $wgAllowMarkdownExtended = true; // allows usage of Parsedown Extended
- Configure as required.
- Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Configuration
edit$wgAllowMarkdownExtra
- To enable Parsedown Extra support, set
$wgAllowMarkdownExtra = true;
(default is "false")
$wgAllowMarkdownExtended
- To enable Parsedown Extended support, set
$wgAllowMarkdownExtended = true;
(default is "false")
$wgParsedownExtendedParameters
- Optionally change which parameters are used with Parsedown Extended. Look at the documentation for what options you can turn on or off. This defaults to:
[
'math' => [
'single_dollar' => true
],
'sup' => true,
'sub' => true
]
SyntaxHighlight integration
editWhen 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.
Math integration
editWhen Math is installed and Parsedown Extended with the math
option is available, the extension will automatically use the Math extension to render mathematical equations.
VisualEditor integration
editThe 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
edit- Parsedown — PHP markdown parser
- Parsedown Extra
- Parsedown Extended
- Markdown Extension
- Markdown Content Handler
This extension is included in the following wiki farms/hosts and/or packages: This is not an authoritative list. Some wiki farms/hosts and/or packages may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |