Add documentation on .cheat.md

This commit is contained in:
KITAGAWA Yasutaka 2025-03-20 17:46:50 +09:00
parent 6f1bbcf666
commit 9ddf9e9fd6
No known key found for this signature in database
GPG key ID: EF503E87E8731A87

View file

@ -11,7 +11,7 @@
### Syntax overview
Cheatsheets are described in `.cheat` files that look like this:
Cheatsheets are described in `.cheat` (or `.cheat.md`) files that look like this:
```sh
% git, code
@ -35,6 +35,19 @@ All the other non-empty lines are considered as executable commands.
Tip: if you are editing cheatsheets in Visual Studio Code, you could enable syntax highlighting
by installing [this extension](https://marketplace.visualstudio.com/items?itemName=yanivmo.navi-cheatsheet-language).
If you use `.cheat.md` as an extension of cheat files, you can place commands in code blocks fenced with triple backticks (```` ``` ````).
````sh
% git, code
# Change branch
```sh
git checkout <branch>
```
$ branch: git branch | awk '{print $NF}'
````
### Variables
The interface prompts for variable names inside brackets (eg `<branch>`).