Markup is a document authoring language that replaces writing HTML by hand. Every construct follows the same {tag "content"} pattern. Variables, conditionals, iteration, and component definitions use the same syntax. A Markup document compiles to clean, semantic HTML.
{h1 "Getting Started with Markup"}
{p "Markup is a document authoring language. Every construct follows
the same {code "{tag content}"} pattern."}
{list
{item "{b "One syntax"} for everything"}
{item "{b "HTML-level power"} without HTML verbosity"}
{item "{b "Built-in logic"} for variables, loops, and conditionals"}
}
Write Documents, Not HTML.
- One syntax, one rule. Every construct follows
{tag "content"}. No mode switches, no special cases, no ambiguous parsing contexts. - Turing complete by design. Variables, conditionals, iteration, and reusable components are first-class constructs using the same tag syntax.
- Quoted strings. Content is delimited by
"...", so the parser knows exactly what to preserve. No whitespace ambiguity. - HTML output. Compiles to clean, semantic HTML. If HTML can express it, so can Markup.
- DLL API. Ship as a single
Markup.dllwith a flat C-style API. Integrate from Delphi, C, C++, or any language that can call a DLL. - Custom tags and functions. Register your own tag handlers and expression functions to extend the language at runtime.
- Data binding. Pass JSON data and access it from templates with
{=data.path}interpolation. - Configurable options. Pretty-print output, strict mode, HTML sanitization, unknown tag handling, and safety limits — all controllable per engine instance.
- File output. Render directly to
.htmlfiles with optional browser launch viamarkup_convert_to_file.
| Unit | Purpose |
|---|---|
Markup.pas |
Delphi import wrapper for Markup.dll. Opaque handles and flat function calls with no dependencies on Markup internals. |
Markup.h |
C/C++ single-header dynamic loader for Markup.dll. Define MARKUP_IMPLEMENTATION in one translation unit, then include normally everywhere else. |
Markup.API.pas |
DLL export layer. Bridges the flat C-style API to the internal engine. |
Markup.AST.pas |
Abstract syntax tree node types and arena allocator. |
Markup.Builtins.pas |
Built-in functions available in Markup expressions. |
Markup.Config.pas |
Engine configuration and feature flags. |
Markup.Context.pas |
Render context passed to custom tag handlers. |
Markup.Engine.pas |
Top-level engine coordinating lexer, parser, interpreter, and semantics. |
Markup.Environment.pas |
Variable environment and scope management. |
Markup.ExprParser.pas |
Expression parser for {=...} interpolation and function calls. |
Markup.Interpreter.pas |
AST interpreter that walks the tree and emits HTML. |
Markup.JSON.pas |
JSON parser for data binding. |
Markup.Lexer.pas |
Recursive lexer with quoted string support. |
Markup.Options.pas |
Render options and output configuration. |
Markup.Parser.pas |
Recursive descent parser producing the AST. |
Markup.Pipes.pas |
Pipe filter functions (e.g., upper, lower). |
Markup.Resources.pas |
Embedded resource management. |
Markup.Semantics.pas |
Semantic analysis: block/void tag classification, validation. |
Markup.TestCase.pas |
Test infrastructure for the testbed. |
Markup.TOML.pas |
TOML parser for configuration files. |
Markup.Utils.pas |
Shared utility routines and console helpers. |
Markup.Value.pas |
TMuValue record wrapping TValue for the expression evaluator. |
| Requirement | |
|---|---|
| Host OS | Windows 10/11 x64 |
| Building from source | Delphi 12.x or higher |
- Clone the repository
- Copy
Markup.dllandlib\pascal\Markup.pasinto your project - Add
Markupto your unit'susesclause
uses
Markup;Minimal example:
var
LEngine: TMuEngine;
LHtml: PAnsiChar;
begin
LEngine := markup_create();
try
LHtml := markup_convert(LEngine,
PAnsiChar(UTF8Encode(
'{h1 "Hello, Markup!"}{p "Write Documents, Not HTML."}')),
nil);
try
WriteLn(string(UTF8String(LHtml)));
finally
markup_free(LHtml);
end;
finally
markup_destroy(LEngine);
end;
end;No packages, no components, no third-party dependencies.
- Copy
Markup.dllandlib\c\include\Markup.hinto your project - Define
MARKUP_IMPLEMENTATIONin exactly one.cor.cppfile before including the header - In all other files, include
Markup.hnormally
#define MARKUP_IMPLEMENTATION
#include "Markup.h"
int main(void) {
if (!markup_load("Markup.dll")) return 1;
MuEngine engine = markup_create();
char* html = markup_convert(engine,
"{h1 \"Hello, Markup!\"}{p \"Write Documents, Not HTML.\"}",
NULL);
printf("%s\n", html);
markup_free(html);
markup_destroy(engine);
markup_unload();
return 0;
}No build system integration required — just compile and link.
| Document | Description |
|---|---|
| Specs.md | Language specification: syntax, tags, computation, grammar |
| API.md | Complete DLL API reference: every function, type, and callback |
| User.md | Practical usage guide: patterns, examples, memory management |
Markup is an open project. Whether you are fixing a bug, improving documentation, or proposing a feature, contributions are welcome.
- Report bugs: Open an issue with a minimal reproduction. The smaller the example, the faster the fix.
- Suggest features: Describe the use case first. Features that emerge from real problems get traction fastest.
- Submit pull requests: Bug fixes, documentation improvements, and well-scoped features are all welcome. Keep changes focused.
Join the Discord to discuss development, ask questions, and share what you are building.
Markup is built in the open. If it saves you time or sparks something useful:
- ⭐ Star the repo: it costs nothing and helps others find the project
- 🗣️ Spread the word: write a post, mention it in a community you are part of
- 💬 Join us on Discord: share what you are building and help shape what comes next
- 💖 Become a sponsor: sponsorship directly funds development and documentation
- 🦋 Follow on Bluesky: stay in the loop on releases and development
Markup is licensed under the Apache License 2.0. See LICENSE for details.
Apache 2.0 is a permissive open source license that lets you use, modify, and distribute Markup freely in both open source and commercial projects. You are not required to release your own source code. The license includes an explicit patent grant. Attribution is required; keep the copyright notice and license file in place.
Markup™ - Document Authoring Language
Copyright © 2026-present tinyBigGAMES™ LLC
All Rights Reserved.
