From 7bd41772abeb7967fd95f0392312652e09e0b155 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Tue, 19 Jul 2022 07:21:26 -0700 Subject: [PATCH] docs: fix lua syntax --- docs/config/lua/MuxPane/split.md | 2 +- docs/config/lua/SpawnCommand.md | 2 +- docs/config/lua/SshDomain.md | 6 +++++- docs/config/lua/TlsDomainClient.md | 4 ++++ docs/config/lua/TlsDomainServer.md | 4 ++++ docs/config/lua/WslDomain.md | 4 ++++ docs/config/lua/color/contrast_ratio.md | 4 ++-- docs/config/lua/color/linear_rgba.md | 2 +- docs/config/lua/color/square.md | 2 +- docs/config/lua/color/srgb_u8.md | 2 +- docs/config/lua/color/triad.md | 2 +- docs/config/lua/config/font_dirs.md | 2 +- docs/config/lua/config/term.md | 2 ++ docs/config/lua/mux-window/spawn_tab.md | 2 +- docs/config/lua/wezterm.mux/spawn_window.md | 2 +- docs/config/lua/wezterm/action.md | 2 +- 16 files changed, 31 insertions(+), 13 deletions(-) diff --git a/docs/config/lua/MuxPane/split.md b/docs/config/lua/MuxPane/split.md index b4f493491..c198816f7 100644 --- a/docs/config/lua/MuxPane/split.md +++ b/docs/config/lua/MuxPane/split.md @@ -40,7 +40,7 @@ Sets additional environment variables in the environment for this command invocation. ```lua -pane:split{set_environment_variables={"FOO"="BAR"}} +pane:split{set_environment_variables={FOO="BAR"}} ``` ### domain diff --git a/docs/config/lua/SpawnCommand.md b/docs/config/lua/SpawnCommand.md index c271329c8..c31b65287 100644 --- a/docs/config/lua/SpawnCommand.md +++ b/docs/config/lua/SpawnCommand.md @@ -7,7 +7,7 @@ It is a lua object with the following fields; all of the fields have reasonable defaults and can be omitted. ```lua -{ +wezterm.action.SpawnCommandInNewWindow{ -- An optional label. -- The label is only used for SpawnCommands that are listed in -- the `launch_menu` configuration section. diff --git a/docs/config/lua/SshDomain.md b/docs/config/lua/SshDomain.md index f8d110fba..2d035c906 100644 --- a/docs/config/lua/SshDomain.md +++ b/docs/config/lua/SshDomain.md @@ -6,7 +6,9 @@ The `SshDomain` struct specifies information about an individual It is a lua object with the following fields: ```lua -{ +return { + ssh_domains = { + { -- The name of this specific domain. Must be unique amongst -- all types of domain in the configuration file. name = "my.server", @@ -33,6 +35,8 @@ It is a lua object with the following fields: -- Primarily useful if it isn't installed in the $PATH -- that is configure for ssh. -- remote_wezterm_path = "/home/yourusername/bin/wezterm" + }, + }, } ``` diff --git a/docs/config/lua/TlsDomainClient.md b/docs/config/lua/TlsDomainClient.md index 37cc1e0f9..362ab05a1 100644 --- a/docs/config/lua/TlsDomainClient.md +++ b/docs/config/lua/TlsDomainClient.md @@ -6,6 +6,8 @@ to a [TLS Domain](../../multiplexing.md#tls-domains). It is a lua object with the following fields: ```lua +return { + tls_domains = { { -- The name of this specific domain. Must be unique amongst -- all types of domain in the configuration file. @@ -63,6 +65,8 @@ It is a lua object with the following fields: -- The path to the wezterm binary on the remote host -- remote_wezterm_path = "/home/myname/bin/wezterm" +}, + }, } ``` diff --git a/docs/config/lua/TlsDomainServer.md b/docs/config/lua/TlsDomainServer.md index 1d22733f1..5ced6f656 100644 --- a/docs/config/lua/TlsDomainServer.md +++ b/docs/config/lua/TlsDomainServer.md @@ -6,6 +6,8 @@ the server side of a [TLS Domain](../../multiplexing.md#tls-domains). It is a lua object with the following fields: ```lua +return { + tls_servers = { { -- The address:port combination on which the server will listen -- for client connections @@ -30,5 +32,7 @@ It is a lua object with the following fields: -- to the trust store. -- You can omit this if your tls_client is using bootstrap_via_ssh. -- pem_root_certs = { "/some/path/ca1.pem", "/some/path/ca2.pem" }, +}, + }, } ``` diff --git a/docs/config/lua/WslDomain.md b/docs/config/lua/WslDomain.md index 7a3447c81..da23991d9 100644 --- a/docs/config/lua/WslDomain.md +++ b/docs/config/lua/WslDomain.md @@ -18,6 +18,8 @@ output from `wsl -l -v` and assigns that as the value of the A `WslDomain` is a lua object with the following fields: ```lua +return { + wls_domains = { { -- The name of this specific domain. Must be unique amonst all types -- of domain in the configuration file. @@ -47,5 +49,7 @@ A `WslDomain` is a lua object with the following fields: -- specify it here -- default_prog = {"fish"} +}, + }, } ``` diff --git a/docs/config/lua/color/contrast_ratio.md b/docs/config/lua/color/contrast_ratio.md index bc39b0e4a..342c5431e 100644 --- a/docs/config/lua/color/contrast_ratio.md +++ b/docs/config/lua/color/contrast_ratio.md @@ -4,7 +4,7 @@ Computes the contrast ratio between the two colors. -```lua +``` > wezterm.color.parse("red"):contrast_ratio(wezterm.color.parse("yellow")) 1 > wezterm.color.parse("red"):contrast_ratio(wezterm.color.parse("navy")) @@ -18,7 +18,7 @@ A contrast ratio of 1 means no contrast. The maximum possible contrast ratio is 21: -```lua +``` > wezterm.color.parse("black"):contrast_ratio(wezterm.color.parse("white")) 21 ``` diff --git a/docs/config/lua/color/linear_rgba.md b/docs/config/lua/color/linear_rgba.md index 7cdd1bf9b..150505232 100644 --- a/docs/config/lua/color/linear_rgba.md +++ b/docs/config/lua/color/linear_rgba.md @@ -5,7 +5,7 @@ Returns a tuple of the colors converted to linear RGBA and expressed as floating point numbers in the range `0.0-1.0`: -```lua +``` > r, g, b, a = wezterm.color.parse("purple"):linear_rgba() > print(r, g, b, a) 07:32:17.734 INFO logging > lua: 0.2158605307340622 0 0.2158605307340622 1 diff --git a/docs/config/lua/color/square.md b/docs/config/lua/color/square.md index 4762d0e0e..acb357755 100644 --- a/docs/config/lua/color/square.md +++ b/docs/config/lua/color/square.md @@ -5,7 +5,7 @@ Returns the other three colors that form a square. The other colors are 90 degrees apart on the HSL color wheel. -```lua +``` local a, b, c = wezterm:color.parse("yellow"):square() ``` diff --git a/docs/config/lua/color/srgb_u8.md b/docs/config/lua/color/srgb_u8.md index a03fd46db..146cf9baf 100644 --- a/docs/config/lua/color/srgb_u8.md +++ b/docs/config/lua/color/srgb_u8.md @@ -5,7 +5,7 @@ Returns a tuple of the internal SRGBA colors expressed as unsigned 8-bit integers in the range 0-255: -```lua +``` > r, g, b, a = wezterm.color.parse("purple"):srgba_u8() > print(r, g, b, a) 07:30:20.045 INFO logging > lua: 128 0 128 255 diff --git a/docs/config/lua/color/triad.md b/docs/config/lua/color/triad.md index 2c6481a04..ab73d4bb4 100644 --- a/docs/config/lua/color/triad.md +++ b/docs/config/lua/color/triad.md @@ -6,7 +6,7 @@ Returns the other two colors that form a triad. The other colors are at +/- 120 degrees in the HSL color wheel. ```lua -local a, b = wezterm:color.parse("yellow"):triad() +local a, b = wezterm.color.parse("yellow"):triad() ``` diff --git a/docs/config/lua/config/font_dirs.md b/docs/config/lua/config/font_dirs.md index f209c5c35..c319420ba 100644 --- a/docs/config/lua/config/font_dirs.md +++ b/docs/config/lua/config/font_dirs.md @@ -28,7 +28,7 @@ then you can set: ```lua return { - font_locator = "ConfigDirsOnly"` + font_locator = "ConfigDirsOnly", } ``` diff --git a/docs/config/lua/config/term.md b/docs/config/lua/config/term.md index c167fc168..50538f178 100644 --- a/docs/config/lua/config/term.md +++ b/docs/config/lua/config/term.md @@ -29,9 +29,11 @@ If your package manager installed the terminfo data in a non-standard location, The following snippet works if you installed `wezterm.terminfo` with nix into your user profile. Update the path to `TERMINFO_DIRS` to match the location on your system. ```lua +return { set_environment_variables={ TERMINFO_DIRS='/home/user/.nix-profile/share/terminfo', WSLENV='TERMINFO_DIRS' }, term = "wezterm", +} ``` diff --git a/docs/config/lua/mux-window/spawn_tab.md b/docs/config/lua/mux-window/spawn_tab.md index c0d70cad2..ae0d8416e 100644 --- a/docs/config/lua/mux-window/spawn_tab.md +++ b/docs/config/lua/mux-window/spawn_tab.md @@ -40,7 +40,7 @@ Sets additional environment variables in the environment for this command invocation. ```lua -window:spawn_tab{set_environment_variables={"FOO"="BAR"}} +window:spawn_tab{set_environment_variables={FOO="BAR"}} ``` ### domain diff --git a/docs/config/lua/wezterm.mux/spawn_window.md b/docs/config/lua/wezterm.mux/spawn_window.md index 47a145b95..e6692463f 100644 --- a/docs/config/lua/wezterm.mux/spawn_window.md +++ b/docs/config/lua/wezterm.mux/spawn_window.md @@ -40,7 +40,7 @@ Sets additional environment variables in the environment for this command invocation. ```lua -wezterm.mux.spawn_window{set_environment_variables={"FOO"="BAR"}} +wezterm.mux.spawn_window{set_environment_variables={FOO="BAR"}} ``` ### domain diff --git a/docs/config/lua/wezterm/action.md b/docs/config/lua/wezterm/action.md index 4692833e7..91c0d9ce9 100644 --- a/docs/config/lua/wezterm/action.md +++ b/docs/config/lua/wezterm/action.md @@ -18,7 +18,7 @@ Indexing `wezterm.action` with a valid [KeyAssignment](../keyassignment/index.md) name will act as a constructor for that key assignment type. For example, the lua expression: -```lua +``` wezterm.action.QuickSelectArgs ```