Python port of Markdoc
Project description
markdoc-py
Python port of Markdoc, a Markdown-based authoring framework with custom tags and annotations.
Documentation: https://osks.github.io/markdoc-py/markdocpy.html
Status
This project is under active development. Core parsing, transforming, and HTML rendering are implemented, with fixture-based tests and JS parity fixtures.
Requirements
- Python 3.13+
- Node.js (only needed for JS parity fixture generation)
Install (dev)
make env
Quick start
import markdocpy as Markdoc
source = \"\"\"
# Hello
{% note title=\"A\" %}
Body
{% /note %}
\"\"\"
ast = Markdoc.parse(source)
content = Markdoc.transform(ast, {\"tags\": {\"note\": {\"render\": \"note\", \"attributes\": {\"title\": {}}}}})
html = Markdoc.renderers.html(content)
API
ast = Markdoc.parse(source)
content = Markdoc.transform(ast, config)
errors = Markdoc.validate(ast, config)
html = Markdoc.renderers.html(content)
Tests
make test
Lint / format
make lint
make lint-fix
make format
Docs
make docs
Fixtures
Python fixtures:
make fixtures
JS parity fixtures (requires Markdoc build):
cd markdoc
npm install
npm run build
cd pymarkdoc
make fixtures-js
Project layout
markdocpy/
ast/
parser/
renderer/
schema/
transform/
validator/
tests/
fixtures/
js/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 markdoc_py-0.1.0.dev1.tar.gz.
File metadata
- Download URL: markdoc_py-0.1.0.dev1.tar.gz
- Upload date:
- Size: 44.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff31a40922b80f7e4f1fd1e4bb485ca96b0ddbd2d5840641e5706f5a1100e12a
|
|
| MD5 |
48e9623ea0fa094dec7157845e75625b
|
|
| BLAKE2b-256 |
481af901043134a190ee301f1539893ab3730b050310e3cbb7ff7a085a726c83
|
Provenance
The following attestation bundles were made for markdoc_py-0.1.0.dev1.tar.gz:
Publisher:
publish.yml on osks/markdoc-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
markdoc_py-0.1.0.dev1.tar.gz -
Subject digest:
ff31a40922b80f7e4f1fd1e4bb485ca96b0ddbd2d5840641e5706f5a1100e12a - Sigstore transparency entry: 845445239
- Sigstore integration time:
-
Permalink:
osks/markdoc-py@63fe33f57580c2390d06b9cd50e5b8fc97243dab -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/osks
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@63fe33f57580c2390d06b9cd50e5b8fc97243dab -
Trigger Event:
release
-
Statement type:
File details
Details for the file markdoc_py-0.1.0.dev1-py3-none-any.whl.
File metadata
- Download URL: markdoc_py-0.1.0.dev1-py3-none-any.whl
- Upload date:
- Size: 23.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57a1e4f3f332a190e2b774def8076f1342583fb4ee2cd6d026b0e6bafa966bcc
|
|
| MD5 |
5f45c8bb298b404de68759b1ef9084c3
|
|
| BLAKE2b-256 |
765b4a57355a9ca1f461c8dab3415249af5e92574fa5801d5e6270c226454d5b
|
Provenance
The following attestation bundles were made for markdoc_py-0.1.0.dev1-py3-none-any.whl:
Publisher:
publish.yml on osks/markdoc-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
markdoc_py-0.1.0.dev1-py3-none-any.whl -
Subject digest:
57a1e4f3f332a190e2b774def8076f1342583fb4ee2cd6d026b0e6bafa966bcc - Sigstore transparency entry: 845445240
- Sigstore integration time:
-
Permalink:
osks/markdoc-py@63fe33f57580c2390d06b9cd50e5b8fc97243dab -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/osks
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@63fe33f57580c2390d06b9cd50e5b8fc97243dab -
Trigger Event:
release
-
Statement type: