Skip to main content

Markdown KaTeX extension backed by Rust

Project description

markdown-katex-rs

A fast, Rust-backed KaTeX extension for the Python Markdown library.

This project aspires to be a drop-in replacement for mbarkhau/markdown-katex. The main difference is, instead of shipping node and katex binaries, it's using the katex-rs crate via PyO3 for significantly improved rendering performance and smaller distribution size.

Requirements

  • Python 3.10+

Installation

Once the package is published to PyPI, you can install it using uv (recommended) or pip:

uv add markdown-katex-rs

Usage

Use it just like any other Python Markdown extension. It supports both inline math ($ or $``) and block math (fenced math` code blocks).

import markdown
from markdown_katex_rs import KatexRsExtension

text = r"""
This is inline math: $`a^2 + b^2 = c^2`$

This is block math:
```math
\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}

"""

Render with the KatexRsExtension

md = markdown.Markdown(extensions=[KatexRsExtension()]) html = md.convert(text)

print(html)


## Local Development & Building

The project requires `uv` for Python dependency management and `cargo` / Rust for compiling the PyO3 extension.

```bash
# Clone the repository
git clone <your-repo-url>

# Setup your env and build the development wheel automatically
uv sync

# Run tests
uv run pytest -v

CI/CD and Publishing

This project is configured with GitHub Actions to:

  1. Automatically run the PyTest suite on every pull request or push to main.
  2. Build cross-platform binary wheels via maturin-action and push them to PyPI seamlessly whenever a new GitHub Release is created.

To trigger a release to PyPI:

  1. Update your version bumps in Cargo.toml and pyproject.toml.
  2. Create and publish a new Release in the GitHub UI (i.e., v0.1.0).
  3. The Action will automatically execute and handle the heavy lifting of publishing.

(Note: The wheel filename will vary depending on your OS, Python version, and system architecture.)

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

markdown_katex_rs-0.1.0-cp314-cp314-win_amd64.whl (869.1 kB view details)

Uploaded CPython 3.14Windows x86-64

markdown_katex_rs-0.1.0-cp314-cp314-manylinux_2_34_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

markdown_katex_rs-0.1.0-cp314-cp314-macosx_11_0_arm64.whl (998.6 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

markdown_katex_rs-0.1.0-cp313-cp313-win_amd64.whl (869.1 kB view details)

Uploaded CPython 3.13Windows x86-64

markdown_katex_rs-0.1.0-cp313-cp313-manylinux_2_34_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

markdown_katex_rs-0.1.0-cp313-cp313-macosx_11_0_arm64.whl (998.6 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

markdown_katex_rs-0.1.0-cp312-cp312-win_amd64.whl (869.3 kB view details)

Uploaded CPython 3.12Windows x86-64

markdown_katex_rs-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

markdown_katex_rs-0.1.0-cp312-cp312-macosx_11_0_arm64.whl (999.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

markdown_katex_rs-0.1.0-cp311-cp311-win_amd64.whl (870.8 kB view details)

Uploaded CPython 3.11Windows x86-64

markdown_katex_rs-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

markdown_katex_rs-0.1.0-cp311-cp311-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

markdown_katex_rs-0.1.0-cp310-cp310-win_amd64.whl (870.6 kB view details)

Uploaded CPython 3.10Windows x86-64

markdown_katex_rs-0.1.0-cp310-cp310-manylinux_2_34_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

markdown_katex_rs-0.1.0-cp310-cp310-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file markdown_katex_rs-0.1.0-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for markdown_katex_rs-0.1.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 a7ddf0681a48dae9c1d6cdd05d61fa13e419b025346d6c1b7c815d5838360db4
MD5 9269ac678ff5b470e4951ecb01701d32
BLAKE2b-256 10930181df759f86d1c58e9c9202e72e81248e4a6ae0c677444ce62249b5a473

See more details on using hashes here.

Provenance

The following attestation bundles were made for markdown_katex_rs-0.1.0-cp314-cp314-win_amd64.whl:

Publisher: ci.yml on InCogNiTo124/markdown-katex-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file markdown_katex_rs-0.1.0-cp314-cp314-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for markdown_katex_rs-0.1.0-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c59ca37ed8fd9d1d7538a8f76d36873ca9f3022014d92a488da6de958fdcae9f
MD5 df1a34524fd38c30c6eb3ae697d35ec7
BLAKE2b-256 6ba16db043738458ee0b69f45170d68727836b86533a3ae034616b882bd2ee79

See more details on using hashes here.

Provenance

The following attestation bundles were made for markdown_katex_rs-0.1.0-cp314-cp314-manylinux_2_34_x86_64.whl:

Publisher: ci.yml on InCogNiTo124/markdown-katex-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file markdown_katex_rs-0.1.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for markdown_katex_rs-0.1.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6d615422d42f78ed2a03006455cddfe7c61bf75abf45f840c654a96d5df69e76
MD5 1fd3d843f5f689b9636a38732e7c1b44
BLAKE2b-256 7669f357cfeffbcb32ffd3351506e713dd74dbc477fef994796abb832cf96cf1

See more details on using hashes here.

Provenance

The following attestation bundles were made for markdown_katex_rs-0.1.0-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: ci.yml on InCogNiTo124/markdown-katex-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file markdown_katex_rs-0.1.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for markdown_katex_rs-0.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6b6bfde15dd2e596d6418aded606f1b1e6431d48b0840a6fc6c93d782c930fe6
MD5 ce2a90ae54652c8c711957a0422ab692
BLAKE2b-256 14a5f34c7efe03a3d7beb0b10219cee040ad17879f8bcbc5d55d76b73d5ab995

See more details on using hashes here.

Provenance

The following attestation bundles were made for markdown_katex_rs-0.1.0-cp313-cp313-win_amd64.whl:

Publisher: ci.yml on InCogNiTo124/markdown-katex-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file markdown_katex_rs-0.1.0-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for markdown_katex_rs-0.1.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c84991ec59d2ccccbef125af8baf4d1414a4438e30342f3cd54845db0514e64a
MD5 cf37847157f277709b7a6dd45a60358a
BLAKE2b-256 82f35ed841d188777977614c7dd2da22f7d55f7afecba0765ff2d0943e0427c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for markdown_katex_rs-0.1.0-cp313-cp313-manylinux_2_34_x86_64.whl:

Publisher: ci.yml on InCogNiTo124/markdown-katex-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file markdown_katex_rs-0.1.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for markdown_katex_rs-0.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 95cfa837d666f0d6ee884cf8976d55e6e5ca7e17dbfe93ea5122287011293ff0
MD5 2767090de640c73ac1de5c058edc08c6
BLAKE2b-256 1ae3daa0d663dd07d1b045da67e98ec2c353a43bbe1d1dc6c62908860f845832

See more details on using hashes here.

Provenance

The following attestation bundles were made for markdown_katex_rs-0.1.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: ci.yml on InCogNiTo124/markdown-katex-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file markdown_katex_rs-0.1.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for markdown_katex_rs-0.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 603c795fe11df04a44aef78e92ade961f211ebb0d928982186a27b882acce9e4
MD5 7c1355b1d9cc03c465c8669be230148d
BLAKE2b-256 f6187a6888257cf3f3f2f70247ce20fa310e00aa8a0dfad1962e9054ba7b5952

See more details on using hashes here.

Provenance

The following attestation bundles were made for markdown_katex_rs-0.1.0-cp312-cp312-win_amd64.whl:

Publisher: ci.yml on InCogNiTo124/markdown-katex-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file markdown_katex_rs-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for markdown_katex_rs-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5f3dcdd9dda28a3bff8fd6d139e06ff12ad4ea7d01ab43dd0ddc591a7fb9971b
MD5 8efd15c69be5f77538126678f3366f15
BLAKE2b-256 3454eca87a69433a9f76f9219990481089b7945988bd2a1ef2e71fd4b20d7965

See more details on using hashes here.

Provenance

The following attestation bundles were made for markdown_katex_rs-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl:

Publisher: ci.yml on InCogNiTo124/markdown-katex-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file markdown_katex_rs-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for markdown_katex_rs-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 55359e730237cb8fd0b5638a9555c3841abb25bb04cf07d26b768a60ba5d47ac
MD5 524901c7a7e280f0b7d3471461caf69f
BLAKE2b-256 fe067d93f280278f3e95e9e5fefe5a34fbecd06f3203298d31f7e195331b81a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for markdown_katex_rs-0.1.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: ci.yml on InCogNiTo124/markdown-katex-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file markdown_katex_rs-0.1.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for markdown_katex_rs-0.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a3b388530a99344543c70c54ef7df07ac5807d69e22dce812f5226450060563e
MD5 e2b10ab328e56bd3856b74f05858c6a1
BLAKE2b-256 34b928c8652e24f8192a6edef734789223ad5299f7164b84877d55bff64c064d

See more details on using hashes here.

Provenance

The following attestation bundles were made for markdown_katex_rs-0.1.0-cp311-cp311-win_amd64.whl:

Publisher: ci.yml on InCogNiTo124/markdown-katex-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file markdown_katex_rs-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for markdown_katex_rs-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 b33b798500555f11ccbd7a1e54365e7b6247e2d56030ad099b237d933e5c339a
MD5 f35ef465c8b4b576366979a792762c64
BLAKE2b-256 e502ba62a911e63d498414ac01b6e17c0add15f3856c02d7d0169df802ac59c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for markdown_katex_rs-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl:

Publisher: ci.yml on InCogNiTo124/markdown-katex-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file markdown_katex_rs-0.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for markdown_katex_rs-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 65b16741530503f411ad9ea5f7e6abb0af6839916c8ad343a2a7c83eb0704a9e
MD5 2c2bf1fbab3f7ee61eaa06915184269e
BLAKE2b-256 3d598fbcc2b1cee9ca251a3cebefaea1654a98f5ba4ba64e103bd06ebce0fcd5

See more details on using hashes here.

Provenance

The following attestation bundles were made for markdown_katex_rs-0.1.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: ci.yml on InCogNiTo124/markdown-katex-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file markdown_katex_rs-0.1.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for markdown_katex_rs-0.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 00eedc63c6ceea4b51a12000e6c3eae3d8d9f718689d53876e620b407a21d77c
MD5 add803ed8999c30c74a180af3a49b72c
BLAKE2b-256 809306f558fbaf2cf1b35d25bed055f7d36c1872865eb69cb208508a67cccaa9

See more details on using hashes here.

Provenance

The following attestation bundles were made for markdown_katex_rs-0.1.0-cp310-cp310-win_amd64.whl:

Publisher: ci.yml on InCogNiTo124/markdown-katex-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file markdown_katex_rs-0.1.0-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for markdown_katex_rs-0.1.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 dab02cf421a8fdd6a85ab5caa56a44c3ae808736210cd1019e746a839798a6fa
MD5 cb2d4a8a55382d45cc74fc2dedfd128d
BLAKE2b-256 5c3144bd7a870aa6becde14bfc53f72058d8183caaf565c63883b7b2c3ad228e

See more details on using hashes here.

Provenance

The following attestation bundles were made for markdown_katex_rs-0.1.0-cp310-cp310-manylinux_2_34_x86_64.whl:

Publisher: ci.yml on InCogNiTo124/markdown-katex-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file markdown_katex_rs-0.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for markdown_katex_rs-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8e0631e11c6ed532fc08df53355875fadd0b5e919bc7f9ed063e5282d386e685
MD5 c7b6257f0f08e5fa3e2b2414b2960d36
BLAKE2b-256 18fbb4835adf8445464b67b2a267a6d56b53e34c61c51480d741ba7d0545d645

See more details on using hashes here.

Provenance

The following attestation bundles were made for markdown_katex_rs-0.1.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: ci.yml on InCogNiTo124/markdown-katex-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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