meld
Version:
Meld: A template language for LLM prompts
106 lines (97 loc) • 4.26 kB
HTML
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Introduction to Meld - meld</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Tektur:wght@800&family=Cousine:wght@400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/css/style.css">
<script src="/js/theme.js" defer></script>
<script src="/js/terminal.js" defer></script>
</head>
<body>
<header>
<div class="container">
<a href="/" class="logo">meld</a>
<nav>
<ul>
<li><a href="/" aria-current="page">Home</a></li>
<li><a href="/docs/introduction/" aria-current="page">Docs</a></li>
<li><a href="https://github.com/meldorg/meld">GitHub</a></li>
</ul>
</nav>
</div>
</header>
<main>
<div class="container">
<div class="docs-layout">
<aside class="docs-sidebar">
<nav>
<h3>Documentation</h3>
<ul class="nav-list">
<li><a href="/docs/introduction/" aria-current="page">Introduction</a></li>
<li><a href="/docs/cli-usage/" >CLI Usage</a></li>
<li><a href="/docs/sdk-usage/" >SDK Usage</a></li>
<li><a href="/docs/variables/" >Variables</a></li>
<li><a href="/docs/error-handling/" >Error Handling</a></li>
<li><a href="/docs/grammar-reference/" >Grammar Reference</a></li>
</ul>
<h3>Directives</h3>
<ul class="nav-list">
<li><a href="/docs/directives/" >Overview</a></li>
<li><a href="/docs/directives/data/" >@data</a></li>
<li><a href="/docs/directives/define/" >@define</a></li>
<li><a href="/docs/directives/embed/" >@embed</a></li>
<li><a href="/docs/directives/import/" >@import</a></li>
<li><a href="/docs/directives/path/" >@path</a></li>
<li><a href="/docs/directives/run/" >@run</a></li>
<li><a href="/docs/directives/text/" >@text</a></li>
</ul>
</nav>
</aside>
<div class="docs-content">
<h1 id="introduction-to-meld" tabindex="-1">Introduction to Meld</h1>
<p>Meld is a simple and constrained scripting language designed for use within markdown-like documents. It allows you to create dynamic content by interpreting special directive lines while preserving all other content as-is.</p>
<h2 id="core-concepts" tabindex="-1">Core Concepts</h2>
<p>Meld works by processing only lines that begin with directives (like <code>@text</code>, <code>@run</code>, etc.) while treating all other content as literal text. This makes it ideal for creating dynamic, templated documents.</p>
<h3 id="key-features" tabindex="-1">Key Features</h3>
<ul>
<li>Simple, predictable syntax with clear boundaries</li>
<li>Focused on markdown integration and content generation</li>
<li>Support for variables, file imports, and command execution</li>
<li>Preserves existing content structure</li>
</ul>
<h2 id="basic-example" tabindex="-1">Basic Example</h2>
<pre><code class="language-meld">@text name = "World"
@path docs = "$PROJECTPATH/docs"
Hello, {{name}}!
@embed [$docs/example.md]
@run [echo "Current time: $(date)"]
</code></pre>
<p>This example:</p>
<ol>
<li>Defines a text variable <code>name</code> with the value "World"</li>
<li>Defines a path variable <code>docs</code> pointing to the project's docs folder</li>
<li>Uses the text variable in a template string</li>
<li>Embeds content from an external file</li>
<li>Runs a shell command and includes its output</li>
</ol>
<h2 id="next-steps" tabindex="-1">Next Steps</h2>
<ul>
<li>Learn about <a href="./variables.md">variables and interpolation</a></li>
<li>Explore the <a href="./directives/README.md">directives</a> available in Meld</li>
<li>Check the complete <a href="./grammar-reference.md">grammar reference</a> for detailed syntax</li>
</ul>
</div>
</div>
</div>
</main>
<footer>
<div class="container">
<p>© 2025 meld - <a href="https://github.com/meldorg/meld">GitHub</a></p>
</div>
</footer>
</body>
</html>