@flex-development/docmark-factory-block
v1.0.0-alpha.15
Published
docmark factory to parse block comments
Maintainers
Readme
docmark-factory-block
docmark factory to parse block comments.
Contents
What is this?
This package exposes a construct factory.
The returned construct parses block 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-blockIn Deno with esm.sh:
import { factoryBlockComment } from 'https://esm.sh/@flex-development/docmark-factory-block'In browsers with esm.sh:
<script type="module">
import { factoryBlockComment } from 'https://esm.sh/@flex-development/docmark-factory-block'
</script>Use
TODO: use
API
This package exports the identifier factoryBlockComment.
There is no default export.
factoryBlockComment<T>(options)
Create a construct that tokenizes block comments.
Type Parameters
T(ContinuableConstruct) — the block comment construct
Parameters
options(Options) — the options for creating the construct
Returns
(T) The block comment construct
Types
This package is fully typed with TypeScript.
It exports additional types.
Options
Options for creating a block comment construct (interface).
Properties
allowIndentedContinuation(AllowIndentedLines|boolean|undefined, optional) — whether continued lines can be indented in lieu of an explicit line marker, 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, the line marker for a continued line is 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 block 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 block comment constructmarkers(CreateMarkersPack|MarkersPack) — the markers configuration, or a function that returns the configuration
Project
Version
docmark-factory-block 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.
