Markdoc is a documentation content framework that extends standard Markdown with custom tags, typed schemas, and reusable components, parsing content into an abstract syntax tree and rendering it as React elements or HTML. It provides a structured authoring system where documents are processed through an AST-based pipeline, enabling validation, transformation, and flexible output generation.
The framework distinguishes itself through a schema-driven validation pipeline that checks document structure and attribute values against defined rules, and a pluggable renderer architecture that accepts renderable trees for any output format. It supports conditional content evaluation with boolean expressions and switch/case logic, function injection for runtime data transformation, and partial template inclusion for content reuse across documents. Custom tag schemas allow definition of reusable elements with typed attributes and custom transform logic, while annotation-based attribute binding enables per-element customization without inline syntax.
Markdoc includes capabilities for content manifests, page-level metadata, frontmatter access, table of contents generation, code syntax highlighting, and tabbed content sections. It provides programmatic transformation for static analysis and validation, runtime value injection, and integration with frameworks like Next.js for server-side rendering. The framework supports both block and inline custom components, rich tables, and shorthand class and ID syntax, with options for custom page layouts and heading IDs.