docs: Use nicer links to Wiki (dynamic)

This commit is contained in:
Elian Doran 2024-08-10 00:26:39 +03:00
parent 280f9a98c4
commit 0deb5df11d
No known key found for this signature in database
15 changed files with 29 additions and 15 deletions

View File

@ -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");
});

View File

@ -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>

View File

@ -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");

View File

@ -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",

View File

@ -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">&times;</span>

View File

@ -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">&times;</span>

View File

@ -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">&times;</span>

View File

@ -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>

View File

@ -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">&times;</span>

View File

@ -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">&times;</span>

View File

@ -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>

View File

@ -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)));
}

View File

@ -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(

View File

@ -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()

View File

@ -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>