---------------------------------------------------------------------- This is the API documentation for the gdtest_keys_shortcode library. ---------------------------------------------------------------------- ## Functions Utility functions render(template: str) -> str Render a template string. Parameters ---------- template The template to render. Returns ------- str Rendered output. transform(data: list) -> list Transform a data list. Parameters ---------- data Input data. Returns ------- list Transformed data. ---------------------------------------------------------------------- This is the User Guide documentation for the package. ---------------------------------------------------------------------- ### Single Keys The `{{< keys >}}` shortcode renders individual keyboard keys with styled key-cap appearance. ## Basic Keys Press {{< keys "Esc" >}} to cancel. Press {{< keys "Enter" >}} to confirm. Press {{< keys "Tab" >}} to move to the next field. Press {{< keys "Space" >}} to toggle. ## Modifier Keys The {{< keys "Ctrl" >}} key is used for shortcuts. Hold {{< keys "Shift" >}} to select a range. The {{< keys "Alt" >}} key triggers alternate actions. ## Letter and Number Keys Press {{< keys "A" >}} to select all (with Ctrl). Press {{< keys "F5" >}} to refresh. Press {{< keys "F1" >}} for help. ## Arrow Keys Use the arrow keys to navigate: {{< keys "Up" >}} {{< keys "Down" >}} {{< keys "Left" >}} {{< keys "Right" >}} ## Function Keys Function keys render with compact, x-height styling: {{< keys "F1" >}} {{< keys "F2" >}} {{< keys "F3" >}} {{< keys "F4" >}} {{< keys "F5" >}} {{< keys "F6" >}} {{< keys "F7" >}} {{< keys "F8" >}} {{< keys "F9" >}} {{< keys "F10" >}} {{< keys "F11" >}} {{< keys "F12" >}} ### Shortcut Combos Use `shortcut=` to render multi-key combinations automatically. ## Common Editor Shortcuts | Action | Shortcut | |--------|----------| | Copy | {{< keys shortcut="Ctrl+C" >}} | | Paste | {{< keys shortcut="Ctrl+V" >}} | | Undo | {{< keys shortcut="Ctrl+Z" >}} | | Save | {{< keys shortcut="Ctrl+S" >}} | | Find | {{< keys shortcut="Ctrl+F" >}} | ## VS Code Shortcuts Open the command palette with {{< keys shortcut="Ctrl+Shift+P" >}}. Toggle the terminal with {{< keys shortcut="Ctrl+Shift+`" >}}. Quick open a file with {{< keys shortcut="Ctrl+P" >}}. ## Manual Combos You can also build combos manually: {{< keys "Ctrl" >}}+{{< keys "Shift" >}}+{{< keys "P" >}} ### Platform-Aware Rendering The `platform=` parameter translates keys for macOS or Windows. ## macOS Rendering On macOS, modifier keys render as symbols: | Generic | macOS | |---------|-------| | Ctrl | {{< keys shortcut="Ctrl+C" platform="mac" >}} | | Cmd | {{< keys shortcut="Cmd+S" platform="mac" >}} | | Alt/Option | {{< keys shortcut="Alt+F" platform="mac" >}} | | Shift | {{< keys shortcut="Shift+A" platform="mac" >}} | Command palette on macOS: {{< keys shortcut="Cmd+Shift+P" platform="mac" >}} ## Windows Rendering On Windows, macOS-specific keys are translated: | macOS | Windows | |-------|--------| | Cmd+S | {{< keys shortcut="Cmd+S" platform="win" >}} | | Option+F | {{< keys shortcut="Option+F" platform="win" >}} | ## Default (No Platform) Without `platform=`, keys are rendered as-is: {{< keys shortcut="Ctrl+Shift+P" >}} ### Keys in Context Keyboard shortcuts work in many documentation contexts. ## {{< keys "F1" >}} Headings with Keys Keys can appear in section headings for quick reference. ## In Callouts :::{.callout-tip} ## Keyboard Shortcut Press {{< keys shortcut="Ctrl+Shift+P" >}} to open the command palette in VS Code. ::: :::{.callout-note} ## Navigation Use {{< keys "Tab" >}} and {{< keys shortcut="Shift+Tab" >}} to move between form fields. ::: ## In Lists Common shortcuts: - {{< keys shortcut="Ctrl+C" >}} — Copy - {{< keys shortcut="Ctrl+V" >}} — Paste - {{< keys shortcut="Ctrl+Z" >}} — Undo - {{< keys shortcut="Ctrl+Y" >}} — Redo ## In Blockquotes > Press {{< keys "Esc" >}} to close any dialog or cancel > the current operation. ## In Prose To save your work, press {{< keys shortcut="Ctrl+S" >}}. If you need to undo a mistake, reach for {{< keys shortcut="Ctrl+Z" >}}. For more advanced operations, open the command palette with {{< keys shortcut="Ctrl+Shift+P" >}}.