diff --git a/meshchatx/src/frontend/js/reticulumDocsEntryUrl.js b/meshchatx/src/frontend/js/reticulumDocsEntryUrl.js index f0a1fe7..f4c0028 100644 --- a/meshchatx/src/frontend/js/reticulumDocsEntryUrl.js +++ b/meshchatx/src/frontend/js/reticulumDocsEntryUrl.js @@ -1,3 +1,12 @@ +/** + * Relative path under /reticulum-docs/ for the Interfaces manual section on + * bootstrap_only and related options (Common Interface Options). + */ +export const RETICULUM_MANUAL_INTERFACES_COMMON_OPTIONS_REL = "manual/interfaces.html#common-interface-options"; + +/** Interfaces manual overview (directory of interface types). */ +export const RETICULUM_MANUAL_INTERFACES_OVERVIEW_REL = "manual/interfaces.html"; + /** * Locales that ship a localized root index (index_.html) in the * Reticulum website bundle. The Sphinx manual itself is English-only under diff --git a/meshchatx/src/frontend/js/reticulumDocsNavigation.js b/meshchatx/src/frontend/js/reticulumDocsNavigation.js new file mode 100644 index 0000000..0c52112 --- /dev/null +++ b/meshchatx/src/frontend/js/reticulumDocsNavigation.js @@ -0,0 +1,27 @@ +import { RETICULUM_MANUAL_INTERFACES_COMMON_OPTIONS_REL } from "./reticulumDocsEntryUrl.js"; + +/** + * Open the in-app documentation tool to a path under /reticulum-docs/. + * @param {import('vue-router').Router} router + * @param {string} [relPath] - path after /reticulum-docs/ (may include #fragment) + */ +export function openBundledReticulumManualPath(router, relPath = RETICULUM_MANUAL_INTERFACES_COMMON_OPTIONS_REL) { + return router.push({ + name: "documentation", + query: { reticulum: encodeURIComponent(relPath) }, + }); +} + +/** + * Host-agnostic deep link for the bundled Reticulum manual (handled in App.vue + * `handleProtocolLink`). Use in LXMF, notifications, or when the browser base URL is unknown. + * @param {string} relPath - path under /reticulum-docs/ (e.g. `manual/interfaces.html#section`) + * @param {"meshchatx" | "meshchat"} [scheme=meshchatx] + * @returns {string} e.g. `meshchatx://docs?reticulum=manual%2Finterfaces.html` + */ +export function bundledReticulumManualDeepLink(relPath, scheme = "meshchatx") { + const s = scheme === "meshchat" ? "meshchat" : "meshchatx"; + const q = new URLSearchParams(); + q.set("reticulum", relPath); + return `${s}://docs?${q.toString()}`; +}