From bf0747f4af72e305e1a16b4d5755e62a7bbb8917 Mon Sep 17 00:00:00 2001 From: Guennadi Maximov C Date: Thu, 19 Nov 2026 21:31:22 -0600 Subject: [PATCH] docs: fixed many small issues in Lua docs pages (#7124) * lua: fixed markdown lists not rendering correctly in webpage * unicode_version: fixed typo in markdown file * visual_bell: fixed typo in documentation * load_base16_scheme: added comma for redaction, etc. * truncate_right: corrected improper punctuation * mux: improved Lua snippet in `rename_workspace` * wezterm.color.save_scheme: improved docs * wezterm.plugin: improved every function's docs * visual_bell: added missing code enclosures --------- Signed-off-by: Guennadi Maximov C --- docs/config/lua/config/daemon_options.md | 1 + docs/config/lua/config/unicode_version.md | 2 +- docs/config/lua/config/visual_bell.md | 4 ++-- .../lua/wezterm.color/load_base16_scheme.md | 6 +++--- docs/config/lua/wezterm.color/save_scheme.md | 18 ++++++++++++------ .../config/lua/wezterm.mux/rename_workspace.md | 8 ++++---- docs/config/lua/wezterm.plugin/list.md | 4 ++-- docs/config/lua/wezterm.plugin/require.md | 6 ++++-- docs/config/lua/wezterm.plugin/update_all.md | 5 +++-- docs/config/lua/wezterm/on.md | 1 + docs/config/lua/wezterm/truncate_right.md | 2 +- 11 files changed, 34 insertions(+), 23 deletions(-) diff --git a/docs/config/lua/config/daemon_options.md b/docs/config/lua/config/daemon_options.md index ca5f316a0..e3c45f478 100644 --- a/docs/config/lua/config/daemon_options.md +++ b/docs/config/lua/config/daemon_options.md @@ -11,6 +11,7 @@ You should not normally need to configure this setting; the defaults should be sufficient in most cases. There are three fields supported: + * `pid_file` - specify the location of the pid and lock file. The default location is `$XDG_RUNTIME_DIR/wezterm/pid` on X11/Wayland systems, or `$HOME/.local/share/wezterm/pid` * `stdout` - specifies where a log of the stdout stream from the daemon will be placed. The default is `$XDG_RUNTIME_DIR/wezterm/stdout` on X11/Wayland systems, or `$HOME/.local/share/wezterm/stdout`. * `stderr` - specifies where a log of the stderr stream from the daemon will be placed. The default is `$XDG_RUNTIME_DIR/wezterm/stderr` on X11/Wayland systems, or `$HOME/.local/share/wezterm/stderr`. diff --git a/docs/config/lua/config/unicode_version.md b/docs/config/lua/config/unicode_version.md index f67d21f2e..f0882918e 100644 --- a/docs/config/lua/config/unicode_version.md +++ b/docs/config/lua/config/unicode_version.md @@ -17,7 +17,7 @@ For example, there were a number of unicode code points that had their width changed between Unicode version 8 and version 9. This wouldn't be an issue if all software was simultaneously aware of the change, but the reality is that there is a lot of older software out there, and that even if your local -system is fully up to date, you might connect to a remote system vis SSH +system is fully up to date, you might connect to a remote system via SSH that is running applications that use a different version of unicode than your local system. diff --git a/docs/config/lua/config/visual_bell.md b/docs/config/lua/config/visual_bell.md index fe70e57be..767861168 100644 --- a/docs/config/lua/config/visual_bell.md +++ b/docs/config/lua/config/visual_bell.md @@ -9,10 +9,10 @@ tags: When the BEL ascii sequence is sent to a pane, the bell is "rung" in that pane. -You may choose to configure the `visual_bell` option so show a visible representation of the bell event, +You may choose to configure the `visual_bell` option to show a visible representation of the bell event, by having the background color of the pane briefly change color. -There are four fields to the visual_bell config option: +There are four fields to the `visual_bell` config option: * `fade_in_duration_ms` - how long it should take for the bell color to fade in, in milliseconds. The default is 0. * `fade_out_duration_ms` - how long it should take for the bell color to fade out, in milliseconds. The default is 0. diff --git a/docs/config/lua/wezterm.color/load_base16_scheme.md b/docs/config/lua/wezterm.color/load_base16_scheme.md index 6c8565bce..86bda691b 100644 --- a/docs/config/lua/wezterm.color/load_base16_scheme.md +++ b/docs/config/lua/wezterm.color/load_base16_scheme.md @@ -2,18 +2,18 @@ {{since('20220807-113146-c2fee766')}} -Loads a yaml file in [base16](https://github.com/chriskempson/base16) format +Loads a YAML file in [base16](https://github.com/chriskempson/base16) format and returns it as a wezterm color scheme. Note that wezterm ships with the base16 color schemes that were referenced via [base16-schemes-source](https://github.com/chriskempson/base16-schemes-source) -when the release was prepared so this function is primarily useful if you want +when the release was prepared, so this function is primarily useful if you want to import a base16 color scheme that either isn't listed from the main list, or that was created after your version of wezterm was built. This function returns a tuple of the color definitions and the metadata. -For example, given a yaml file with these contents: +For example, given a YAML file with these contents: ```yaml scheme: "Cupcake" diff --git a/docs/config/lua/wezterm.color/save_scheme.md b/docs/config/lua/wezterm.color/save_scheme.md index b3f2c5c38..08716ab3e 100644 --- a/docs/config/lua/wezterm.color/save_scheme.md +++ b/docs/config/lua/wezterm.color/save_scheme.md @@ -3,8 +3,10 @@ {{since('20220807-113146-c2fee766')}} Saves a color scheme as a wezterm TOML file. + This is useful when sharing your custom color scheme with others. -While you could share the lua representation of the scheme, the + +While you could share the Lua representation of the scheme, the TOML file is recommended for sharing as it is purely declarative: no executable logic is present in the TOML color scheme which makes it safe to consume "random" schemes from the internet. @@ -12,9 +14,10 @@ it safe to consume "random" schemes from the internet. This example demonstrates importing a base16 scheme and exporting it as a wezterm scheme. -Given a yaml file with these contents: +Given a YAML file with these contents: ```yaml +# /tmp/cupcake.yaml scheme: "Cupcake" author: "Chris Kempson (http://chriskempson.com)" base00: "fbf1f2" @@ -37,14 +40,17 @@ base0F: "BAA58C" Then: -``` -> colors, metadata = wezterm.color.load_base16_scheme("/tmp/cupcake.yaml") -> wezterm.color.save_scheme(colors, metadata, "/tmp/cupcacke.toml") +```lua +local wezterm = require 'wezterm' +local colors, metadata = wezterm.color.load_base16_scheme("/tmp/cupcake.yaml") + +wezterm.color.save_scheme(colors, metadata, "/tmp/cupcacke.toml") ``` -produces a toml file with these contents: +produces a TOML file with these contents: ```toml +# /tmp/cupcacke.toml [colors] ansi = [ '#fbf1f2', diff --git a/docs/config/lua/wezterm.mux/rename_workspace.md b/docs/config/lua/wezterm.mux/rename_workspace.md index 30c5c96d9..98f27d74f 100644 --- a/docs/config/lua/wezterm.mux/rename_workspace.md +++ b/docs/config/lua/wezterm.mux/rename_workspace.md @@ -5,8 +5,8 @@ Renames the workspace *old* to *new*. ```lua -wezterm.mux.rename_workspace( - wezterm.mux.get_active_workspace(), - 'something different' -) +local wezterm = require 'wezterm' +local active = wezterm.mux.get_active_workspace() + +wezterm.mux.rename_workspace(active, 'something different') ``` diff --git a/docs/config/lua/wezterm.plugin/list.md b/docs/config/lua/wezterm.plugin/list.md index 0297f6e8e..6d8dabee4 100644 --- a/docs/config/lua/wezterm.plugin/list.md +++ b/docs/config/lua/wezterm.plugin/list.md @@ -1,8 +1,8 @@ -# list function +# `wezterm.plugin.list()` {{since('20230320-124340-559cb7b0')}} -Will return a table array listing all the plugin repos in the plugin directory +Will return a table array listing all the plugin repos in the plugin directory. Each entry has three fields: diff --git a/docs/config/lua/wezterm.plugin/require.md b/docs/config/lua/wezterm.plugin/require.md index 1f067b1bb..60b957291 100644 --- a/docs/config/lua/wezterm.plugin/require.md +++ b/docs/config/lua/wezterm.plugin/require.md @@ -1,4 +1,4 @@ -# Function require +# `wezterm.plugin.require(url)` {{since('20230320-124340-559cb7b0')}} @@ -7,11 +7,13 @@ exist and store it in the runtime dir under `plugins/NAME` where `NAME` is derived from the repo URL. Once cloned, the repo is NOT automatically updated when `require` is called again. -The function takes a single string parameter, the Git repo URL +The function takes a single string parameter, the Git repo URL. Only HTTP(S) or local filesystem repos are allowed for the git URL. ```lua +local wezterm = require 'wezterm' + local remote_plugin = wezterm.plugin.require 'https://github.com/owner/repo' local local_plugin = wezterm.plugin.require 'file:///Users/developer/projects/my.Plugin' diff --git a/docs/config/lua/wezterm.plugin/update_all.md b/docs/config/lua/wezterm.plugin/update_all.md index 6293f4c4e..8e1922e40 100644 --- a/docs/config/lua/wezterm.plugin/update_all.md +++ b/docs/config/lua/wezterm.plugin/update_all.md @@ -1,8 +1,9 @@ -# update_all function +# `wezterm.plugin.update_all()` {{since('20230320-124340-559cb7b0')}} -Attempt to fast-forward or `pull --rebase` each of the repos in the plugin directory. +Attempt to _fast-forward_ or run `gih pull --rebase` for each of the repos +in the plugin directory. !!! Note diff --git a/docs/config/lua/wezterm/on.md b/docs/config/lua/wezterm/on.md index 642db0081..cf31defce 100644 --- a/docs/config/lua/wezterm/on.md +++ b/docs/config/lua/wezterm/on.md @@ -20,6 +20,7 @@ is emitted, each of the registered callbacks is called in the order that they were registered. The callback will receive the following parameters: + - a [`window` object](../window/index.md) that represents the active gui window. - a [`pane` object](../pane/index.md) that represents the active pane. diff --git a/docs/config/lua/wezterm/truncate_right.md b/docs/config/lua/wezterm/truncate_right.md index 5e886f3da..e5c85bf99 100644 --- a/docs/config/lua/wezterm/truncate_right.md +++ b/docs/config/lua/wezterm/truncate_right.md @@ -14,6 +14,6 @@ Returns a copy of `string` that is no longer than `max_width` columns Truncation occurs by reemoving excess characters from the right end of the string. -For example, `wezterm.truncate_right("hello", 3)` returns `"hel"`, +For example, `wezterm.truncate_right("hello", 3)` returns `"hel"`. See also: [wezterm.truncate_left](truncate_left.md), [wezterm.pad_left](pad_left.md).