EXAMPLES/plugin-authoring

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.

meta-yml9 FILESadvancedpluginsauthoring

Plugin Authoring

Demonstrates building a custom plugin from scratch that supports INI-based metadata.

What This Shows

  • Implementing the full Plugin interface (name, extensions, extractor, fileContentsParsers)
  • Creating a custom Extractor that discovers meta.ini files
  • Creating a FileContentsParser that strips INI comments
  • Registering the plugin in a TypeScript config file

Running

bash
1# Scan for examples using the custom INI plugin
2bash demo.sh

Plugin Structure

The INI plugin (src/ini-plugin.ts) provides:

  1. Extractor — scans for meta.ini files, parses INI key=value pairs, returns Example objects
  2. FileContentsParser — strips INI comments (; and # lines) from .ini files
  3. Plugin — bundles the extractor and parser with a name and extensions list

All Example Files

FILE EXPLORER
README.md
1# Plugin Authoring
2
3Demonstrates building a custom plugin from scratch that supports INI-based metadata.
4
5## What This Shows
6
7- Implementing the full `Plugin` interface (name, extensions, extractor, fileContentsParsers)
8- Creating a custom `Extractor` that discovers `meta.ini` files
9- Creating a `FileContentsParser` that strips INI comments
10- Registering the plugin in a TypeScript config file
11
12## Running
13
14```bash
15# Scan for examples using the custom INI plugin
16bash demo.sh
17```
18
19## Plugin Structure
20
21The INI plugin (`src/ini-plugin.ts`) provides:
22
231. **Extractor** — scans for `meta.ini` files, parses INI key=value pairs, returns `Example` objects
242. **FileContentsParser** — strips INI comments (`;` and `#` lines) from `.ini` files
253. **Plugin** — bundles the extractor and parser with a name and extensions list
26