Expand description
Textlane’s core: the unist conventions and the mdast, hast and nlcst nodes built on them, the file a pipeline reads and reports diagnostics against, and the plugin contract every crate shares.
Modules§
- hast
- The hast nodes: HTML’s syntax tree.
- mdast
- The mdast nodes: Markdown’s syntax tree.
- nlcst
- The nlcst nodes: natural language’s syntax tree.
Structs§
- Allocator
- The arena every node of one document is allocated in. An arena to bump allocate into.
- Arena
Vec - A vector allocated in a document’s arena that never drops its items.
- Attach
- What plugins register while a processor freezes.
- Error
- A failure that stops a pipeline: a stable
codeand a message for people. - File
- The document a pipeline processes: where it came from and what plugins reported about it.
- Html
Target - What an HTML compiler writes that a stage writing HTML itself must match.
- Lines
- The line starts of a source, to turn byte points into unist’s UTF-16 lines and columns.
- Location
- A source indexed as vfile-location reads it: offsets in UTF-16 code units, turned into lines, columns and the byte points of core’s positions, each in constant or log time.
- Message
- A diagnostic a plugin reported, as vfile-message does.
- Natural
Language Parser Slot - The slot holding the natural-language parser bridges into nlcst read when their stage is built; the
textlane processor seeds it with
nl.parse’s Latin parser before plugins attach. - Point
- A place in the source: a byte offset, plus the virtual spaces into a tab it sits at.
- Quote
Characters - The quote characters to use for double and single quotes.
- Resolved
Url - A relative or root-relative URL resolved to the file it names inside a site.
- Script
Error - A syntax error: the byte span of what the parser stopped at, which ends at the end of the source when more source might still make it valid.
- Script
Expression - What an expression is, as far as MDX checks it: the byte offset where it ends, before any comments after it, and, for an object literal (parentheses dropped), the ESTree type and byte offset of each property.
- Script
Parser Slot - The slot holding the script parser
md.mdxvalidates JavaScript with; the textlane processor seeds it when built withmdx. Without one, expressions end at the brace that balances their opening one and imports and exports at a blank line. - Script
Statement - A top-level statement of a module: its ESTree type, where it starts and, for an import, the local names it declares.
- Slots
- Data plugins share while attaching, one value per type.
- Slugger
- github-slugger’s
BananaSlug: slugs, made unique by counting repeats. - Typographer
Slot - The slot holding the typographer
md.smartypantsuses; the textlane processor seeds it when built withnl. - Typography
- What a
Typographerreplaces, as retext-smartypants’ options name it. - Unist
Point - A point as unist writes it.
- Unist
Position - A position as unist writes it: lines and columns from 1, offsets in UTF-16 code units.
Enums§
- Backticks
- How smartypants treats backticks:
false,trueor'all'. - Dashes
- How smartypants treats dashes:
false,true,'oldschool'or'inverted'. - Data
- unist’s
data: whatever JSON a plugin attached to a node, kept as it is. - Ellipses
- How smartypants treats dots:
false,true,'spaced'or'unspaced'. - Position
- Where a node sits: a span of the current source, or a unist position that does not point into it, such as one a foreign plugin set or one read from a serialized tree.
- Step
- What starting a stage gives: its tree, or a job that yields it.
- Tree
- The tree a pipeline stage takes or returns.
- Tree
Kind - Which kind of tree a stage takes or returns, checked when a processor freezes.
Traits§
- Compiler
- Turns a tree into output text, whose kind
extensionnames (html,md). - Html
Writer - Writes HTML straight from a tree, or
Noneto have the stages run as declared. - Natural
Language Parser - A natural-language parser, as parse-latin’s instance is to mdast-util-to-nlcst and hast-util-to-nlcst: bridges into nlcst tokenize text with it and run its plugins.
- Parser
- Turns input text into a tree.
- Plugin
- A pipeline stage: attached once when a processor freezes, where it registers what it does.
- Script
Parser - A JavaScript parser, as acorn is to micromark’s MDX extensions:
md.mdxasks it where an expression or a block of imports and exports is valid, and keeps only the source. - Transform
- Changes a tree, or bridges it into another kind of tree.
- Typographer
- Typographic punctuation for text, as retext-smartypants gives it: what
md.smartypantsasks the natural-language plugins for.
Functions§
- create_
slug - Lowercase, drop punctuation and symbols, turn spaces into dashes.
- find_
gemoji_ shortcodes - The
:name:shortcodes gemoji knows invalue, each(start, end, emoji), found as remark-gemoji’s/:(\+1|[-\w]+):/gfinds them; an unknown name is retried from its next character, so its closing colon can open the next shortcode. - prefix_
base baseonce before a root-relative URL: never twice, nothing for/or none.- read_
gemoji_ label - A shortcode’s name as remark-emoji labels it: each
_, and each-not before1, as a space. - read_
switch - A switch upstream reads as
!== false:nulland a missing option meantrue. - resolve_
url - Resolve
url, written in the file atpath, to the file it names insideroot;Nonefor a URL with a scheme, protocol-relative, holding a backslash, a control character or surrounding space, or a fragment alone, or a relative one without a file to resolve it against or resolving outsideroot.
Type Aliases§
- Arena
String - A string allocated in a document’s arena, while it is being built.
- Job
- Deferred work a stage hands back, finished only by the asynchronous API.