Skip to main content

A Markdown extension to compile typst code blocks to SVG.

Project description

markdown-typst

A Python Markdown extension that compiles typst fenced code blocks into inline SVG images.

Features

  • Detects fenced code blocks labeled as typst with typst-preview in the first line.
  • Compiles the Typst code into SVG format using the typst compiler.

Installation

pip install markdown-typst

Usage

import markdown
import markdown_typst

md = markdown.Markdown(extensions=["markdown_typst.typst_extension"])
input_text = '''
```typst
// typst-preview
# Your Typst code here
```

'''

html = md.convert(input_text)
print(html)

Requirements

  • markdown
  • typst

License

MIT License

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

markdown_typst-0.1.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

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

markdown_typst-0.1.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file markdown_typst-0.1.0.tar.gz.

File metadata

  • Download URL: markdown_typst-0.1.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for markdown_typst-0.1.0.tar.gz
Algorithm Hash digest
SHA256 31cde4e7ae731e40f812669358f2215b44a42c5736319c0173c6afe7c047d9bf
MD5 033471909aabff6fe5282c8a6e024892
BLAKE2b-256 1ff4e4f11814f96e7d2cebad5c4fa9bfe75187ad7d25ee97dd33b3e967ed2efe

See more details on using hashes here.

File details

Details for the file markdown_typst-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: markdown_typst-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for markdown_typst-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7cf455cbbf7e7f097a55b695197484efb2e26935a273676610e1f079ea172667
MD5 d8ed7679446afc14a0cb33e3126bc354
BLAKE2b-256 da31b15168c620659be74971510fb8198911b707bf87c74018e475018c6cf446

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