https://github.com/wesleyel/keyle
This package provides a simple way to style keyboard shortcuts in your documentation.
https://github.com/wesleyel/keyle
typst typst-package
Last synced: 2 months ago
JSON representation
This package provides a simple way to style keyboard shortcuts in your documentation.
- Host: GitHub
- URL: https://github.com/wesleyel/keyle
- Owner: wesleyel
- License: mit
- Created: 2024-07-24T03:38:59.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-28T00:58:51.000Z (almost 2 years ago)
- Last Synced: 2024-11-12T07:36:59.906Z (over 1 year ago)
- Topics: typst, typst-package
- Language: Typst
- Homepage: https://typst.app/universe/package/keyle
- Size: 2.17 MB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# keyle
A simple way to style keyboard shortcuts in your documentation.
This package was inspired by [auth0/kbd](https://auth0.github.io/kbd/) and [dogezen/badgery](https://github.com/dogezen/badgery). Also thanks to [tweh/menukeys](https://github.com/tweh/menukeys) -- A LaTeX package for menu keys generation.
Document generating using [jneug/typst-mantys](https://github.com/jneug/typst-mantys).
Send them respect and love.
## Usage
Please see the [keyle.pdf](https://github.com/magicwenli/keyle/blob/main/doc/keyle.pdf) for more documentation.
`keyle` is imported using:
```typst
#import "@preview/keyle:0.2.0"
```
### Example
#### Custom Delimiter
```tpy
#let kbd = keyle.config()
#kbd("Ctrl", "Shift", "K", delim: "-")
```

#### Compact Mode
```tpy
#let kbd = keyle.config()
#kbd("Ctrl", "Shift", "K", compact: true)
```

#### Standard Theme
```tpy
#let kbd = keyle.config(theme: keyle.themes.standard)
#keyle.gen-examples(kbd)
```

#### Deep Blue Theme
```tpy
#let kbd = keyle.config(theme: keyle.themes.deep-blue)
#keyle.gen-examples(kbd)
```

#### Type Writer Theme
```tpy
#let kbd = keyle.config(theme: keyle.themes.type-writer)
#keyle.gen-examples(kbd)
```

#### Biolinum Theme
```tpy
#let kbd = keyle.config(theme: keyle.themes.biolinum, delim: keyle.biolinum-key.delim_plus)
#keyle.gen-examples(kbd)
```

#### Custom Theme
```tpy
// https://www.radix-ui.com/themes/playground#kbd
#let radix_kdb(content) = box(
rect(
inset: (x: 0.5em),
outset: (y:0.05em),
stroke: rgb("#1c2024") + 0.3pt,
radius: 0.35em,
fill: rgb("#fcfcfd"),
text(fill: black, font: (
"Roboto",
"Helvetica Neue",
), content),
),
)
#let kbd = keyle.config(theme: radix_kdb)
#keyle.gen-examples(kbd)
```

## License
MIT