Tagscript

DescribeParser

TagScript


Function: describeParser()

describeParser(parser, details?): TagDefinition[]

Defined in: packages/tagscript/src/lib/manifest.ts:64

Reads the names and requirements straight off a parser.

Anything extending BaseParser already declares what it accepts, so a plugin author gets a usable manifest without writing one. Labels and descriptions cannot be derived, so pass them in or fill them afterwards.

Parameters

parser

BaseParser

The parser to describe.

details?

Record<string, Partial<TagDefinition>> = {}

Label and description, keyed by tag name.

Returns

TagDefinition[]

One definition per name the parser accepts, aliases marked as such.

Example

describeParser(new StringFormatParser(), { upper: { label: 'Uppercase' } });

On this page