Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
docs: Use nicer links to Wiki (dynamic)
Elian Doran0deb5df11dac
diff --git a/integration-tests/help.spec.ts b/integration-tests/help.spec.tsnew file mode 100644index 0000000000..aa0087328d--- /dev/null+++ b/integration-tests/help.spec.ts@@ -0,0 +1,14 @@+import test, { expect } from "@playwright/test";++test('Complete help in search', async ({ page }) => {+ await page.goto('http://localhost:8082');++ // Clear all tabs+ await page.locator('.note-tab:first-of-type').locator("div").nth(1).click({ button: 'right' });+ await page.getByText('Close all tabs').click();++ await page.locator('#launcher-container').getByRole('button', { name: '' }).first().click();+ await page.getByRole('cell', { name: ' ' }).locator('span').first().click();+ await page.getByRole('button', { name: 'complete help on search syntax' }).click();+ expect((await page.waitForEvent('popup')).url()).toBe("https://triliumnext.github.io/Docs/Wiki/search.html");+});\ No newline at end of filediff --git a/src/public/app/services/glob.js b/src/public/app/services/glob.jsindex 925feaf825..7177a6f958 100644--- a/src/public/app/services/glob.js+++ b/src/public/app/services/glob.js@@ -27,7 +27,7 @@ function setupGlobs() {window.glob.importMarkdownInline = async () => appContext.triggerCommand("importMarkdownInline");window.glob.SEARCH_HELP_TEXT = `- <strong>Search tips</strong> - also see <button class="btn btn-sm" type="button" data-help-page="search.md">complete help on search</button>+ <strong>Search tips</strong> - also see <button class="btn btn-sm" type="button" data-help-page="search.html">complete help on search</button><p><ul><li>Just enter any text for full text search</li>diff --git a/src/public/app/services/utils.js b/src/public/app/services/utils.jsindex 7802ff128e..281db023d2 100644--- a/src/public/app/services/utils.js+++ b/src/public/app/services/utils.js@@ -330,7 +330,7 @@ function initHelpDropdown($el) {initHelpButtons($dropdownMenu);}-const wikiBaseUrl = "https://github.com/TriliumNext/Docs/blob/main/Wiki/";+const wikiBaseUrl = "https://triliumnext.github.io/Docs/Wiki/";function openHelp($button) {const helpPage = $button.attr("data-help-page");diff --git a/src/public/app/widgets/attribute_widgets/attribute_detail.js b/src/public/app/widgets/attribute_widgets/attribute_detail.jsindex 2a70d23c93..3fadd3dabe 100644--- a/src/public/app/widgets/attribute_widgets/attribute_detail.js+++ b/src/public/app/widgets/attribute_widgets/attribute_detail.js@@ -211,8 +211,8 @@ const ATTR_HELP = {"cssClass": "value of this label is then added as CSS class to the node representing given note in the tree. This can be useful for advanced theming. Can be used in template notes.","iconClass": "value of this label is added as a CSS class to the icon on the tree which can help visually distinguish the notes in the tree. Example might be bx bx-home - icons are taken from boxicons. Can be used in template notes.","pageSize": "number of items per page in note listing",- "customRequestHandler": 'see <a href="javascript:" data-help-page="custom-request-handler.md">Custom request handler</a>',- "customResourceProvider": 'see <a href="javascript:" data-help-page="custom-request-handler.md">Custom request handler</a>',+ "customRequestHandler": 'see <a href="javascript:" data-help-page="custom-request-handler.html">Custom request handler</a>',+ "customResourceProvider": 'see <a href="javascript:" data-help-page="custom-request-handler.html">Custom request handler</a>',"widget": "marks this note as a custom widget which will be added to the Trilium component tree","workspace": "marks this note as a workspace which allows easy hoisting","workspaceIconClass": "defines box icon CSS class which will be used in tab when hoisted to this note",diff --git a/src/public/app/widgets/dialogs/add_link.js b/src/public/app/widgets/dialogs/add_link.jsindex 0c7772fc85..faa971af68 100644--- a/src/public/app/widgets/dialogs/add_link.js+++ b/src/public/app/widgets/dialogs/add_link.js@@ -10,7 +10,7 @@ const TPL = `<div class="modal-header"><h5 class="modal-title mr-auto">Add link</h5>- <button type="button" class="help-button" title="Help on links" data-help-page="links.md">?</button>+ <button type="button" class="help-button" title="Help on links" data-help-page="links.html">?</button><button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-left: 0 !important;"><span aria-hidden="true">×</span>diff --git a/src/public/app/widgets/dialogs/branch_prefix.js b/src/public/app/widgets/dialogs/branch_prefix.jsindex 5167d83f10..39df26bcf6 100644--- a/src/public/app/widgets/dialogs/branch_prefix.js+++ b/src/public/app/widgets/dialogs/branch_prefix.js@@ -15,7 +15,7 @@ const TPL = `<div class="branch-prefix-dialog modal fade mx-auto" tabindex="-1"<div class="modal-header"><h5 class="modal-title mr-auto">Edit branch prefix</h5>- <button class="help-button" type="button" data-help-page="tree-concepts.md#prefix" title="Help on Tree prefix">?</button>+ <button class="help-button" type="button" data-help-page="tree-concepts.html#prefix" title="Help on Tree prefix">?</button><button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-left: 0;"><span aria-hidden="true">×</span>diff --git a/src/public/app/widgets/dialogs/clone_to.js b/src/public/app/widgets/dialogs/clone_to.jsindex 2011178bd7..850cdef4c6 100644--- a/src/public/app/widgets/dialogs/clone_to.js+++ b/src/public/app/widgets/dialogs/clone_to.js@@ -14,7 +14,7 @@ const TPL = `<div class="modal-header"><h5 class="modal-title mr-auto">Clone notes to ...</h5>- <button type="button" class="help-button" title="Help on links" data-help-page="cloning-notes.md">?</button>+ <button type="button" class="help-button" title="Help on links" data-help-page="cloning-notes.html">?</button><button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-left: 0 !important;"><span aria-hidden="true">×</span>diff --git a/src/public/app/widgets/dialogs/help.js b/src/public/app/widgets/dialogs/help.jsindex a249e16b10..53de8c1da8 100644--- a/src/public/app/widgets/dialogs/help.js+++ b/src/public/app/widgets/dialogs/help.js@@ -78,7 +78,7 @@ const TPL = `<li><kbd data-command="addNoteAboveToSelection">not set</kbd>, <kbd data-command="addNoteBelowToSelection">not set</kbd> - multi-select note above/below</li><li><kbd data-command="selectAllNotesInParent">not set</kbd> - select all notes in the current level</li><li><kbd>Shift+click</kbd> - select note</li>- <li><kbd data-command="copyNotesToClipboard">not set</kbd> - copy active note (or current selection) into clipboard (used for <a class="external" href="https://triliumnext.github.io/Docs/Wiki/cloning-notes.html#cloning-notes.md">cloning</a>)</li>+ <li><kbd data-command="copyNotesToClipboard">not set</kbd> - copy active note (or current selection) into clipboard (used for <a class="external" href="https://triliumnext.github.io/Docs/Wiki/cloning-notes.html#cloning-notes">cloning</a>)</li><li><kbd data-command="cutNotesToClipboard">not set</kbd> - cut current (or current selection) note into clipboard (used for moving notes)</li><li><kbd data-command="pasteNotesFromClipboard">not set</kbd> - paste note(s) as sub-note into active note (which is either move or clone depending on whether it was copied or cut into clipboard)</li><li><kbd data-command="deleteNotes">not set</kbd> - delete note / sub-tree</li>diff --git a/src/public/app/widgets/dialogs/protected_session_password.js b/src/public/app/widgets/dialogs/protected_session_password.jsindex 4985fc09d9..4f5ee3fa1d 100644--- a/src/public/app/widgets/dialogs/protected_session_password.js+++ b/src/public/app/widgets/dialogs/protected_session_password.js@@ -9,7 +9,7 @@ const TPL = `<div class="modal-header"><h5 class="modal-title mr-auto">Protected session</h5>- <button class="help-button" type="button" data-help-page="protected-notes.md" title="Help on Protected notes">?</button>+ <button class="help-button" type="button" data-help-page="protected-notes.html" title="Help on Protected notes">?</button><button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-left: 0;"><span aria-hidden="true">×</span>diff --git a/src/public/app/widgets/dialogs/revisions.js b/src/public/app/widgets/dialogs/revisions.jsindex f455cb3fee..58e1a27f92 100644--- a/src/public/app/widgets/dialogs/revisions.js+++ b/src/public/app/widgets/dialogs/revisions.js@@ -45,7 +45,7 @@ const TPL = `title="Delete all revisions of this note"style="padding: 0 10px 0 10px;" type="button">Delete all revisions</button>- <button class="help-button" type="button" data-help-page="note-revisions.md" title="Help on Note revisions">?</button>+ <button class="help-button" type="button" data-help-page="note-revisions.html" title="Help on Note revisions">?</button><button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-left: 0 !important;"><span aria-hidden="true">×</span>diff --git a/src/public/app/widgets/search_options/search_string.js b/src/public/app/widgets/search_options/search_string.jsindex e36b2d534e..b17d544de1 100644--- a/src/public/app/widgets/search_options/search_string.js+++ b/src/public/app/widgets/search_options/search_string.js@@ -14,7 +14,7 @@ const TPL = `<div class="dropdown help-dropdown"><span class="bx bx-help-circle icon-action" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span><div class="dropdown-menu dropdown-menu-right p-4">- <strong>Search syntax</strong> - also see <button class="btn btn-sm" type="button" data-help-page="search.md">complete help on search syntax</button>+ <strong>Search syntax</strong> - also see <button class="btn btn-sm" type="button" data-help-page="search.html">complete help on search syntax</button><p><ul><li>Just enter any text for full text search</li>diff --git a/src/public/app/widgets/shared_switch.js b/src/public/app/widgets/shared_switch.jsindex d68a086d37..edab7df815 100644--- a/src/public/app/widgets/shared_switch.js+++ b/src/public/app/widgets/shared_switch.js@@ -20,7 +20,7 @@ export default class SharedSwitchWidget extends SwitchWidget {this.$switchOffName.text("Shared");this.$switchOffButton.attr("title", "Unshare the note");- this.$helpButton.attr("data-help-page", "sharing.md").show();+ this.$helpButton.attr("data-help-page", "sharing.html").show();this.$helpButton.on('click', e => utils.openHelp($(e.target)));}diff --git a/src/public/app/widgets/type_widgets/attachment_detail.js b/src/public/app/widgets/type_widgets/attachment_detail.jsindex 03041b54e4..02e38c7a61 100644--- a/src/public/app/widgets/type_widgets/attachment_detail.js+++ b/src/public/app/widgets/type_widgets/attachment_detail.js@@ -47,7 +47,7 @@ export default class AttachmentDetailTypeWidget extends TypeWidget {this.$wrapper.empty();this.children = [];- const $helpButton = $('<button class="attachment-help-button" type="button" data-help-page="attachments.md" title="Open help page on attachments"><span class="bx bx-help-circle"></span></button>');+ const $helpButton = $('<button class="attachment-help-button" type="button" data-help-page="attachments.html" title="Open help page on attachments"><span class="bx bx-help-circle"></span></button>');utils.initHelpButtons($helpButton);this.$linksWrapper.empty().append(diff --git a/src/public/app/widgets/type_widgets/attachment_list.js b/src/public/app/widgets/type_widgets/attachment_list.jsindex 247f9e1e05..0ee9956047 100644--- a/src/public/app/widgets/type_widgets/attachment_list.js+++ b/src/public/app/widgets/type_widgets/attachment_list.js@@ -39,7 +39,7 @@ export default class AttachmentListTypeWidget extends TypeWidget {}async doRefresh(note) {- const $helpButton = $('<button class="attachment-help-button" type="button" data-help-page="attachments.md" title="Open help page on attachments"><span class="bx bx-help-circle"></span></button>');+ const $helpButton = $('<button class="attachment-help-button" type="button" data-help-page="attachments.html" title="Open help page on attachments"><span class="bx bx-help-circle"></span></button>');utils.initHelpButtons($helpButton);const noteLink = await linkService.createLink(this.noteId); // do separately to avoid race condition between empty() and .append()diff --git a/src/public/app/widgets/type_widgets/options/sync.js b/src/public/app/widgets/type_widgets/options/sync.jsindex b9ebc39afe..bb8e3c9dd7 100644--- a/src/public/app/widgets/type_widgets/options/sync.js+++ b/src/public/app/widgets/type_widgets/options/sync.js@@ -28,7 +28,7 @@ const TPL = `<div style="display: flex; justify-content: space-between;"><button class="btn btn-primary">Save</button>- <button class="btn" type="button" data-help-page="synchronization.md">Help</button>+ <button class="btn" type="button" data-help-page="synchronization.html">Help</button></div></form></div>