Entry Points
Capabilities are split by subpath so hosts can load only what they need. The root entry is the main entry; react-wikitext/view is a lightweight entry that does not load the parser.
Pipeline
Optional pre-stage:
Subpaths
The root entry does not export anything from the parse, expand, hast, or unified subpaths. /ast, /hast, /unified, and /configs do not load the default parser; /parse and /expand do; /view loads only React and an already prepared document. The AST tree and node inspector live in the internal playground and are not public entries.
Parse and render snapshots
Parse snapshot WikitextDocument
astis the original normalized result; preparation never mutates it.syntaxexists only withretainSyntax: trueand serves the playground and source positions.metarecords parser name/version, page name, normalization state, and the original length.
Render snapshot WikitextRenderDocument
astis the plug-in-processed working tree with reassigned node ids.hastis sanitized and finalized, including the table of contents, reference section, and category footer.metarecords the effective policy, labels, heading strategy, and authorized images.WikitextViewaccepts only a render snapshot, never source.
Query transformed nodes with the render snapshot. Do not use ids from the render snapshot to look up the original parse snapshot.
How to choose
Types and errors
- Error classes are exported from their respective entries:
/astand/parseexposeWikitextError/WikitextParseError;/expandexposesWikitextExpandError;/hastexposesWikitextPrepareError. The root entry and/viewdo not export error classes. - The
WikitextLabelstype is available from/astand/view;DEFAULT_WIKITEXT_LABELSandDEFAULT_PREPARE_POLICYcome from/hast. - Import the full set of node subtypes from
/ast; the root entry exports only selected semantic types used by view props. - Error codes,
stage, and diagnostic fields are documented in Errors and diagnostics.
Reference pages
Next steps
- React components: source component, view, Fragment, and context hooks.
- Parsing
/parse: parsers, budgets, and custom adapters. - Preparation
/hast: plugins, resolvers, policy, and snapshot restore. - Errors and diagnostics: codes and handling advice.
- Status and compatibility: versions, snapshot versions, and runtime requirements.