EXAMPLES
Browse real-world examples demonstrating different features of functional-examples. Each example is a complete project you can explore file-by-file.
Getting Started
Minimal setup demonstrating CLI usage and simple programmatic scanning. This is the first example new users should explore.
CI Integration
Demonstrates integrating functional-examples into a CI pipeline using GitHub Actions. The workflow file is annotated with region tags for documentation extraction.
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.
Devkit README Snippets
Snippets consumed by package README templates.
Documentation Plugin
Demonstrates using the documentation plugin to generate markdown documentation from scanned examples. Shows template rendering, region extraction, and generated output structure.
Getting Started
Minimal setup walkthrough showing a configuration file, a single-file example with frontmatter, and scanning.
JavaScript Plugin
Demonstrates using frontmatter comments in TypeScript/JavaScript files to define example metadata, including region markers for code snippets.
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.
Metadata Validation
Demonstrates enforcing metadata requirements using JSON Schema validation to ensure examples have required fields like category and difficulty.
Mixed Plugins
Demonstrates using multiple plugins together with path-based conflict resolution via pathMappings configuration. src/ files use JavaScript plugin, tutorials/ use YAML manifest.
Multi-Plugin Configuration
Shows how to configure multiple plugins together in a single config file.
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.
Region Markers
Demonstrates how to use region markers to tag sections of code for selective extraction in documentation.
Snapshot Testing
Demonstrates snapshot assertions for verifying scan output. Shows how to annotate snapshot files with region tags for extracting documentation snippets.
Test Assertions Reference
Documents all available test assertion types for functional-examples.
Test Plugin Example
Demonstrates the test plugin with command execution and assertions. Tests verify script behavior including exit codes and output content.
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.