mark↓ Example: Basic workflow

November 14, 2025 · View on GitHub

This example demonstrates the minimum steps required to index Markdown snippets and render them with the mark↓ runtime. For context about the project and other frameworks, see the monorepo overview.

Prerequisites

  • Node.js 18+
  • Dependencies installed at the repository root (npm install)
  • A manifest generated by the CLI

Steps

  1. Author content – Add Markdown files under content/snippets. Include YAML front matter for titles, tags, or custom metadata.
  2. Build the manifest – From the repo root run:
    npx mark-down build content/snippets --outDir public/snippets
    
    Adjust --outDir to match your hosting setup.
  3. Serve the app – Point your framework at the generated snippets-index.json and consume it via the core runtime or the framework adapters for Angular and React.

Customising

  • Swap in your own snippet directory by updating the CLI command and any manifest paths in code.
  • Extend the example with additional frameworks by installing the relevant adapter package.
  • Use watch mode during development: npx mark-down watch content/snippets.

Refer back to the package READMEs for deeper API documentation and integration patterns.