mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
This PR adds a mdbook preprocessor for supporting Zed's docs.
This initial version adds the following custom commands:
**Keybinding**
`{#kb prefix::action_name}` (e.g. `{#kb zed::OpenSettings}`)
Outputs a keybinding template like `<kbd
class="keybinding">{macos_keybinding}|{linux_keybinding}</kbd>`. This
template is processed on the client side through `mdbook` to show the
correct keybinding for the user's platform.
**Action**
`{#action prefix::action_name}` (e.g. `{#action zed::OpenSettings}`)
For now, simply outputs the action name in a readable manner. (e.g.
zed::OpenSettings -> zed: open settings)
In the future we'll add additional modes for this template, like create
a standard way to render `{action} ({keybinding})`.
## Example Usage
```
To open the assistant panel, toggle the right dock by using the {#action workspace::ToggleRightDock} action in the command palette or by using the
{#kb workspace::ToggleRightDock} shortcut.
```
Release Notes:
- N/A
33 lines
1.1 KiB
TOML
33 lines
1.1 KiB
TOML
[book]
|
|
authors = ["The Zed Team"]
|
|
language = "en"
|
|
multilingual = false
|
|
src = "src"
|
|
title = "Zed"
|
|
site-url = "/docs/"
|
|
|
|
[output.html]
|
|
no-section-label = true
|
|
preferred-dark-theme = "light"
|
|
additional-css = ["theme/page-toc.css", "theme/plugins.css"]
|
|
additional-js = ["theme/page-toc.js", "theme/plugins.js"]
|
|
|
|
[output.html.print]
|
|
enable = false
|
|
|
|
[output.html.redirect]
|
|
"/elixir.html" = "/docs/languages/elixir.html"
|
|
"/javascript.html" = "/docs/languages/javascript.html"
|
|
"/ruby.html" = "/docs/languages/ruby.html"
|
|
"/python.html" = "/docs/languages/python.html"
|
|
"/adding-new-languages.html" = "/docs/extensions/languages.html"
|
|
"/language-model-integration.html" = "/docs/assistant/assistant.html"
|
|
"/assistant.html" = "/docs/assistant/assistant.html"
|
|
|
|
# Our custom preprocessor for expanding commands like `{#kb action::ActionName}`,
|
|
# and other docs-related functions.
|
|
#
|
|
# Comment the below section out if you need to bypass the preprocessor for some reason.
|
|
[preprocessor.zed_docs_preprocessor]
|
|
command = "cargo run --manifest-path=../crates/docs_preprocessor/Cargo.toml --"
|
|
renderer = ["html"]
|