Linked Markdown reference implementation for Python
Project description
Linked Markdown Python
Python implementation of Linked Markdown, packaged for PyPI.
Status: All 26 conformance tests passing.
API
from linked_markdown.extract import extract
from linked_markdown.errors import (
LinkedMarkdownError,
LMD_NO_FRONTMATTER,
LMD_INVALID_FRONTMATTER,
)
result = extract(markdown)
# => ExtractResult(front_matter="...", body="...", attrs={...})
extract(content: str) -> ExtractResult[dict]
Parses frontmatter from a Linked Markdown document. Supports YAML (---, ---yaml, = yaml =), JSON (---, ---json, = json =), and TOML (---toml, +++, = toml =) formats.
- Strips UTF-8 BOM and normalizes CRLF to LF before parsing.
- Returns
front_matterwith a trailing newline for non-empty frontmatter. front_matteris""for empty frontmatter (---\n---).bodyhas leading newlines stripped.
LinkedMarkdownError
Thrown for all error conditions. Has a .code property:
| Code | When |
|---|---|
LMD_NO_FRONTMATTER |
No frontmatter delimiters found |
LMD_INVALID_FRONTMATTER |
Unknown marker, unparseable content, non-object attrs, or no closing delimiter |
try:
extract(markdown)
except LinkedMarkdownError as e:
if e.code == LMD_NO_FRONTMATTER:
...
Development
git submodule update --init --recursive
uv sync
uv run pytest
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 linked_markdown-0.1.0.tar.gz.
File metadata
- Download URL: linked_markdown-0.1.0.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53d866230794c0be468fb287fcad9f606c01fd6f881249f80f8da14aeff56f97
|
|
| MD5 |
e2fd71eeda3440fbf8ae2ef39bd932bd
|
|
| BLAKE2b-256 |
18f0551b8c0642d17ba9921442d47161d4936a1614cc6be8372241e717404089
|
Provenance
The following attestation bundles were made for linked_markdown-0.1.0.tar.gz:
Publisher:
release.yml on wazootech/linked-markdown-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
linked_markdown-0.1.0.tar.gz -
Subject digest:
53d866230794c0be468fb287fcad9f606c01fd6f881249f80f8da14aeff56f97 - Sigstore transparency entry: 2083495210
- Sigstore integration time:
-
Permalink:
wazootech/linked-markdown-py@671ae0853edcf9d97cf3fd929a5d7a4f1449453e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/wazootech
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@671ae0853edcf9d97cf3fd929a5d7a4f1449453e -
Trigger Event:
push
-
Statement type:
File details
Details for the file linked_markdown-0.1.0-py3-none-any.whl.
File metadata
- Download URL: linked_markdown-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0c7464038ffa61b92dbbf4e1e27bced18c39cd68e05611ed6dfa57b9cbebeb8
|
|
| MD5 |
cbba56c9ecc062237f7999730c529c72
|
|
| BLAKE2b-256 |
7a72d98295f3b056916aa0b7e4cae474e3945835fa6cc87c164fffcbf24f5f9c
|
Provenance
The following attestation bundles were made for linked_markdown-0.1.0-py3-none-any.whl:
Publisher:
release.yml on wazootech/linked-markdown-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
linked_markdown-0.1.0-py3-none-any.whl -
Subject digest:
b0c7464038ffa61b92dbbf4e1e27bced18c39cd68e05611ed6dfa57b9cbebeb8 - Sigstore transparency entry: 2083495225
- Sigstore integration time:
-
Permalink:
wazootech/linked-markdown-py@671ae0853edcf9d97cf3fd929a5d7a4f1449453e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/wazootech
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@671ae0853edcf9d97cf3fd929a5d7a4f1449453e -
Trigger Event:
push
-
Statement type: