Skip to main content

mdx_variables

Travis CI build status

A Markdown extension to add support for variables.

Licensed under the ISC License.

Requirements

The mdx_variables plugin requires only the base markdown library.

Installation

Install with pip install mdx_variables.

Documentation

Allows inserting variables into Markdown.

The following Markdown example:

This paragraph contains ${chickens} chickens.

This paragraph contains no chickens but ${foxes} foxes.

Are there ninjas here? ${ninjas}.

Might result in:

This paragraph contains 5 chickens.

This paragraph contains no chickens but 3 foxes.

Are there ninjas here? ninjas not found.

Python usage:

md = markdown.Markdown(
    extensions=[
        'variables',
    ],
    extension_configs={
        'variables': {
            'vars': {
              'chickens': '5',
              'foxes': (lambda: 3),
              '__getattr__': (lambda name: "{} not found".format(name)),
            },
        }
    })

Configuration options:

  • vars: A dictionary mapping variable names to variable values.

    If a value is a function, that function will be called without arguments and the result will be used as the variable value.

    The special variable __getattr__ may specify a function f(name) -> value to call when no matching variable is found.

Metadata

Release files for mdx-variables 0.2

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

Source distribution (sdist)

Source distribution for mdx-variables 0.2
File Size Uploaded Provenance Actions
mdx-variables-0.2.tar.gz 4.7 kB Without provenance Details for mdx-variables-0.2.tar.gz

Release files / mdx-variables-0.2.tar.gz

Download URL mdx-variables-0.2.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2cc60b3f4a25a37994e253f57f10d1323e32a28f3eebe0ae06da2c10d8f6c56c
BLAKE2b-256 checksum
How to use checksums
bcd8e87dfdd2b83694886566bf584d8859f87e4c8b108cf6d922979713ea55cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.15rc1

Security for mdx-variables 0.2

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