Skip to content

Add cheatsheet developer docs #1718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/contributing/cheatsheet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Cheatsheet

The cheatsheet can be activated locally to show your custom cheatsheet by saying `"cursorless cheatsheet"`, or visited on the web at https://www.cursorless.org/cheatsheet, which will show the default spoken forms.

The implementation of the local version of the cheatsheet is split between the Talon side and the extension side.

## Adding a new spoken form

When you add a new scope type, action, modifier, etc, you'll need to ensure that it shows up both locally and on the website. It will usually automatically show up in the local cheatsheet. You can verify this by saying `"cursorless cheatsheet"` with your development version of `cursorless-talon` active in your Talon user directory, and inspecting the cheatsheet that appears. If it does not, you'll need to make fixes to [the Talon side of the cheatsheet](../../cursorless-talon/src/cheatsheet).

In either case, to get your changes to appear on the website, you need to update the defaults in [`defaults.json`](../../packages/cheatsheet/src/lib/sampleSpokenFormInfos/defaults.json). First make sure you have the `cursorless-talon-dev` user file set in your Talon home directory, as indicated in the [initial contributor setup instructions](CONTRIBUTING.md#initial-setup). Then you can say `"cursorless update cheatsheet"` to update the default spoken forms. Note that this will use your custom spoken forms, so you may need to do some manual cleanup.

## Running the cheatsheet in development mode

To verify that your changes will work on the web cheatsheet, or if you need to make changes to the cheatsheet itself, such as updating the legend, you can run the cheatsheet locally using by running the following command:

```
pnpm -F cursorless-org dev
```

and then adding `/cheatsheet` to the preview URL. Changes should show up in realtime as you develop.
Loading