mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-05-18 13:16:11 +02:00
Merge pull request #7655 from 01zulfi/global/keyboard
global: keyboard shortcuts documentation && web dialog
This commit is contained in:
76
docs/help/contents/keyboard-shortcuts.md
Normal file
76
docs/help/contents/keyboard-shortcuts.md
Normal file
@@ -0,0 +1,76 @@
|
||||
---
|
||||
title: Keyboard Shortcuts
|
||||
description: Keyboard shortcuts for Notesnook
|
||||
---
|
||||
|
||||
The following keyboard shortcuts will help you navigate Notesnook faster.
|
||||
|
||||
### General
|
||||
|
||||
| Description | Web | Windows/Linux | Mac |
|
||||
| --- | --- | --- | --- |
|
||||
| Search in notes list view if editor is not focused | Ctrl F | Ctrl F | ⌘ F |
|
||||
| Settings | Ctrl , | Ctrl , | ⌘ , |
|
||||
| Keyboard shortcuts | Ctrl / | Ctrl / | ⌘ / |
|
||||
| New note | - | Ctrl N | ⌘ N |
|
||||
|
||||
### Navigation
|
||||
|
||||
| Description | Web | Windows/Linux | Mac |
|
||||
| --- | --- | --- | --- |
|
||||
| Next tab | Ctrl Alt → / Ctrl Alt ⇧ → | Ctrl tab | ⌘ tab |
|
||||
| Previous tab | Ctrl Alt ← / Ctrl Alt ⇧ ← | Ctrl ⇧ tab | ⌘ ⇧ tab |
|
||||
| Command palette | Ctrl K | Ctrl K | ⌘ K |
|
||||
| Quick open | Ctrl P | Ctrl P | ⌘ P |
|
||||
| New tab | - | Ctrl T | ⌘ T |
|
||||
| Close active tab | - | Ctrl W | ⌘ W |
|
||||
| Close all tabs | - | Ctrl ⇧ W | ⌘ ⇧ W |
|
||||
|
||||
### Editor
|
||||
|
||||
| Description | Web | Windows/Linux | Mac |
|
||||
| --- | --- | --- | --- |
|
||||
| Add attachment | Ctrl ⇧ A | Ctrl ⇧ A | ⌘ ⇧ A |
|
||||
| Insert blockquote | Ctrl ⇧ B | Ctrl ⇧ B | ⌘ ⇧ B |
|
||||
| Toggle bold | Ctrl B | Ctrl B | ⌘ B |
|
||||
| Toggle bullet list | Ctrl ⇧ 8 | Ctrl ⇧ 8 | ⌘ ⇧ 8 |
|
||||
| Toggle check list | Ctrl ⇧ 9 | Ctrl ⇧ 9 | ⌘ ⇧ 9 |
|
||||
| Split list item | ↵ | ↵ | ↵ |
|
||||
| Lift list item | ⇧ Tab | ⇧ Tab | ⇧ Tab |
|
||||
| Sink list item | Ctrl ⇧ Down | Ctrl ⇧ Down | ⌘ ⇧ Down |
|
||||
| Toggle code | Ctrl E | Ctrl E | ⌘ E |
|
||||
| Toggle code block | Ctrl ⇧ C | Ctrl ⇧ C | ⌘ ⇧ C |
|
||||
| Insert date | Alt D | Alt D | ⌥ D |
|
||||
| Insert time | Alt T | Alt T | ⌥ T |
|
||||
| Insert date and time | Ctrl Alt D | Ctrl Alt D | ⌘ ⌥ D |
|
||||
| Insert date and time with timezone | Ctrl Alt Z | Ctrl Alt Z | ⌘ ⌥ Z |
|
||||
| Increase font size | Ctrl [ | Ctrl [ | ⌘ [ |
|
||||
| Decrease font size | Ctrl ] | Ctrl ] | ⌘ ] |
|
||||
| Insert paragraph | Ctrl ⇧ 0 | Ctrl ⇧ 0 | ⌘ ⇧ 0 |
|
||||
| Insert heading 1 | Ctrl Alt 1 | Ctrl Alt 1 | ⌘ ⌥ 1 |
|
||||
| Insert heading 2 | Ctrl Alt 2 | Ctrl Alt 2 | ⌘ ⌥ 2 |
|
||||
| Insert heading 3 | Ctrl Alt 3 | Ctrl Alt 3 | ⌘ ⌥ 3 |
|
||||
| Insert heading 4 | Ctrl Alt 4 | Ctrl Alt 4 | ⌘ ⌥ 4 |
|
||||
| Insert heading 5 | Ctrl Alt 5 | Ctrl Alt 5 | ⌘ ⌥ 5 |
|
||||
| Insert heading 6 | Ctrl Alt 6 | Ctrl Alt 6 | ⌘ ⌥ 6 |
|
||||
| Undo | Ctrl Z | Ctrl Z | ⌘ Z |
|
||||
| Redo | Ctrl ⇧ Z / Ctrl Y | Ctrl ⇧ Z / Ctrl Y | ⌘ ⇧ Z / ⌘ Y |
|
||||
| Add image | Ctrl ⇧ I | Ctrl ⇧ I | ⌘ ⇧ I |
|
||||
| Toggle italic | Ctrl I | Ctrl I | ⌘ I |
|
||||
| Remove formatting in selection | Ctrl \ | Ctrl \ | ⌘ \ |
|
||||
| Insert internal link | Ctrl ⇧ L | Ctrl ⇧ L | ⌘ ⇧ L |
|
||||
| Insert link | Ctrl ⇧ K | Ctrl ⇧ K | ⌘ ⇧ K |
|
||||
| Insert math block | Ctrl ⇧ M | Ctrl ⇧ M | ⌘ ⇧ M |
|
||||
| Toggle ordered list | Ctrl ⇧ 7 | Ctrl ⇧ 7 | ⌘ ⇧ 7 |
|
||||
| Toggle outline list | Ctrl ⇧ O | Ctrl ⇧ O | ⌘ ⇧ O |
|
||||
| Toggle outline list expand | Ctrl Space | Ctrl Space | ⌘ Space |
|
||||
| Open search | Ctrl F | Ctrl F | ⌘ F |
|
||||
| Toggle strike | Ctrl ⇧ S | Ctrl ⇧ S | ⌘ ⇧ S |
|
||||
| Toggle subscript | Ctrl , | Ctrl , | ⌘ , |
|
||||
| Toggle superscript | Ctrl . | Ctrl . | ⌘ . |
|
||||
| Toggle task list | Ctrl ⇧ T | Ctrl ⇧ T | ⌘ ⇧ T |
|
||||
| Text align center | Ctrl ⇧ E | Ctrl ⇧ E | ⌘ ⇧ E |
|
||||
| Text align justify | Ctrl ⇧ J | Ctrl ⇧ J | ⌘ ⇧ J |
|
||||
| Text align left | Ctrl ⇧ L | Ctrl ⇧ L | ⌘ ⇧ L |
|
||||
| Text align right | Ctrl ⇧ R | Ctrl ⇧ R | ⌘ ⇧ R |
|
||||
| Underline | Ctrl U | Ctrl U | ⌘ U |
|
||||
@@ -54,6 +54,7 @@ navigation:
|
||||
- path: deleting-your-account.md
|
||||
- path: app-lock.md
|
||||
- path: gift-cards.md
|
||||
- path: keyboard-shortcuts.md
|
||||
|
||||
- path: privacy-mode.md
|
||||
- path: web-clipper
|
||||
|
||||
49
docs/help/package-lock.json
generated
Normal file
49
docs/help/package-lock.json
generated
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"name": "@notesnook/docs-help",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@notesnook/docs-help",
|
||||
"version": "1.0.0",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"devDependencies": {
|
||||
"@notesnook/common": "file:../../packages/common"
|
||||
}
|
||||
},
|
||||
"../../../packages/common": {
|
||||
"extraneous": true
|
||||
},
|
||||
"../../packages/common": {
|
||||
"name": "@notesnook/common",
|
||||
"version": "2.1.3",
|
||||
"dev": true,
|
||||
"license": "GPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
"@notesnook/core": "file:../core",
|
||||
"@readme/data-urls": "^3.0.0",
|
||||
"dayjs": "1.11.13",
|
||||
"pathe": "^1.1.2",
|
||||
"timeago.js": "4.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@notesnook/core": "file:../core",
|
||||
"@types/react": "18.3.5",
|
||||
"react": "18.3.1",
|
||||
"vitest": "2.1.8"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=18",
|
||||
"timeago.js": "4.0.2"
|
||||
}
|
||||
},
|
||||
"../common": {
|
||||
"extraneous": true
|
||||
},
|
||||
"node_modules/@notesnook/common": {
|
||||
"resolved": "../../packages/common",
|
||||
"link": true
|
||||
}
|
||||
}
|
||||
}
|
||||
25
docs/help/package.json
Normal file
25
docs/help/package.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "@notesnook/docs-help",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"document-keyboard-shortcuts": "node scripts/document-keyboard-shortcuts.mjs"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/streetwriters/notesnook.git"
|
||||
},
|
||||
"keywords": [
|
||||
"notesnook",
|
||||
"docs",
|
||||
"help"
|
||||
],
|
||||
"author": "",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"bugs": {
|
||||
"url": "https://github.com/streetwriters/notesnook/issues"
|
||||
},
|
||||
"homepage": "https://github.com/streetwriters/notesnook#readme",
|
||||
"devDependencies": {
|
||||
"@notesnook/common": "file:../../packages/common"
|
||||
}
|
||||
}
|
||||
99
docs/help/scripts/document-keyboard-shortcuts.mjs
Normal file
99
docs/help/scripts/document-keyboard-shortcuts.mjs
Normal file
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
This file is part of the Notesnook project (https://notesnook.com/)
|
||||
|
||||
Copyright (C) 2023 Streetwriters (Private) Limited
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { writeFileSync } from "fs";
|
||||
import {
|
||||
getGroupedKeybindings,
|
||||
formatKey,
|
||||
macify,
|
||||
CATEGORIES
|
||||
} from "@notesnook/common";
|
||||
|
||||
console.log("Generating keyboard shortcuts documentation...");
|
||||
|
||||
const keyboardShortcutFilePath = "./contents/keyboard-shortcuts.md";
|
||||
|
||||
const frontmatter = `---
|
||||
title: Keyboard Shortcuts
|
||||
description: Keyboard shortcuts for Notesnook
|
||||
---
|
||||
`;
|
||||
|
||||
const content =
|
||||
"The following keyboard shortcuts will help you navigate Notesnook faster.";
|
||||
|
||||
const markdownTable = getGroupedTableKeybindingsMarkdown();
|
||||
|
||||
writeFileSync(
|
||||
keyboardShortcutFilePath,
|
||||
frontmatter + "\n" + content + "\n\n" + markdownTable,
|
||||
"utf-8"
|
||||
);
|
||||
|
||||
console.log("Keyboard shortcuts documentation updated successfully!");
|
||||
|
||||
/**
|
||||
* @returns markdown formatted table of keyboard shortcuts grouped by category.
|
||||
*/
|
||||
function getGroupedTableKeybindingsMarkdown() {
|
||||
const desktopKeybindings = getGroupedKeybindings(true, false);
|
||||
const webKeybindings = getGroupedKeybindings(false, false);
|
||||
|
||||
const header = `| Description | Web | Windows/Linux | Mac |
|
||||
| --- | --- | --- | --- |`;
|
||||
|
||||
return CATEGORIES.map((category) => {
|
||||
const webShortcuts =
|
||||
webKeybindings.find((g) => g.category === category)?.shortcuts || [];
|
||||
const desktopShortcuts =
|
||||
desktopKeybindings.find((g) => g.category === category)?.shortcuts || [];
|
||||
|
||||
const mergedShortcuts = {};
|
||||
|
||||
webShortcuts.forEach(({ description, keys }) => {
|
||||
if (!mergedShortcuts[description]) {
|
||||
mergedShortcuts[description] = {};
|
||||
}
|
||||
mergedShortcuts[description].web = keys;
|
||||
});
|
||||
desktopShortcuts.forEach(({ description, keys }) => {
|
||||
if (!mergedShortcuts[description]) {
|
||||
mergedShortcuts[description] = {};
|
||||
}
|
||||
mergedShortcuts[description].desktop = keys;
|
||||
});
|
||||
|
||||
const rows = Object.entries(mergedShortcuts)
|
||||
.map(([description, { web, desktop }]) => {
|
||||
const webKeys = web?.map((k) => formatKey(k)).join(" / ") || "-";
|
||||
const windowsLinuxKeys =
|
||||
desktop?.map((k) => formatKey(k)).join(" / ") || "-";
|
||||
const macKeys =
|
||||
desktop
|
||||
?.map(macify)
|
||||
.map((k) => formatKey(k, true))
|
||||
.join(" / ") || "-";
|
||||
|
||||
return `| ${description} | ${webKeys} | ${windowsLinuxKeys} | ${macKeys} |`;
|
||||
})
|
||||
.join("\n");
|
||||
|
||||
return `### ${category}\n\n${header}\n${rows}`;
|
||||
}).join("\n\n");
|
||||
}
|
||||
Reference in New Issue
Block a user