What is TemplateDX?
TemplateDX is a declarative, extensible, and composable templating engine built on Markdown and JSX. It was originally developed by AgentMark to improve the developer experience of building with large language models (LLMs). TemplateDX looks a lot like MDX, but the runtime is purpose-built for prompts — it adds its own tag plugins (<If>, <ElseIf>, <Else>, <ForEach>, <Raw>), a filter registry for expression evaluation, and a bundler that inlines imported components at bundle time. MDX is a document format that compiles to JSX; TemplateDX is a prompt-rendering engine that shares the surface syntax.
Why extend Markdown?
TemplateDX extends Markdown’s familiar syntax to support complex, structured content. Markdown works well for basic content but lacks the flexibility needed for templating, composable components, and organized content. TemplateDX adds custom components and templating primitives, enabling document composability, conditional rendering, and variable interpolation while preserving Markdown’s readability.What does it look like?
A TemplateDX file is a.mdx document that combines Markdown, frontmatter, imports, JSX components, and tags:
<If> tag, {props.isAwesome} expression, component imports, and frontmatter are all evaluated by TemplateDX at transform() time — see Syntax for the full list of primitives.