Skip to main content

Wiki text convertions based on MediaWiki

Project description

mwconv

Wiki text conversions based on MediaWiki

This program parses a dialect of MediaWiki syntax and converts it to various formats (html, plain text and markdown).

This is intended for documentation written using the MediaWiki syntax instead of the Markdown syntax as is more popularly used these days; there are no wiki features such as internal links implemented.

Tables and definition lists are supported.

The markdown and text versions of this file are converted using this utility.

Options

Summary

Options:
 -h, --help show this help message and exit
 -o FILE write to this file (default stdout)
 -t TYPE, --type=TYPE select output type
 -l NUMBER, --first-level=NUMBER

The output TYPE can be one of:

text
plain text output
html
- html output
md
markdown output
md_safe
markdown output with html restricted to a 'safe' subset.
mw
mediawiki output, the output will be a normalized form of the input. It will also be affected by the _first-level_ option if given.

The first-level option sets the first heading level in the output. So if it is set to 1, the the first heading will be H1 in html regardless of what level it is in the input and all the other headings adjusted appropriately.

Compatibility

The syntax is intended to be almost identical to MediaWiki text. Lots of people try (or used to try, markdown is commonly used now) to use MediaWiki for documentation since it is/was well known.

However if your documentation contains lots of lists and code sections the syntax is not altogether convenient.

  1. A list item has to be all on one line.
  2. There can not be any blank lines between list items.
  3. A code example can't (easily) be part of a list item.

So typically you use unordered lists and it all kind of looks ok in the browser, even though the code examples are not really in the list and break the list up into multiple lists.

This implementation has the following improvements.

  1. A list item can be split onto more than one line.
  2. If an indented block follows the list item, then it will be actually inside the list item.
  3. There are some alternative notations.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mwconv-1.6.2.tar.gz (24.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mwconv-1.6.2-py2.py3-none-any.whl (37.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file mwconv-1.6.2.tar.gz.

File metadata

  • Download URL: mwconv-1.6.2.tar.gz
  • Upload date:
  • Size: 24.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for mwconv-1.6.2.tar.gz
Algorithm Hash digest
SHA256 c235ad84d4bba549dc9cfcdecd73c796954697901b04446f0139794d28c71994
MD5 b7f1157d57f190fc1713d221df2ce850
BLAKE2b-256 1376c62ec24914a72cf3feb66cce3126602a0c586800f66bfcb00426ca4c735d

See more details on using hashes here.

File details

Details for the file mwconv-1.6.2-py2.py3-none-any.whl.

File metadata

  • Download URL: mwconv-1.6.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 37.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for mwconv-1.6.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 27ae27076dac70bceed280c7227703afe7c9748db9615fb2799d0b20c74c17e3
MD5 ba08649d784a7c99f252f97cd29ac598
BLAKE2b-256 1557b2136670cb402af249d9d0b9399995d4f724d7c2c78e64390fc326d7896a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page