From 5421d0c5d9b330141eaf11476283d0803a9faca4 Mon Sep 17 00:00:00 2001 From: sawka Date: Sun, 22 Sep 2024 13:08:55 -0700 Subject: [PATCH] replace sidebar, write keybindings --- docs/index.mdx | 6 +++++ docs/keybindings.mdx | 55 ++++++++++++++++++++++++++++++++++++++++++++ docusaurus.config.ts | 1 + sidebars.ts | 37 ++++++++++------------------- 4 files changed, 74 insertions(+), 25 deletions(-) create mode 100644 docs/keybindings.mdx diff --git a/docs/index.mdx b/docs/index.mdx index 92d1439..f3da958 100644 --- a/docs/index.mdx +++ b/docs/index.mdx @@ -1,5 +1,7 @@ --- sidebar_position: 1 +id: "index" +title: "Home" --- import Card from '@site/src/components/card.tsx'; @@ -10,6 +12,10 @@ import Card from '@site/src/components/card.tsx'; Wave is an open-source terminal that adds the ability to launch graphical widgets, controlled and integrated directly with the CLI. +References: + +* [Key Bindings](./keybindings) + ## Features diff --git a/docs/keybindings.mdx b/docs/keybindings.mdx new file mode 100644 index 0000000..43c3176 --- /dev/null +++ b/docs/keybindings.mdx @@ -0,0 +1,55 @@ +--- +sidebar_position: 2 +id: "keybindings" +title: "Key Bindings" +--- + +Here's the set of default keybindings available in Wave. It is split into sections. +Some keybindings are always active. Others are only active for certain types of blocks. + +Note that these are the MacOS keybindings (they use "Cmd"). For Windows and Linux +replace "Cmd" with "Alt" (note that "Ctrl" is "Ctrl" on both Mac, Windows, and Linux). + +## Global Keybindings + +| Key | Function | +|-----|----------| +| Cmd:t | Open a new tab | +| Cmd:n | Open a new terminal block (defaults to the same connection and working directory) | +| Cmd:w | Close the current block | +| Cmd:m | Magnify / Un-Magnify the current block | +| Cmd:g | Open the "connection" switcher | +| Cmd:i | Refocus the current block (useful if the block has lost input focus) | +| Ctrl:Shift | Show block numbers | +| Ctrl:Shift:[number] | Switch to block number | +| Ctrl:Shift:Arrows | Move left, right, up, down between blocks | +| Cmd:[number] | Switch to tab number | +| Cmd:[ | Switch tab left | +| Cmd:] | Siwtch tab right | +| Cmd:Shift:r | Refresh the UI | + +## File Preview Keybindings + +| Key | Function | +|-----|----------| +| [any character] | any regular character (e.g. "a", "b") will filter the file list | +| Escape | will clear the filter | +| Up/Down Arrow | change file selection up/down | +| Enter | Open the currently selected file/directory | +| Cmd:ArrowUp | move "up" a directory (parent directory) | +| Cmd:ArrowLeft | back, move to the previously selected file/directory | +| Cmd:ArrowRight | forward (opposite of back) | +| Cmd:o | Open a new file (accepts relative paths to the current directory) | +| Cmd:s | When file editor is open, save file | +| Cmd:e | For files that can be previewed or edited (markdown, CSVs), switches between preview and edit mode | +| Cmd:r | When file editor is open, revert changes | + +## Web Keybindings + +| Key | Function | +|-----|----------| +| Cmd:l | focus the URL input bar | +| Escape | when the URL input bar is focused, will focus the web content | +| Cmd:r | reload webpage | +| Cmd:ArrowLeft | back | +| Cmd:ArrowRight | forward | \ No newline at end of file diff --git a/docusaurus.config.ts b/docusaurus.config.ts index d0ca073..a5676c9 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -34,6 +34,7 @@ const config: Config = { { path: "docs", routeBasePath: "/", + sidebarPath: require.resolve("./sidebars.ts"), } as import("@docusaurus/plugin-content-docs").Options, ], "ideal-image", diff --git a/sidebars.ts b/sidebars.ts index cc30bdd..4bc9e1f 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -1,31 +1,18 @@ import type { SidebarsConfig } from "@docusaurus/plugin-content-docs"; -/** - * Creating a sidebar enables you to: - - create an ordered group of docs - - render a sidebar for each doc of that group - - provide next/previous navigation - - The sidebars can be generated from the filesystem, or explicitly defined here. - - Create as many sidebars as you want. - */ const sidebars: SidebarsConfig = { - // By default, Docusaurus generates a sidebar from the docs folder structure - tutorialSidebar: [{ type: "autogenerated", dirName: "." }], - - // But you can create a sidebar manually - /* - tutorialSidebar: [ - 'intro', - 'hello', - { - type: 'category', - label: 'Tutorial', - items: ['tutorial-basics/create-a-document'], - }, - ], - */ + mainSidebar: [ + { + type: "doc", + id: "index", + label: "Home", + }, + { + type: "doc", + id: "keybindings", + label: "Keybindings", + }, + ], }; export default sidebars;