MCPcopy Index your code
hub / github.com/doclang-project/doclang

github.com/doclang-project/doclang @v0.7.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.7.2 ↗ · + Follow
161 symbols 576 edges 24 files 79 documented · 49%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

DocLang

DocLang

PyPI version Python uv Ruff Checked with mypy pre-commit License Apache 2.0

DocLang is the AI-native markup format for unstructured content — including documents, images, and more. It maps cleanly to LLM tokens while preserving structure, semantics, layout, and geometry in a single, unambiguous representation.

This repository is the home of the normative specification and the reference toolkit for DocLang. If you build with LLMs and VLMs on real-world content, this is where the standard lives.

Specification

The source of the specification is available in spec.md and exports to different formats can be found in the exports/ directory.

Reference Toolkit

The commands below illustrate basic scenarios. For advanced installation and usage options (minimal install, platform notes, custom Schematron backends, Python API), see the toolkit README.

Installation

pip install "doclang[schematron-saxon]"

Validation

doclang validate -n my_document.dclg

Packaging

doclang pack my_document.dclg

Citation

If you use DocLang in academic or technical work, please cite the specification:

@misc{doclang_2026,
  title        = {DocLang: Universal AI Document Format},
  author       = {{DocLang Project}},
  year         = {2026},
  version      = {main},
  howpublished = {\url{https://github.com/doclang-project/doclang}},
}

Development

To work on this repository — setup, tests, reference generation, releases — see CONTRIBUTING.md.

We ❤️ Open Source AI

DocLang is developed in the open and supported by the LF AI & Data Foundation. Learn more about the project at doclang-project.

License

DocLang is licensed under the Apache License 2.0. See LICENSE for details.

Core symbols most depended-on inside this repo

finalize_paragraph_buf
called by 11
utils/export_docx.py
pack
called by 10
doclang/cli.py
linkify_element_references
called by 8
utils/generate_reference.py
_strip_html_comments_outside_code
called by 8
utils/export_docx.py
validate
called by 7
doclang/cli.py
_add_inline_formatted_runs
called by 6
utils/export_docx.py
_add_bold_and_text_runs
called by 4
utils/export_docx.py
add_hyperlink
called by 4
utils/export_docx.py

Shape

Function 145
Class 10
Method 6

Languages

Python100%

Modules by API surface

utils/export_docx.py35 symbols
utils/validate_markdown_snippets.py14 symbols
utils/generate_reference.py13 symbols
tests/test_validation.py12 symbols
doclang/_packaging.py12 symbols
tests/test_packaging.py11 symbols
utils/sync_version.py8 symbols
tests/test_export.py7 symbols
doclang/version.py7 symbols
doclang/schematron.py7 symbols
utils/prepare_release.py6 symbols
doclang/cli.py6 symbols

For agents

$ claude mcp add doclang \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact