Skip to main content

Summary

Formats text following the MediaWiki syntax.

Usage

To return HTML from Wiki:

from wikimarkup.parser import Parser

parser = Parser()
html = parser.parse(text[, show_toc=True])

To return HTML without certain “annoying” (TODO: define annoying) elements, such as headings:

from wikimarkup.parser import parselite

parselite(text)

Adding New Tags

You can add new tags with the registerTagHook method.:

from wikimarkup.parser import Parser
import cgi

def blockquoteTagHook(parser_env, body, attributes={}):
    """<quote[ cite="Person"]>A paragraph of text.</quote>"""
    text = ['<blockquote>']
    if 'cite' in attributes:
        text.append('<cite>%s</cite>' % (cgi.escape(attributes['cite']),))
    text.append(parse(body.strip()))
    text.append('</blockquote>')
    return u'\n'.join(text)

parser = Parser()
parser.registerTagHook('quote', blockquoteTagHook)

Metadata

Release files for py-wikimarkup 2.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-wikimarkup 2.3.0
File Size Uploaded Provenance
py-wikimarkup-2.3.0.tar.gz 34.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for py-wikimarkup 2.3.0
File Interpreter ABI Platform
py_wikimarkup-2.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 69.0 kB

Release files / py-wikimarkup-2.3.0.tar.gz

Download URL py-wikimarkup-2.3.0.tar.gz
Size 34.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7081ab990afb95bf9d55b762a3db6f779838844a8de0bf8d2589443a6e378e1c
BLAKE2b-256 checksum
How to use checksums
314a6ea908153b339aafcf4dd25a3a391c0d23efb39f2d21748725f8f2708e44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release files / py_wikimarkup-2.3.0-py3-none-any.whl

Download URL py_wikimarkup-2.3.0-py3-none-any.whl
Size 34.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
90060fbdfda0e2c611d04fe963be4a9e894f12cb28a21d2d515fe504925fc55b
BLAKE2b-256 checksum
How to use checksums
06cdc56a20509043b194aab20ac0e1f23bbfcfc284f105c779640c6f9b8f6dd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Security for py-wikimarkup 2.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page