Universe

Documentation MIT License

A simple way to style keyboard shortcuts in your documentation.

This package was inspired by auth0/kbd and dogezen/badgery. Also thanks to tweh/menukeys – A LaTeX package for menu keys generation.

Document generating using jneug/typst-mantys.

Send them respect and love.

Usage

Please see the keyle.pdf for more documentation.

keyle is imported using:

#import "@preview/keyle:0.2.0"

Example

Custom Delimiter

#let kbd = keyle.config()
#kbd("Ctrl", "Shift", "K", delim: "-")

Custom Delimiter

Compact Mode

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

Compact Mode

Standard Theme

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

Standard Theme

Deep Blue Theme

#let kbd = keyle.config(theme: keyle.themes.deep-blue)
#keyle.gen-examples(kbd)

Deep Blue Theme

Type Writer Theme

#let kbd = keyle.config(theme: keyle.themes.type-writer)
#keyle.gen-examples(kbd)

Type Writer Theme

Biolinum Theme

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

Biolinum Theme

Custom Theme

// 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)

Custom Theme

License

MIT