@flex-development/docmark-factory-line
v1.0.0-alpha.18
Published
docmark factory to parse line comments
Maintainers
Readme
docmark-factory-line
docmark factory to parse line comments.
Contents
What is this?
This package exposes a construct factory.
The returned construct parses line comments.
When should I use this?
This package may be useful when making your own docmark extensions.
Install
This package is ESM only.
In Node.js with yarn:
yarn add @flex-development/docmark-factory-lineIn Deno with esm.sh:
import { factoryLineComment } from 'https://esm.sh/@flex-development/docmark-factory-line'In browsers with esm.sh:
<script type="module">
import { factoryLineComment } from 'https://esm.sh/@flex-development/docmark-factory-line'
</script>Use
TODO: use
API
This package exports the identifier factoryLineComment.
There is no default export.
factoryLineComment<T>(options)
Create a construct that tokenizes line comments.
Type Parameters
T(ContinuableConstruct) — the line comment construct
Parameters
options(Options) — the options for creating the construct
Returns
(T) The line comment construct
Types
This package is fully typed with TypeScript.
It exports additional types.
Options
Options for creating a line comment construct (interface).
Properties
allowIndentedContinuation(AllowIndentedLines|boolean|undefined, optional) — whether continued lines can be indented in lieu of explicit line markers, or a function that returns a boolean indicating as such.
a continued line is any line after that first line of an active comment.
when indented syntax is enabled, line markers for a continued line are any character codes satisfying thewhitespacepredicateconstruct(Partial<Construct>|null|undefined, optional) — additional construct info.👉 note: the construct's
continuationandtokenizeproperties will be overridden.
theexithook is called before the factory'sexithook exits the line commentfields(CreateFields|TokenFields|null|undefined, optional) — additionalcommenttoken fields, or a function that returns the token fields object.
fields are applied when the token isentered.finalizeConstruct(FinalizeConstruct<ContinuableConstruct>|null|undefined, optional) — finalize the line comment constructmarkers(CreateMarkers|Markers) — the line markers configuration, or a function that returns the configuration
Project
Version
docmark-factory-line adheres to semver.
Contribute
See CONTRIBUTING.md.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.
Sponsor
Small primitives power larger systems. Support long-term stability by sponsoring Flex Development.
