mirror of
https://git.quad4.io/RNS-Things/MeshChatX.git
synced 2026-10-15 11:19:59 +00:00
feat(docs): add new functions for opening and deep linking to the Reticulum manual in the documentation navigation
This commit is contained in:
@@ -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_<locale>.html) in the
|
||||
* Reticulum website bundle. The Sphinx manual itself is English-only under
|
||||
|
||||
@@ -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()}`;
|
||||
}
|
||||
Reference in New Issue
Block a user