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
typstwithtypst-previewin the first line. - Compiles the Typst code into SVG format using the
typstcompiler.
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
markdowntypst
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31cde4e7ae731e40f812669358f2215b44a42c5736319c0173c6afe7c047d9bf
|
|
| MD5 |
033471909aabff6fe5282c8a6e024892
|
|
| BLAKE2b-256 |
1ff4e4f11814f96e7d2cebad5c4fa9bfe75187ad7d25ee97dd33b3e967ed2efe
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7cf455cbbf7e7f097a55b695197484efb2e26935a273676610e1f079ea172667
|
|
| MD5 |
d8ed7679446afc14a0cb33e3126bc354
|
|
| BLAKE2b-256 |
da31b15168c620659be74971510fb8198911b707bf87c74018e475018c6cf446
|