Skip to content

Latest commit

 

History

History

README.md

MDS Examples

Runnable examples demonstrating the MDS language and its integrations. Compile any .mds file with the CLI:

mds build examples/ai-agent/system-prompt.mds -o -

Templates

Directory What it shows
ai-agent/ System prompts, multi-turn conversations, and tool instructions for LLM agents
api-docs/ Generating API documentation from endpoint and response-schema templates
blog-generator/ A blog post template driven by frontmatter variables
prompt-library/ A reusable prompt library using @export/@import (personas, formatting, guardrails)
edge-cases/ Numbered walkthrough of language features — loops, conditionals, imports, escaping, re-exports, runtime vars, built-in functions, default args, logical operators, expression directives, frontmatter imports
stress-test/ A large, deeply-composed template tree exercising the resolver and evaluator

Some examples take runtime variables — pass the accompanying vars.json:

mds build examples/edge-cases/08_runtime_vars.mds --vars examples/edge-cases/vars.json -o -

Node.js API

node-api-test.mjs demonstrates compiling templates from JavaScript via @mdscript/mds.

Bundler integrations

Each app imports .mds files directly through the bundler plugin and resolves the MDS packages from this monorepo (file: dependencies):

App Plugin
vite-app/ @mdscript/vite-plugin
rollup-app/ @mdscript/rollup-plugin
webpack-app/ @mdscript/webpack-loader

To run one (after building the workspace packages from the repo root with npm install && npm run build --workspaces):

cd examples/vite-app
npm install
npm run build