EXAMPLES

Browse real-world examples demonstrating different features of functional-examples. Each example is a complete project you can explore file-by-file.

EXAMPLEREV meta-yml

Getting Started

Minimal setup demonstrating CLI usage and simple programmatic scanning. This is the first example new users should explore.


FILES: 6
EXTRACTOR: meta-yml
TAGS: beginner, scanning, getting-started
EXAMPLEREV meta-yml

CI Integration

Demonstrates integrating functional-examples into a CI pipeline using GitHub Actions. The workflow file is annotated with region tags for documentation extraction.


FILES: 7
EXTRACTOR: meta-yml
TAGS: ci, github-actions, advanced
EXAMPLEREV meta-yml

Custom Extractor

Demonstrates creating a custom Extractor implementation to support alternative metadata formats like TOML. Advanced usage requiring a TypeScript config with inline plugin code.


FILES: 8
EXTRACTOR: meta-yml
TAGS: custom, extractor, toml, advanced
EXAMPLEREV meta-yml

Devkit README Snippets

Snippets consumed by package README templates.


FILES: 12
EXTRACTOR: meta-yml
EXAMPLEREV meta-yml

Documentation Plugin

Demonstrates using the documentation plugin to generate markdown documentation from scanned examples. Shows template rendering, region extraction, and generated output structure.


FILES: 8
EXTRACTOR: meta-yml
TAGS: docs, templates, generation
EXAMPLEREV meta-yml

Getting Started

Minimal setup walkthrough showing a configuration file, a single-file example with frontmatter, and scanning.


FILES: 5
EXTRACTOR: meta-yml
TAGS: beginner, getting-started
EXAMPLEREV meta-yml

JavaScript Plugin

Demonstrates using frontmatter comments in TypeScript/JavaScript files to define example metadata, including region markers for code snippets.


FILES: 6
EXTRACTOR: meta-yml
TAGS: plugin, frontmatter, typescript, regions
EXAMPLEREV meta-yml

JSON Configuration

Shows how to use a JSON configuration file for declarative setup. JSON configs support auto-detected plugins, scan patterns, path mappings, and metadata validation via JSON Schema.


FILES: 9
EXTRACTOR: meta-yml
TAGS: configuration, json, schema-validation
EXAMPLEREV meta-yml

Metadata Validation

Demonstrates enforcing metadata requirements using JSON Schema validation to ensure examples have required fields like category and difficulty.


FILES: 7
EXTRACTOR: meta-yml
TAGS: validation, json-schema, quality
EXAMPLEREV meta-yml

Mixed Plugins

Demonstrates using multiple plugins together with path-based conflict resolution via pathMappings configuration. src/ files use JavaScript plugin, tutorials/ use YAML manifest.


FILES: 8
EXTRACTOR: meta-yml
TAGS: plugin, pathMappings, conflict-resolution
EXAMPLEREV meta-yml

Multi-Plugin Configuration

Shows how to configure multiple plugins together in a single config file.


FILES: 5
EXTRACTOR: meta-yml
TAGS: configuration, plugins
EXAMPLEREV meta-yml

Plugin Authoring

Demonstrates building a custom plugin from scratch that supports INI-based metadata. Implements the full Plugin interface with name, extensions, extractor, and fileContentsParsers.


FILES: 9
EXTRACTOR: meta-yml
TAGS: advanced, plugins, authoring
EXAMPLEREV meta-yml

Region Markers

Demonstrates how to use region markers to tag sections of code for selective extraction in documentation.


FILES: 4
EXTRACTOR: meta-yml
TAGS: regions, documentation
EXAMPLEREV meta-yml

Snapshot Testing

Demonstrates snapshot assertions for verifying scan output. Shows how to annotate snapshot files with region tags for extracting documentation snippets.


FILES: 8
EXTRACTOR: meta-yml
TAGS: testing, snapshots, advanced
EXAMPLEREV meta-yml

Test Assertions Reference

Documents all available test assertion types for functional-examples.


FILES: 5
EXTRACTOR: meta-yml
TAGS: testing, assertions, reference
EXAMPLEREV meta-yml

Test Plugin Example

Demonstrates the test plugin with command execution and assertions. Tests verify script behavior including exit codes and output content.


FILES: 9
EXTRACTOR: meta-yml
TAGS: testing, assertions, commands
EXAMPLEREV meta-yml

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.


FILES: 10
EXTRACTOR: meta-yml
TAGS: plugin, yaml, manifest