Expand description
Help topic registry (DESIGN.md §5.11).
Hand-written, free-form help docs (the :help <topic> surface,
distinct from the introspection-driven :describe-* views) live
here. The built-in set is generated from docs/user/**/*.md by
build.rs and embedded deflate-compressed, so :help works
offline with no filesystem layout assumption beyond the binary
itself, without the binary paying raw markdown volume.
The registry is intentionally indirection-friendly:
HelpTopicBody::Compressedis what every builtin uses — inflated on first open and cached, so a session that never opens:helpnever decompresses anything.HelpTopicBody::Staticembeds compile-time markdown directly.HelpTopicBody::Ownedholds runtime markdown — what a plugin’s pages land as, having crossed the WASM boundary as aString.HelpTopicBody::Dynamictakes a closure that produces text on demand – this is the seam for LSP-driven topics (:help symbol::Foo) and in-process introspection that can’t be captured at compile time.
Runtime-writable (CR.1). The host holds this as a
HelpTopicRegistryHandle — copy-on-write RCU behind an
ArcSwap, the same idiom the command / picker / compilation-parser
registries use. Reads are wait-free snapshots taken once per
:help invocation; writes happen only on plugin load and unload.
That is what lets a plugin ship a :help page: its markdown is
baked into its own component and registered through the help WIT
seam (CR.3). See
docs/dev/architecture/contributable-registries.md.
Topics also carry an optional list of substring patterns that
match command names; :describe-command walks these to emit a
See also: [topic](help:topic) cross-link when a primitive
covered by a topic is described.
Structs§
- Help
Topic - One free-form help topic.
- Help
Topic Registry - Catalogue of every registered topic, keyed by name. Plugins and
future LSP integrations register through
register. - Help
Topics Generator gen:help-topics. Returns oneRawCandidateper registered help topic so:help <Tab>enumerates available topics. The payload isCandidateData::Plain– topic name alone is enough for the v1 popup; future polish can introduce a richerHelpTopicvariant if summaries need to flow through the matcher / annotator pipeline.
Enums§
- Help
Topic Body - Where a topic’s body comes from.
Functions§
- builtin_
topics - The built-in topic set, generated at build time by
build.rsfrom everydocs/user/**/*.md(recursively, skippingtutor/). Each doc’s---YAML frontmatter suppliessummary+related(see the build script); bodies are embedded as string literals so the binary stays self-contained — no runtime filesystem dependency. Adding a doc requires no change here: drop the.mdintodocs/user/and it registers automatically. CR.1: returns the registry by value. The caller wraps it in aHelpTopicRegistryHandleviaHelpTopicRegistry::into_handle— the builtin set is the initial contents of a runtime-writable registry now, not the whole of it.
Type Aliases§
- Help
Topic Registry Handle - The runtime-mutable handle, registered as a boot service under this
exact alias (the
ServiceRegistryArc/TypeId convention).