Help and documentation topics
Help and documentation topics
Section intitulée « Help and documentation topics »Documentation is Markdown topics merged from sources (ADR-0014). A topic is a file with front matter (id, title, summary, kind, audience, locale, context, uses, generated); links between topics are [[namespace/name]], never paths. The framework’s own topics live in docs/topics/<locale>/ (one file per locale, en is the fallback); run bun run docs:manifest after editing them to refresh docs/topics/docs-manifest.json, which a test keeps in sync. The Vite web and desktop builds bundle the topics, so help works offline.
A help key is an opaque string declared on an interface element; a topic lists the keys that open it in context:
{ "panels": [{ "id": "board", "surface": "leftSidebar", "help": "my-plugin.board", "…": "…" }], "views": [{ "id": "main", "type": "table", "help": "my-plugin.main", "…": "…" }] }help is also accepted by ctx.contribute({ help }), ctx.registerView({ help }) and PluginDefinition.help. F1 in a focused panel or view opens the help panel on the user topic whose context lists that key, or on the topic index with a search box when none does. The shell only forwards the key (shell/help.request); it never interprets it.
A plugin adds its topics with a source:
const off = ctx.docs.registerSource({ id: "my-plugin", list: async () => topics, // Topic[]: front matter, no body read: async (topicId, locale) => body, // Markdown without front matter});Only audience: user topics reach the help panel. await ctx.docs.catalogue() gives the merged @scfloworg/docs catalogue (topics, get, resolveHelpKey, read, search, check); types are re-exported by plugin-api. Every help key declared by a built-in panel must resolve to a topic (tests/help.test.ts).
Documentation sous licence CC BY 4.0 · © les contributeurs de SCFlow ·Retour à supplychainflow.org