This release is a pre-release and may not be stable for production use.
MarkCharm
Built for humans. Loved by AI. Working for all.
MarkCharm is a robust compiler that unites the pristine simplicity of Markdown with the deterministic typographic control of LaTeX. It is designed for generating technical and legal documents complying with strict formatting standards (e.g., ABNT NBR 6024).
🚦 What works and what doesn't?
🟢 Rock Solid (Ready for Testing):
- Native hierarchical paragraph numbering & ABNT compliance.
- Cross-references with auto-pluralization (
§§) and NLG. - Production-ready HTML generation.
🟡 Experimental (Expect turbulence):
- Data-binding (
{#DATA}) from external sources. - Sandboxed script execution (
{#EXEC}) and Excel spreadsheet integration. - Custom LaTeX-style Macros.
🔴 Not Available Yet:
- Exporting to Markdown, LaTeX, JSON AST, or PDF natively.
- Open access to the GitHub repository source code.
🚀 What's New in 0.88.3-beta.1-alpha
MarkCharm 2.0 introduces a paradigm shift in how structured documents are compiled, featuring our new decoupled 5-module StylePack Engine:
- Style-Agnostic Core: The core parser and backends are now 100% blind to specific styles. All logic (numbering, margins, CSS) is completely offloaded to external
.yamlStylePacks and.mcpreambles! - Data Binding (
{#DATA}): Seamlessly bind external data sources directly into the document AST, generating dynamic tables without writing a single line of script. - AI-First Authoring (
markcharm init-ai): Native capabilities built specifically for LLM code-assistants. Includes AI-visible comments ({@ prompt }) and token-efficient compiler diagnostics via--error-format llm. - New Built-in StylePacks: Native support for
\style{pindorama}(Brazilian Government SoRs),\style{abnt_legal}, and\style{technical}out of the box.
🌟 Why MarkCharm? (Key Features)
1. 📐 Compliance & Automatic Numbering
- Native Standards Support: Simply add
\style{brazilian}or\style{pindorama}. The compiler will automatically enforce correct numbering logic for all chapters, sections, and floating elements (Figures, Tables, Quadros). - Paragraph Numbering (
\paragraph_numbering): Essential for legal drafting. Automatically numbers paragraphs hierarchically (e.g.,1.1,1.1.1) based on their parent section. It handles legal ordinal rendering for first paragraphs (e.g.,§ 1º).
2. 🔗 Intelligent Cross-References (NLG)
Say goodbye to broken links and manual singular/plural tracking.
- Auto-Pluralization: Referencing multiple anchors (e.g.,
\cref{fig1, fig2}) automatically generates localized natural language lists: "figuras 1 e 2". - Natural Language Generation (
\nlg{on|off}): Dynamically inflects prepositions and gender agreements based on the target element. - Context-Aware Pruning: Reduces reference noise. If referencing
Figure 3.1from withinSection 3, it can smartly emit just"Figure 1"if unambiguous.
3. 🛠️ LaTeX-style Macros & Spreadsheets
- Custom Macros (
\newcommand): Define reusable text expansion patterns with positional arguments (#{1}) and named parameters. - Spreadsheet Integrations (
\spreadsheet): Native capability to render regions of.xlsxor.odsfiles dynamically inside your document by A1 coordinates (region="A1:E4") or Named Range Aliases. - Bibliography & Citations (
\bibliography): Parse.bibdatabases, generate inline citations, and produce localized reference sections.
4. ⚡ Dynamic Sandboxed Scripting ({#EXEC})
Embed Python, Bash, or Node scripts directly inside your document fenced blocks using {#EXEC}. MarkCharm will execute them safely and inject their output back into the AST. Execution is strictly bounded by CPU timeouts and memory output limits to ensure security (or entirely blocked via --safe).
🎯 Positioning & Strategic Niches
Landscape: Markdown vs. Typst vs. LaTeX vs. MarkCharm
| Dimension | Common Markdown | Typst | LaTeX | MarkCharm (.mc) |
|---|---|---|---|---|
| Core Paradigm | Inline web markup | Programmatic typesetting language | Macro expansion typesetting | Deterministic structured document compiler |
| Primary Target | Web HTML | Print PDF (HTML export experimental) | DVI / Print PDF | Self-contained HTML5, Native PDF & DOCX |
| Styling Model | Manual CSS | Functional scripting (#set, #show) |
Macro packages (.sty, .cls) |
Strict Style Agnosticism (YAML StylePacks) |
| Standards Compliance | Inexistent | Ad-hoc community packages | Complex legacy packages (abntex2) |
First-class native governance (ABNT, IBGE, SISP) with linters |
| Formal Structural Blocks | Code fences only | Custom script functions | Environments (table, figure) |
Native constructs (table, quadro, figure, spreadsheet) |
| Reactive Data Binding | Not supported | Script loops (#json(), #csv()) |
Fragile (datatool) |
Native declarative ({$DATA}, \spreadsheet, \cell) |
| AI-Agent Integration | Loss of structure | Indirect (clean syntax, no protocol) | Extremely hostile | Native protocol (--error-format llm, {@ @} vs {@! @!}) |
| Document-as-Code CI/CD | Scripts/Extensions | Not supported natively | Needs third-party tools | Natively built-in (Assertions, Traceability, Schema) |
| Compiler Diagnostics | Silent / permissive | Modern Rust-style diagnostics | Cryptic / fragile | Rust/LLVM-standard with indexed codes (markcharm explain MCE-*) |
Four Core Strategic Niches
-
🏛️ Public Sector & Government Procurement (GovTech / B2G):
- Automated authoring of complex Statements of Requirements (SoR) (Termos de Referência under Brazilian Bidding Law 14.133/2021), bidding notices, and regulatory reports.
- Dynamic hierarchical paragraph numbering and atomic clause cross-references (
\dlref,\llref,\sref) that never break when clauses are reordered. - Built-in compliance with federal standards (SISP, IMR tables, and IBGE open-sided statistical tables).
-
⚖️ Corporate Legal & Compliance (LegalTech):
- High-stakes contracts (M&A, shareholder agreements, compliance audits, ISO 27001).
- Strict compile-time validation: referenced clauses that are moved or removed trigger compiler errors (
MCE-REF-*), preventing multimillion-dollar legal disputes caused by broken contract cross-references. - Cryptographically auditable document baselines (deterministic AST hashing).
-
📊 Living Technical Documentation & Engineering:
- Engineering manuals, inspection logs, and executive reports driven by live data.
- Reactive data binding (
{$DATA data.xlsx region=B2:G15}) and automatic natural-language numbers (\numext{}) ensuring that when source spreadsheets update, documents rebuild without manual copy-paste errors.
-
🤖 AI-Agent Autonomous Document Engineering:
- Built from the ground up for collaborative human-AI document creation.
- The LLM compiler loop: agents generate
.mcand validate withmarkcharm check-dir . --error-format llm. Errors provide precise, token-efficient diagnostics, enabling autonomous self-healing. - Privacy namespaces:
{@ ... @}comments guide AI authoring tools, while confidential secrets inside{@! ... @!}are strictly purged before inference.
-
🛡️ Document-as-Code & CI/CD Pipelines:
- Treats official documents as software artifacts that can break builds if structural rules aren't met.
- Native enterprise ontology traceability (
markcharm trace) against SSOT JSONs andtopology.yamlhierarchical rules (e.g., mitigating Risks, mapping Features to Architecture Components). - Validation against ghost requirements, orphan relationships, and structural regressions.
- Structural schema validation (
markcharm validate --schema) and CI/CD data mocking (--mock-data). - Blocks invalid layouts via preamble directives (
{#ASSERT expr="section_count > 2"}).
Read the full technical whitepaper in
docs/architecture/POSITIONING_AND_COMPETITIVE_ANALYSIS.md.
🚀 Quick Start
MarkCharm requires Python 3.10+.
Installation
We strongly recommend installing MarkCharm globally using pipx (to avoid Python environment conflicts) or in an isolated virtual environment using pip.
# Recommended: Install globally using pipx
pipx install markcharm
# Note: If this is your first time using pipx, you might need to run:
# pipx ensurepath
# and restart your terminal. If pipx warns about existing symlinks, run:
# pipx install markcharm --force
# Or using pip in a virtual environment
pip install markcharm
Note: The official GitHub repository is currently private during the Beta phase. Installation is strictly via PyPI packages.
For developers and contributors, you can also install extra dependencies for native MathML generation (pipx install markcharm[math]) or Jupyter rich outputs (pipx install markcharm[jupyter]).
Your First Document
-
Create a
document.mcfile:\language{en} \style{technical} \author{Jane Doe} \date{\today} \maketitle # Introduction [intro] Welcome to MarkCharm! As we will see in \Cref{data}. ## Telemetry [data] Data flows seamlessly. -
Compile via CLI:
# Compile to HTML markcharm document.mc -f html -o output.html # Or use Live Reloading while writing markcharm watch document.mc
-
Configure your AI Assistant:
# Generate prompt guidelines and workspace rules for Cursor, GitHub Copilot, or Gemini markcharm init-ai .
📚 Ecosystem & Documentation
MarkCharm ships with comprehensive documentation included in the package:
- USER_GUIDE.md: The comprehensive manual for writers. Details all commands, mathematical syntax, scripting configurations, and macro writing.
- SPEC.md: The normative language specification. It documents grammatical structures, error codes (MCE/MCW), and the rigorous rules engine expected by the parser.
- DEVELOPER_GUIDE.md: The technical blueprint outlining the 5-module compilation pipeline, AST nodes, and how to write new language plugins.
- man pages: Standard Linux man page available via
man markcharm.
Access all bundled documentation at any time by running:
markcharm docs
🎨 Official Demos
MarkCharm ships with 70+ built-in demo documents showcasing every major feature. You can explore them directly from your installation:
markcharm docs
Popular showcases include:
- Cross References: Advanced NLG and auto-pluralization examples.
- Spreadsheets: Dynamic Excel / ODS rendering inside documents.
- Script Automation: Python AST mutation using
{#EXEC}sandboxed blocks. - Custom Styles: Creating complex custom styles entirely in
.mcpreambles without writing Python.
🤝 Contributing
MarkCharm is an evolving ecosystem. Currently in v0.87.5.1-alpha, we are rapidly approaching the stable 1.0.0 core.
If you are a parser enthusiast, a LaTeX veteran, or just love structured documents, we welcome contributions!
Note: The source code repository is currently private during the Beta phase. If you are interested in contributing, please reach out via the PyPI project page. Source access will be opened progressively as we approach the
1.0.0stable release.
📄 License & Versioning
- Core Compiler License: The MarkCharm software engine is an open-source project released under the Apache License 2.0. You are free to use, modify, and distribute the compiler in both academic and commercial applications without restriction.
- Language Specification License: The MarkCharm Official Language Grammatical Standard (SPEC.md) is strictly protected under the Creative Commons Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0). You may copy and redistribute the document freely, but you may not distribute modified or derived dialects of the specification text.
AI Assistance Disclaimer
This software was developed with the assistance of Artificial Intelligence tools (OpenAI ChatGPT, Anthropic Claude, and Google Gemini) across all phases of development, including architecture design, code generation, testing, and documentation.
Metadata
Release files for markcharm 0.88.3b0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| markcharm-0.88.3b0.tar.gz | 103.4 MB | Without provenance | Details for markcharm-0.88.3b0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| markcharm-0.88.3b0-py3-none-any.whl | Python 3 | none | any | Details for markcharm-0.88.3b0-py3-none-any.whl |
Total release size: 207.1 MB
Release files / markcharm-0.88.3b0.tar.gz
| Download URL | markcharm-0.88.3b0.tar.gz |
|---|---|
| Size | 103.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5bdca0a4ef803a58916c4d63386af1580ec2eb0c6f32ec943afd5ac0f281de9e
|
|
BLAKE2b-256 checksum How to use checksums |
b6c4a75b0e6b4696484918d5a654184a6a56718020f5a9757ced7300f1180140
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / markcharm-0.88.3b0-py3-none-any.whl
| Download URL | markcharm-0.88.3b0-py3-none-any.whl |
|---|---|
| Size | 103.7 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bfce723d9f4635c9f6027224fff21aaae8e6d6978ef04b4349b854cfc30ccd36
|
|
BLAKE2b-256 checksum How to use checksums |
87869b0b94bf6d1681396edbc6fee6b67a9751ce3f1a4d4bcc64abb1414bcc23
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for markcharm 0.88.3b0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.