EXAMPLES/yaml-manifest

YAML Manifest Plugin

Demonstrates using the yaml-manifest plugin to manage multi-file examples with meta.yml metadata files. Each example is a directory containing a meta.yml and source files.

meta-yml10 FILESpluginyamlmanifest

YAML Manifest Example

This example demonstrates the @functional-examples/yaml-manifest plugin, which organizes examples as directories with a meta.yml manifest file.

Usage

bash
1# Scan and display examples
2npx functional-examples scan
3
4# Output as JSON
5npx functional-examples scan -f json

Directory Structure

text
1examples/
2├── basic-usage/
3│   ├── meta.yml      # Required: metadata for this example
4│   └── scan.ts       # Source file
5└── multi-file/
6    ├── meta.yml
7    ├── main.ts       # Entry point
8    └── utils.ts      # Additional files

Configuration

The config file sets up the YAML manifest plugin:

{
  "$schema": "./.functional-examples/schema.json",
  "scan": {
    "include": ["examples/**/*"],
    "exclude": ["**/node_modules/**", "**/dist/**"]
  }
}
text
1## meta.yml Format
2
3```yaml
4id: my-example
5title: My Example Title
6description: |
7  A longer description that can span
8  multiple lines using YAML syntax.
9tags:
10  - beginner
11  - tutorial

Required fields: id, title

When to Use This Plugin

Choose YAML manifest over frontmatter when:

  • Multi-file examples — Example spans multiple source files
  • Non-JS/TS files — Python, Go, Rust, etc.
  • Clean source files — No metadata comments in code
  • Complex metadata — Easier to write in YAML than comment syntax

All Example Files

FILE EXPLORER
README.md
1# YAML Manifest Example
2
3This example demonstrates the `@functional-examples/yaml-manifest` plugin, which organizes examples as directories with a `meta.yml` manifest file.
4
5## Usage
6
7```bash
8# Scan and display examples
9npx functional-examples scan
10
11# Output as JSON
12npx functional-examples scan -f json
13```
14
15## Directory Structure
16
17```
18examples/
19├── basic-usage/
20│   ├── meta.yml      # Required: metadata for this example
21│   └── scan.ts       # Source file
22└── multi-file/
23    ├── meta.yml
24    ├── main.ts       # Entry point
25    └── utils.ts      # Additional files
26```
27
28## Configuration
29
30The config file sets up the YAML manifest plugin:
31
32<%= file('functional-examples.config.json') %>
33
34## meta.yml Format
35
36```yaml
37id: my-example
38title: My Example Title
39description: |
40  A longer description that can span
41  multiple lines using YAML syntax.
42tags:
43  - beginner
44  - tutorial
45```
46
47Required fields: `id`, `title`
48
49## When to Use This Plugin
50
51Choose YAML manifest over frontmatter when:
52
53- **Multi-file examples** — Example spans multiple source files
54- **Non-JS/TS files** — Python, Go, Rust, etc.
55- **Clean source files** — No metadata comments in code
56- **Complex metadata** — Easier to write in YAML than comment syntax
57