Skip to content

Commit 0deb5df

Browse files
committed
docs: Use nicer links to Wiki (dynamic)
1 parent 280f9a9 commit 0deb5df

File tree

15 files changed

+29
-15
lines changed

15 files changed

+29
-15
lines changed

integration-tests/help.spec.ts

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import test, { expect } from "@playwright/test";
2+
3+
test('Complete help in search', async ({ page }) => {
4+
await page.goto('http://localhost:8082');
5+
6+
// Clear all tabs
7+
await page.locator('.note-tab:first-of-type').locator("div").nth(1).click({ button: 'right' });
8+
await page.getByText('Close all tabs').click();
9+
10+
await page.locator('#launcher-container').getByRole('button', { name: '' }).first().click();
11+
await page.getByRole('cell', { name: ' ' }).locator('span').first().click();
12+
await page.getByRole('button', { name: 'complete help on search syntax' }).click();
13+
expect((await page.waitForEvent('popup')).url()).toBe("https://triliumnext.github.io/Docs/Wiki/search.html");
14+
});

src/public/app/services/glob.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function setupGlobs() {
2727
window.glob.importMarkdownInline = async () => appContext.triggerCommand("importMarkdownInline");
2828

2929
window.glob.SEARCH_HELP_TEXT = `
30-
<strong>Search tips</strong> - also see <button class="btn btn-sm" type="button" data-help-page="search.md">complete help on search</button>
30+
<strong>Search tips</strong> - also see <button class="btn btn-sm" type="button" data-help-page="search.html">complete help on search</button>
3131
<p>
3232
<ul>
3333
<li>Just enter any text for full text search</li>

src/public/app/services/utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ function initHelpDropdown($el) {
330330
initHelpButtons($dropdownMenu);
331331
}
332332

333-
const wikiBaseUrl = "https://github.com/TriliumNext/Docs/blob/main/Wiki/";
333+
const wikiBaseUrl = "https://triliumnext.github.io/Docs/Wiki/";
334334

335335
function openHelp($button) {
336336
const helpPage = $button.attr("data-help-page");

src/public/app/widgets/attribute_widgets/attribute_detail.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ const ATTR_HELP = {
211211
"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.",
212212
"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.",
213213
"pageSize": "number of items per page in note listing",
214-
"customRequestHandler": 'see <a href="javascript:" data-help-page="custom-request-handler.md">Custom request handler</a>',
215-
"customResourceProvider": 'see <a href="javascript:" data-help-page="custom-request-handler.md">Custom request handler</a>',
214+
"customRequestHandler": 'see <a href="javascript:" data-help-page="custom-request-handler.html">Custom request handler</a>',
215+
"customResourceProvider": 'see <a href="javascript:" data-help-page="custom-request-handler.html">Custom request handler</a>',
216216
"widget": "marks this note as a custom widget which will be added to the Trilium component tree",
217217
"workspace": "marks this note as a workspace which allows easy hoisting",
218218
"workspaceIconClass": "defines box icon CSS class which will be used in tab when hoisted to this note",

src/public/app/widgets/dialogs/add_link.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const TPL = `
1010
<div class="modal-header">
1111
<h5 class="modal-title mr-auto">Add link</h5>
1212
13-
<button type="button" class="help-button" title="Help on links" data-help-page="links.md">?</button>
13+
<button type="button" class="help-button" title="Help on links" data-help-page="links.html">?</button>
1414
1515
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-left: 0 !important;">
1616
<span aria-hidden="true">&times;</span>

src/public/app/widgets/dialogs/branch_prefix.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const TPL = `<div class="branch-prefix-dialog modal fade mx-auto" tabindex="-1"
1515
<div class="modal-header">
1616
<h5 class="modal-title mr-auto">Edit branch prefix</h5>
1717
18-
<button class="help-button" type="button" data-help-page="tree-concepts.md#prefix" title="Help on Tree prefix">?</button>
18+
<button class="help-button" type="button" data-help-page="tree-concepts.html#prefix" title="Help on Tree prefix">?</button>
1919
2020
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-left: 0;">
2121
<span aria-hidden="true">&times;</span>

src/public/app/widgets/dialogs/clone_to.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const TPL = `
1414
<div class="modal-header">
1515
<h5 class="modal-title mr-auto">Clone notes to ...</h5>
1616
17-
<button type="button" class="help-button" title="Help on links" data-help-page="cloning-notes.md">?</button>
17+
<button type="button" class="help-button" title="Help on links" data-help-page="cloning-notes.html">?</button>
1818
1919
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-left: 0 !important;">
2020
<span aria-hidden="true">&times;</span>

src/public/app/widgets/dialogs/help.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const TPL = `
7878
<li><kbd data-command="addNoteAboveToSelection">not set</kbd>, <kbd data-command="addNoteBelowToSelection">not set</kbd> - multi-select note above/below</li>
7979
<li><kbd data-command="selectAllNotesInParent">not set</kbd> - select all notes in the current level</li>
8080
<li><kbd>Shift+click</kbd> - select note</li>
81-
<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>
81+
<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>
8282
<li><kbd data-command="cutNotesToClipboard">not set</kbd> - cut current (or current selection) note into clipboard (used for moving notes)</li>
8383
<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>
8484
<li><kbd data-command="deleteNotes">not set</kbd> - delete note / sub-tree</li>

src/public/app/widgets/dialogs/protected_session_password.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const TPL = `
99
<div class="modal-header">
1010
<h5 class="modal-title mr-auto">Protected session</h5>
1111
12-
<button class="help-button" type="button" data-help-page="protected-notes.md" title="Help on Protected notes">?</button>
12+
<button class="help-button" type="button" data-help-page="protected-notes.html" title="Help on Protected notes">?</button>
1313
1414
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-left: 0;">
1515
<span aria-hidden="true">&times;</span>

src/public/app/widgets/dialogs/revisions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const TPL = `
4545
title="Delete all revisions of this note"
4646
style="padding: 0 10px 0 10px;" type="button">Delete all revisions</button>
4747
48-
<button class="help-button" type="button" data-help-page="note-revisions.md" title="Help on Note revisions">?</button>
48+
<button class="help-button" type="button" data-help-page="note-revisions.html" title="Help on Note revisions">?</button>
4949
5050
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-left: 0 !important;">
5151
<span aria-hidden="true">&times;</span>

src/public/app/widgets/search_options/search_string.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const TPL = `
1414
<div class="dropdown help-dropdown">
1515
<span class="bx bx-help-circle icon-action" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span>
1616
<div class="dropdown-menu dropdown-menu-right p-4">
17-
<strong>Search syntax</strong> - also see <button class="btn btn-sm" type="button" data-help-page="search.md">complete help on search syntax</button>
17+
<strong>Search syntax</strong> - also see <button class="btn btn-sm" type="button" data-help-page="search.html">complete help on search syntax</button>
1818
<p>
1919
<ul>
2020
<li>Just enter any text for full text search</li>

src/public/app/widgets/shared_switch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default class SharedSwitchWidget extends SwitchWidget {
2020
this.$switchOffName.text("Shared");
2121
this.$switchOffButton.attr("title", "Unshare the note");
2222

23-
this.$helpButton.attr("data-help-page", "sharing.md").show();
23+
this.$helpButton.attr("data-help-page", "sharing.html").show();
2424
this.$helpButton.on('click', e => utils.openHelp($(e.target)));
2525
}
2626

src/public/app/widgets/type_widgets/attachment_detail.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default class AttachmentDetailTypeWidget extends TypeWidget {
4747
this.$wrapper.empty();
4848
this.children = [];
4949

50-
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>');
50+
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>');
5151
utils.initHelpButtons($helpButton);
5252

5353
this.$linksWrapper.empty().append(

src/public/app/widgets/type_widgets/attachment_list.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default class AttachmentListTypeWidget extends TypeWidget {
3939
}
4040

4141
async doRefresh(note) {
42-
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>');
42+
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>');
4343
utils.initHelpButtons($helpButton);
4444

4545
const noteLink = await linkService.createLink(this.noteId); // do separately to avoid race condition between empty() and .append()

src/public/app/widgets/type_widgets/options/sync.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const TPL = `
2828
<div style="display: flex; justify-content: space-between;">
2929
<button class="btn btn-primary">Save</button>
3030
31-
<button class="btn" type="button" data-help-page="synchronization.md">Help</button>
31+
<button class="btn" type="button" data-help-page="synchronization.html">Help</button>
3232
</div>
3333
</form>
3434
</div>

0 commit comments

Comments
 (0)