pub struct ParserArgs {
pub file: Option<String>,
pub slots: bool,
pub location: bool,
pub conditional_tags: Option<Vec<String>>,
pub parse_frontmatter: bool,
pub strip_bom: bool,
pub spans: bool,
}Expand description
Upstream’s ParserArgs (types.ts): {file?, slots?, location?, conditionalTags?}, and
three switches of this crate’s, off by default.
Fields§
§file: Option<String>location.file of every node.
slots: boolPut {% slot "name" %} tags in their parent’s slots instead of its children.
location: boolGive nodes lines and location (upstream: unless location: false).
The tags the table transform keeps as row wrappers; None is upstream’s default,
['if'].
parse_frontmatter: boolThis crate’s: the document’s frontmatter attribute is the YAML parsed into an object
(see the module’s documentation). Off: upstream’s raw text.
strip_bom: boolThis crate’s: crate::next::index::parse does not tokenize a byte-order mark that
starts the text (upstream does, so a heading on line 1 is then a paragraph). The
parser takes tokens as they are and ignores it.
spans: boolThis crate’s: give nodes and the parser’s errors this crate’s own positions,
Node::span and ValidationError::span (1-based line, UTF-16 column and byte
offset at each end; see the module’s documentation), which validate() passes on as
crate::validator::ValidateError::span. Off by default, as upstream has none: the
parser then does none of their work (about half of a parse) and every span is
None. A tool that reports positions (a linter, a language server) turns it on.
Needs location: with location: false nothing has a span.