Extension:PandocUltimateConverter
From Linux Web Expert
PandocUltimateConverter Release status: experimental |
|
---|---|
Implementation | Special page |
Description | Pandoc converter extension for mediawiki which imports not only text, but also images |
Author(s) | Urfiner (Nikolai Kochkin) |
Latest version | 0.1.0 |
MediaWiki | 1.39+ |
License | MIT License |
Download | GitHub:
<translate> Note:</translate> |
Quarterly downloads | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
Public wikis using | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
The PandocUltimateConverter is an extension for MediaWiki that converts document files (.docx, .odt) and other files to wikitext. It imports not only text but also images. It is highly inspired by Microsoft's PandocUpload extension but written from scratch to support 1.41 MediaWiki and include image import.
You can see demo here.
Installation
Installation is just a bit more complicated than usual:
- Install pandoc
- Download extension
- Load the extension in LocalSettings.php
wfLoadExtension( 'PandocUltimateConverter' );
- (Optional) Configure path to pandoc binary
$wgPandocExecutablePath = 'C:\Program Files\Pandoc\pandoc.exe';
. It will work without this param if pandoc is in PATH. - (Optional) Configure path to a temp folder where pandoc will store images before upload
$wgPandocTmpFolderPath = 'D:\_TMP';
. If not specified, it will try to use defualt system temp folder. - Allow additional file extensions to be uploaded to MediaWiki
$wgFileExtensions[] = 'docx'; $wgFileExtensions[] = 'odt'; // You can specify other required extensions as well
- Enable uploads if they are not enabled
$wgEnableUploads = true;
Usage
Follow these steps:
- Go to Special:PandocUltimateConverter page.
File:PandocUltimateConverter-Extension.png - Specify file to convert and target page name.
- After the file conversion is finished, you will be redirected to the target page
- Source file will be automatically removed from the wiki
- All the images will be automatically uploaded to MediaWiki with a name "Pandocultimateconverter-{guid}-{imageOriginalNameAndExtension}"
- If the image is already present on wiki, the image duplicate will not be uploaded. We will just use the existing image.
- All the images will be automatically removed from the temp folder
Target page and all the images will be overwriten if they already exist
Limitations
Consider the following limitations:
- The extension was tested on Windows and Linux.
- The extension was tested on MediaWiki 1.39, 1.40, 1.41.
- The list of supported formats can be found on the Pandoc website. For example, it supports docx and odt formats, but does not support pdf format.
See also
- Extension:FlexForm - convert using pandoc
Categories:
- Pages with script errors
- Pages with broken file links
- Experimental extensions
- Extensions without an image
- Special page extensions
- Extensions without a compatibility policy
- Extensions with manual MediaWiki version
- MIT licensed extensions
- Extensions in GitHub version control
- All extensions
- Bulk upload
- Page creation extensions