diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 6b763aec8..6a4d97d62 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -10,7 +10,6 @@ on: - "ci/generate-docs.py" - "ci/subst-release-info.py" - ".github/workflows/pages.yml" - - ".github/ISSUE_TEMPLATE/*" schedule: - cron: "50 * * * *" @@ -43,40 +42,33 @@ jobs: components: "rustfmt" env: ACTIONS_ALLOW_UNSECURE_COMMANDS: "true" - - uses: actions/cache@v3 - name: Cache mdbook - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - key: ${{ runner.os }}-cargo-mdbook-${{ hashFiles('.github/workflows/pages.yml') }} - - name: Install mdBook - run: | - (test -x ~/.cargo/bin/mdbook || (cd && cargo install mdbook --no-default-features --features search --vers "^0.4" --locked)) - - name: Install mdBook linkcheck - run: | - (test -x ~/.cargo/bin/mdbook-linkcheck || (cd && cargo install mdbook-linkcheck --locked)) - - name: Install mdBook mermaid - run: | - (test -x ~/.cargo/bin/mdbook-mermaid || (cd && cargo install mdbook-mermaid --locked)) - - name: Install mdBook admonish - run: | - (test -x ~/.cargo/bin/mdbook-admonish || (cd && cargo install mdbook-admonish --locked)) - name: Install gelatyx - run: | - (test -x ~/.cargo/bin/gelatyx || (cd && cargo install gelatyx --version "^0.2" --locked)) + uses: baptiste0928/cargo-install@v1 + with: + crate: gelatyx + args: --locked + - name: Install mdbook-linkcheck + uses: baptiste0928/cargo-install@v1 + with: + crate: mdbook-linkcheck + args: --locked + - uses: actions/setup-python@v4 + with: + python-version: 3.x + - uses: actions/cache@v2 + with: + key: ${{ github.ref }} + path: .cache - name: Build env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | source $HOME/.cargo/env - ./ci/build-docs.sh + CARDS=true ./ci/build-docs.sh - name: Upload artifact uses: actions/upload-pages-artifact@v1 with: - path: gh_pages/html + path: gh_pages deploy: environment: diff --git a/.gitignore b/.gitignore index e9bc34cd2..e8d5b424f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,10 @@ .DS_Store dhat-heap.json /docs/_site +/docs/favicon.png +/docs/favicon.svg +/docs/fonts/* +/mkdocs.yml /PKGBUILD /WezTerm*.zip /WezTerm*.exe @@ -16,6 +20,8 @@ dhat-heap.json /docs/cli/cli/index.md /docs/recipes/index.md /docs/colorschemes/**/index.md +/docs/colorschemes/scheme.css +/docs/colorschemes/scheme.js /docs/config/lua/color/index.md /docs/config/lua/config/index.md /docs/config/lua/gui-events/index.md diff --git a/ci/build-docs.sh b/ci/build-docs.sh index fc7f7664b..2c80e33bf 100755 --- a/ci/build-docs.sh +++ b/ci/build-docs.sh @@ -32,10 +32,24 @@ function ghapi() { [[ -f /tmp/wezterm.nightly.json ]] || ghapi /repos/wez/wezterm/releases/tags/nightly > /tmp/wezterm.nightly.json python3 ci/subst-release-info.py || exit 1 python3 ci/generate-docs.py || exit 1 -mdbook-mermaid install docs -mdbook build docs -rm gh_pages/html/README.markdown -cp assets/fonts/Symbols-Nerd-Font-Mono.ttf gh_pages/html/fonts/ -cp assets/icon/terminal.png gh_pages/html/favicon.png -cp "assets/icon/wezterm-icon.svg" gh_pages/html/favicon.svg +mdbook-linkcheck --standalone docs + +# Adjust path to pick up pip-installed binaries +PATH="$HOME/.local/bin;$PATH" +pip install --quiet mkdocs-material mkdocs-git-revision-date-localized-plugin black mkdocs-exclude mkdocs-include-markdown-plugin +if test -n "${CARDS}" ; then + pip install --quiet pillow cairosvg +fi + +black ci/generate-docs.py ci/subst-release-info.py + +cp "assets/icon/terminal.png" docs/favicon.png +cp "assets/icon/wezterm-icon.svg" docs/favicon.svg +mkdir docs/fonts +cp assets/fonts/Symbols-Nerd-Font-Mono.ttf docs/fonts/ + +mkdocs build + +# mdbook-mermaid install docs +# mdbook build docs diff --git a/ci/generate-docs.py b/ci/generate-docs.py index 23d6f2b70..b84eb1033 100644 --- a/ci/generate-docs.py +++ b/ci/generate-docs.py @@ -14,12 +14,24 @@ class Page(object): self.filename = filename self.children = children or [] - def render(self, output, depth=0): + def render(self, output, depth=0, mode="mdbook"): indent = " " * depth bullet = "- " if depth > 0 else "" - output.write(f"{indent}{bullet}[{self.title}]({self.filename})\n") + if mode == "mdbook": + if self.filename: + output.write(f"{indent}{bullet}[{self.title}]({self.filename})\n") + elif mode == "mkdocs": + if depth > 0: + if len(self.children) == 0: + output.write(f'{indent}{bullet}"{self.title}": {self.filename}\n') + else: + output.write(f'{indent}{bullet}"{self.title}":\n') + if self.filename: + output.write( + f'{indent} {bullet}"{self.title}": {self.filename}\n' + ) for kid in self.children: - kid.render(output, depth + 1) + kid.render(output, depth + 1, mode) # autogenerate an index page from the contents of a directory @@ -30,8 +42,7 @@ class Gen(object): self.index = index self.extract_title = extract_title - def render(self, output, depth=0): - print(self.dirname) + def render(self, output, depth=0, mode="mdbook"): names = sorted(glob.glob(f"{self.dirname}/*.md")) children = [] for filename in names: @@ -41,13 +52,13 @@ class Gen(object): if self.extract_title: with open(filename, "r") as f: - title = f.readline().strip('#').strip() + title = f.readline().strip("#").strip() children.append(Page(title, filename)) index_filename = f"{self.dirname}/index.md" index_page = Page(self.title, index_filename, children=children) - index_page.render(output, depth) + index_page.render(output, depth, mode) with open(f"{self.dirname}/index.md", "w") as idx: if self.index: idx.write(self.index) @@ -187,7 +198,7 @@ class GenColorScheme(object): self.dirname = dirname self.index = index - def render(self, output, depth=0): + def render(self, output, depth=0, mode="mdbook"): with open("colorschemes/data.json") as f: scheme_data = json.load(f) by_prefix = {} @@ -209,6 +220,34 @@ class GenColorScheme(object): else: return None + style_filename = f"{self.dirname}/scheme.css" + with open(style_filename, "w") as style_file: + for scheme in by_name.values(): + style_file.write(scheme["css"]) + style_file.write("\n") + js_filename = f"{self.dirname}/scheme.js" + with open(js_filename, "w") as js_file: + data_by_scheme = {} + for scheme in by_name.values(): + ident = scheme["ident"] + data = screen_shot_table(scheme) + data_by_scheme[ident] = data + + js_file.write(f"SCHEME_DATA = {json.dumps(data_by_scheme)};\n") + js_file.write( + f""" +function load_scheme_player(ident) {{ + var data = SCHEME_DATA[ident]; + AsciinemaPlayer.create( + 'data:text/plain;base64,' + data, + document.getElementById(ident + '-player'), {{ + theme: ident, + autoPlay: true, + }}); +}} +""" + ) + children = [] for scheme_prefix in sorted(by_prefix.keys()): scheme_filename = f"{self.dirname}/{scheme_prefix}/index.md" @@ -216,6 +255,7 @@ class GenColorScheme(object): children.append(Page(scheme_prefix, scheme_filename)) with open(scheme_filename, "w") as idx: + idents_to_load = [] for scheme in by_prefix[scheme_prefix]: title = scheme["name"] @@ -223,26 +263,11 @@ class GenColorScheme(object): data = screen_shot_table(scheme) ident = scheme["ident"] + idents_to_load.append(ident) idx.write( f"""
- - - - """ ) @@ -267,13 +292,16 @@ window.addEventListener('load', function () {{ if alias_link: alias_list.append(f"[{a}]({alias_link})") else: - alias_list.append(f"`{a}` (but that name isn't used here)") - aliases = ', '.join(alias_list) + alias_list.append( + f"`{a}` (but that name isn't used here)" + ) + aliases = ", ".join(alias_list) idx.write(f"This scheme is also known as {aliases}.
+
*since: 20201031-154415-9614e117*
@@ -505,7 +505,7 @@ behavior and more, take a look at the more power
*Since: 20210814-124438-54e29167*
-
+
See [window_background_gradient](lua/config/window_background_gradient.md)
for configuration information on gradients.
diff --git a/docs/config/launch.md b/docs/config/launch.md
index 7d7f85515..407c10de5 100644
--- a/docs/config/launch.md
+++ b/docs/config/launch.md
@@ -168,7 +168,7 @@ return {
}
```
-
+
Here's a fancy example that will add some helpful entries to the launcher
menu when running on Windows:
diff --git a/docs/config/lua/config/color_schemes.md b/docs/config/lua/config/color_schemes.md
index d2802c07b..b75456b2b 100644
--- a/docs/config/lua/config/color_schemes.md
+++ b/docs/config/lua/config/color_schemes.md
@@ -2,4 +2,4 @@
Specifies various named color schemes in your configuration file.
-Described in more detail in [Colors & Appearance](../../appearance.html#defining-a-color-scheme-in-your-weztermlua)
+Described in more detail in [Colors & Appearance](../../appearance.md#defining-a-color-scheme-in-your-weztermlua)
diff --git a/docs/config/lua/config/default_prog.md b/docs/config/lua/config/default_prog.md
index 8ecad4762..2336122b0 100644
--- a/docs/config/lua/config/default_prog.md
+++ b/docs/config/lua/config/default_prog.md
@@ -16,4 +16,4 @@ return {
is the command to run and the rest of the elements are passed
as the positional arguments to that command.
-See also: [Launching Programs](../../launch.html)
+See also: [Launching Programs](../../launch.md)
diff --git a/docs/config/lua/config/foreground_text_hsb.md b/docs/config/lua/config/foreground_text_hsb.md
index 37d986931..2fdf6bc3e 100644
--- a/docs/config/lua/config/foreground_text_hsb.md
+++ b/docs/config/lua/config/foreground_text_hsb.md
@@ -33,11 +33,7 @@ return {
}
```
-
-
-
-
+
+
+
+
diff --git a/docs/config/lua/config/harfbuzz_features.md b/docs/config/lua/config/harfbuzz_features.md
index 91870050e..01a0a4b8f 100644
--- a/docs/config/lua/config/harfbuzz_features.md
+++ b/docs/config/lua/config/harfbuzz_features.md
@@ -3,6 +3,6 @@
When `font_shaper = "Harfbuzz"`, this setting affects how font shaping
takes place.
-See [Font Shaping](../../font-shaping.html) for more information
+See [Font Shaping](../../font-shaping.md) for more information
and examples.
diff --git a/docs/config/lua/config/set_environment_variables.md b/docs/config/lua/config/set_environment_variables.md
index 65462698f..438671f51 100644
--- a/docs/config/lua/config/set_environment_variables.md
+++ b/docs/config/lua/config/set_environment_variables.md
@@ -7,4 +7,4 @@ running program on any Operating System.
This is not used when working with remote domains.
-See also: [Launching Programs](../../launch.html#passing-environment-variables-to-the-spawned-program)
+See also: [Launching Programs](../../launch.md#passing-environment-variables-to-the-spawned-program)
diff --git a/docs/config/lua/config/tab_bar_style.md b/docs/config/lua/config/tab_bar_style.md
index a7e8a0a89..6dec9b386 100644
--- a/docs/config/lua/config/tab_bar_style.md
+++ b/docs/config/lua/config/tab_bar_style.md
@@ -15,7 +15,7 @@ have been removed and replaced by the more flexible
*Since: 20210314-114017-04b7cedd*
This config option allows styling the elements that appear in the tab bar.
-This configuration supplements the [tab bar color](../../appearance.html#tab-bar-appearance--colors)
+This configuration supplements the [tab bar color](../../appearance.md#tab-bar-appearance--colors)
options.
Styling in this context refers to how the edges of the tabs and the new tab button are rendered.
@@ -35,8 +35,7 @@ The available elements are:
This example changes the tab edges to the PowerLine arrow symbols:
-
+
```lua
local wezterm = require 'wezterm'
diff --git a/docs/config/lua/config/unix_domains.md b/docs/config/lua/config/unix_domains.md
index ef4b52334..e29a5fef4 100644
--- a/docs/config/lua/config/unix_domains.md
+++ b/docs/config/lua/config/unix_domains.md
@@ -3,4 +3,4 @@
Defines a list of multiplexer domains for both the multiplexer
server and multiplexer client.
-[Read more about multiplexing](../../../multiplexing.html#unix-domains)
+[Read more about multiplexing](../../../multiplexing.md#unix-domains)
diff --git a/docs/config/lua/config/window_background_gradient.md b/docs/config/lua/config/window_background_gradient.md
index 057617e94..ec211cbaf 100644
--- a/docs/config/lua/config/window_background_gradient.md
+++ b/docs/config/lua/config/window_background_gradient.md
@@ -63,7 +63,7 @@ return {
}
```
-
+
Gradients are implemented using the `colorgrad` crate.
Take a look at
+
## Radial gradient:
@@ -131,7 +131,7 @@ return {
}
```
-
+
## Presets
diff --git a/docs/config/lua/keyassignment/ActivateCommandPalette.md b/docs/config/lua/keyassignment/ActivateCommandPalette.md
index 80f410fb1..edb2eae45 100644
--- a/docs/config/lua/keyassignment/ActivateCommandPalette.md
+++ b/docs/config/lua/keyassignment/ActivateCommandPalette.md
@@ -22,7 +22,7 @@ The command palette shows a list of possible actions ranked by
[frecency](https://en.wikipedia.org/wiki/Frecency) of use from the command
palette.
-
+
### Key Assignments
diff --git a/docs/config/lua/keyassignment/ActivateCopyMode.md b/docs/config/lua/keyassignment/ActivateCopyMode.md
index b5e132e73..314568bc3 100644
--- a/docs/config/lua/keyassignment/ActivateCopyMode.md
+++ b/docs/config/lua/keyassignment/ActivateCopyMode.md
@@ -12,5 +12,5 @@ return {
}
```
-[Learn more about copy mode](../../../copymode.html)
+[Learn more about copy mode](../../../copymode.md)
diff --git a/docs/config/lua/keyassignment/PaneSelect.md b/docs/config/lua/keyassignment/PaneSelect.md
index b732dce59..8820a0494 100644
--- a/docs/config/lua/keyassignment/PaneSelect.md
+++ b/docs/config/lua/keyassignment/PaneSelect.md
@@ -6,7 +6,7 @@ This action activates the pane selection modal display. In this mode, each pane
will be overlayed with a one- or two-character label taken from the selection
alphabet.
-
+
Typing the label will select the pane, take an action and exit selection mode.
Pressing `Escape` or `CTRL-g` will exit pane selection mode without taking any
diff --git a/docs/config/lua/keyassignment/Search.md b/docs/config/lua/keyassignment/Search.md
index 7c32ab921..51c81ab7a 100644
--- a/docs/config/lua/keyassignment/Search.md
+++ b/docs/config/lua/keyassignment/Search.md
@@ -41,7 +41,7 @@ return {
}
```
-[Learn more about the search overlay](../../../scrollback.html#searching-the-scrollback)
+[Learn more about the search overlay](../../../scrollback.md#searching-the-scrollback)
*since: 20220624-141144-bd1b7c5d*
diff --git a/docs/config/lua/wezterm/strftime_utc.md b/docs/config/lua/wezterm/strftime_utc.md
index 9ab11a509..6504bd106 100644
--- a/docs/config/lua/wezterm/strftime_utc.md
+++ b/docs/config/lua/wezterm/strftime_utc.md
@@ -12,4 +12,4 @@ local date_and_time = wezterm.strftime_utc '%Y-%m-%d %H:%M:%S'
wezterm.log_info(date_and_time)
```
-See also [strftime](strftime.md) and [wezterm.time](../wezterm.time/index.markdown).
+See also [strftime](strftime.md) and [wezterm.time](../wezterm.time/index.md).
diff --git a/docs/config/lua/window/set_right_status.md b/docs/config/lua/window/set_right_status.md
index 4e9d22ad3..1cab62d0a 100644
--- a/docs/config/lua/window/set_right_status.md
+++ b/docs/config/lua/window/set_right_status.md
@@ -14,8 +14,7 @@ the string.
Here's a basic example that displays the time in the status area:
-
+
```lua
local wezterm = require 'wezterm'
@@ -38,10 +37,9 @@ Here's a rather more elaborate example that employs the popular PowerLine glyphs
to show a visually appealing status area. It also extracts the current
working directory and hostname from the current pane. That way
it can potentially pick up the remote hostname if your remote shell session is using
-[OSC 7 shell integration](../../../shell-integration.html#osc-7-escape-sequence-to-set-the-working-directory).
+[OSC 7 shell integration](../../../shell-integration.md#osc-7-escape-sequence-to-set-the-working-directory).
-
+
```lua
wezterm.on('update-right-status', function(window, pane)
diff --git a/docs/contributing.md b/docs/contributing.md
index aff3dbb8c..c54b3a2f5 100644
--- a/docs/contributing.md
+++ b/docs/contributing.md
@@ -7,8 +7,8 @@ If you're thinking of helping out, then the following resources may be helpful:
* [WezTerm on GitHub](https://github.com/wez/wezterm)
* [GitHub Discussions](https://github.com/wez/wezterm/discussions)
-* [Realtime conversation with wez on Element.io/Gitter](help.html)
-* [Building from Source](install/source.html)
+* [Realtime conversation with wez on Element.io/Gitter](help.md)
+* [Building from Source](install/source.md)
* [Where to find things and hacking on wezterm](https://github.com/wez/wezterm/blob/master/CONTRIBUTING.md#contributing-to-wezterm)
I like to think that I have an open mind and I try to be open to ideas,
diff --git a/docs/copymode.md b/docs/copymode.md
index d7c46d7b3..734043921 100644
--- a/docs/copymode.md
+++ b/docs/copymode.md
@@ -96,4 +96,4 @@ may be more recent than your version of wezterm) is shown below.
You can see the configuration in your version of wezterm by running
`wezterm show-keys --lua --key-table copy_mode`.
-{{#include examples/default-copy-mode-key-table.markdown}}
+{% include "examples/default-copy-mode-key-table.markdown" %}
diff --git a/docs/escape-sequences.md b/docs/escape-sequences.md
index 8eb7024e8..bf2b721ff 100644
--- a/docs/escape-sequences.md
+++ b/docs/escape-sequences.md
@@ -41,7 +41,7 @@ applied to the terminal display using the following rules:
* The cursor position will be updated based on the column width of the grapheme.
After the graphemes are applied to the terminal display, the rendering portion of
-WezTerm will attempt to apply your [font shaping](config/font-shaping.html) configuration
+WezTerm will attempt to apply your [font shaping](config/font-shaping.md) configuration
based on runs of graphemes with matching graphic attributes to determine which glyphs
should be rendered from your fonts; it is at this stage that emoji and ligatures are
resolved.
@@ -390,17 +390,17 @@ The table below is keyed by the OSC code.
|4 |Change/Query Color Number | Set or query color palette entries 0-255. | query color number 1: `\x1b]4;1;?\x1b\\`
+
**Note that the image protocol isn't fully handled by multiplexer sessions
diff --git a/docs/index.md b/docs/index.md
index 7e7f58cef..7b4b79465 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -1,22 +1,22 @@
+
*Screenshot of wezterm on macOS, running vim*
diff --git a/docs/install/linux.markdown b/docs/install/linux.markdown
index 59d62e500..bb6dc1239 100644
--- a/docs/install/linux.markdown
+++ b/docs/install/linux.markdown
@@ -11,20 +11,20 @@ To install using the command line:
First, [setup flatpak on your system](https://flatpak.org/setup/), then:
-```bash
-flatpak install flathub org.wezfurlong.wezterm
+```console
+$ flatpak install flathub org.wezfurlong.wezterm
```
and then run:
-```bash
-flatpak run org.wezfurlong.wezterm
+```console
+$ flatpak run org.wezfurlong.wezterm
```
You may wish to define an alias for convenience:
-```bash
-alias wezterm='flatpak run org.wezfurlong.wezterm'
+```console
+$ alias wezterm='flatpak run org.wezfurlong.wezterm'
```
Note: flatpaks run in a sandbox so some functionality may behave a little
@@ -46,30 +46,30 @@ range of Linux distributions.
Download and make the file executable and you're ready to run!
-AppImage
-Nightly AppImage
+[AppImage :material-tray-arrow-down:]({{ ubuntu18_AppImage_stable }}){ .md-button }
+[Nightly AppImage :material-tray-arrow-down:]({{ ubuntu18_AppImage_nightly }}){ .md-button }
-```bash
-curl -LO {{ ubuntu18_AppImage_stable }}
-chmod +x {{ ubuntu18_AppImage_stable_asset }}
+```console
+$ curl -LO {{ ubuntu18_AppImage_stable }}
+$ chmod +x {{ ubuntu18_AppImage_stable_asset }}
```
You may then execute the appimage directly to launch wezterm, with no
specific installation steps required:
-```bash
-./{{ ubuntu18_AppImage_stable_asset }}
+```console
+$ ./{{ ubuntu18_AppImage_stable_asset }}
```
That said, you may wish to make it a bit more convenient:
-```bash
-mkdir ~/bin
-mv ./{{ ubuntu18_AppImage_stable_asset }} ~/bin/wezterm
-~/bin/wezterm
+```console
+$ mkdir ~/bin
+$ mv ./{{ ubuntu18_AppImage_stable_asset }} ~/bin/wezterm
+$ ~/bin/wezterm
```
-* Configuration instructions can be [found here](../config/files.html)
+* Configuration instructions can be [found here](../config/files.md)
## Installing on Ubuntu and Debian-based Systems
@@ -90,13 +90,13 @@ you can try the AppImage download which should work on most Linux systems.
To download and install from the CLI, you can use something like this, which
shows how to install the Ubuntu 20 package:
-```bash
-curl -LO {{ ubuntu20_deb_stable }}
-sudo apt install -y ./{{ ubuntu20_deb_stable_asset }}
+```console
+$ curl -LO {{ ubuntu20_deb_stable }}
+$ sudo apt install -y ./{{ ubuntu20_deb_stable_asset }}
```
* The package installs `/usr/bin/wezterm` and `/usr/share/applications/org.wezfurlong.wezterm.desktop`
-* Configuration instructions can be [found here](../config/files.html)
+* Configuration instructions can be [found here](../config/files.md)
## Installing on Fedora and rpm-based Systems
@@ -121,22 +121,22 @@ on most Linux systems.
To download and install from the CLI you can use something like this, which
shows how to install the Fedora 35 package:
-```bash
-sudo dnf install -y {{ fedora35_rpm_stable }}
+```console
+$ sudo dnf install -y {{ fedora35_rpm_stable }}
```
WezTerm is also available in the official Factory repo in openSUSE Tumbleweed. To install from Factory instead
from the rpm provided by WezTerm's Github repository, you can use Yast. If you prefer the CLI, you can install
it as root user with
-```bash
-zypper addrepo https://download.opensuse.org/repositories/openSUSE:Factory/standard/openSUSE:Factory.repo
-zypper refresh
-zypper install wezterm
+```console
+$ zypper addrepo https://download.opensuse.org/repositories/openSUSE:Factory/standard/openSUSE:Factory.repo
+$ zypper refresh
+$ zypper install wezterm
```
* The package installs `/usr/bin/wezterm` and `/usr/share/applications/org.wezfurlong.wezterm.desktop`
-* Configuration instructions can be [found here](../config/files.html)
+* Configuration instructions can be [found here](../config/files.md)
## Arch Linux
@@ -165,21 +165,21 @@ APKs are built out from the `main` branch.
If you are a [Linuxbrew](https://docs.brew.sh/Homebrew-on-Linux) user, you can install
wezterm from our tap:
-```bash
+```console
$ brew tap wez/wezterm-linuxbrew
$ brew install wezterm
```
If you'd like to use a nightly build you can perform a head install:
-```bash
+```console
$ brew install --HEAD wezterm
```
to upgrade to a newer nightly, it is simplest to remove then
install:
-```bash
+```console
$ brew rm wezterm
$ brew install --HEAD wezterm
```
@@ -189,7 +189,7 @@ $ brew install --HEAD wezterm
Another option for linux is a raw binary archive. These are the same binaries that
are built for Ubuntu but provided in a tarball.
-Download raw Linux binaries
-Nightly raw Linux binaries
+[Raw Linux Binary :material-tray-arrow-down:]({{ linux_raw_bin_stable }}){ .md-button }
+[Nightly Raw Linux Binary :material-tray-arrow-down:]({{ linux_raw_bin_nightly }}){ .md-button }
diff --git a/docs/install/macos.markdown b/docs/install/macos.markdown
index cd026d392..3b2e5e1f5 100644
--- a/docs/install/macos.markdown
+++ b/docs/install/macos.markdown
@@ -7,8 +7,9 @@ been tested.
Starting with version 20210203-095643-70a364eb, WezTerm is a Universal binary
with support for both Apple Silicon and Intel hardware.
-Download for macOS
-Nightly for macOS
+[:simple-apple: Download for macOS :material-tray-arrow-down:]({{ macos_zip_stable }}){ .md-button }
+[:simple-apple: Nightly for macOS :material-tray-arrow-down:]({{ macos_zip_nightly }}){ .md-button }
+
1. Download Release
2. Extract the zipfile and drag the `WezTerm.app` bundle to your `Applications` folder
3. First time around, you may need to right click and select `Open` to allow launching
@@ -19,26 +20,26 @@ with support for both Apple Silicon and Intel hardware.
PATH="$PATH:/Applications/WezTerm.app/Contents/MacOS"
export PATH
```
-5. Configuration instructions can be [found here](../config/files.html)
+5. Configuration instructions can be [found here](../config/files.md)
## Homebrew
WezTerm is available for [brew](https://brew.sh/) users in a tap:
-```bash
+```console
$ brew tap wez/wezterm
$ brew install --cask wez/wezterm/wezterm
```
If you'd like to use a nightly build:
-```bash
+```console
$ brew install --cask wez/wezterm/wezterm-nightly
```
to upgrade to a newer nightly (normal `brew upgrade` will not upgrade it!):
-```bash
+```console
$ brew upgrade --cask wez/wezterm/wezterm-nightly --no-quarantine --greedy-latest
```
@@ -46,7 +47,7 @@ $ brew upgrade --cask wez/wezterm/wezterm-nightly --no-quarantine --greedy-lates
WezTerm is also available via [MacPorts](https://ports.macports.org/port/wezterm/summary):
-```bash
+```console
$ sudo port selfupdate
$ sudo port install wezterm
```
diff --git a/docs/install/source.markdown b/docs/install/source.markdown
index 3f217c0dc..68a7c8294 100644
--- a/docs/install/source.markdown
+++ b/docs/install/source.markdown
@@ -17,26 +17,26 @@ attempt to install them for you. If it doesn't know about your system,
If you don't plan to submit a pull request to the wezterm repo, you can
download a smaller source tarball using these steps:
-```bash
-curl https://sh.rustup.rs -sSf | sh -s
-curl -LO {{ src_stable }}
-tar -xzf {{ src_stable_asset }}
-cd {{ src_stable_dir }}
-./get-deps
-cargo build --release
-cargo run --release --bin wezterm -- start
+```console
+$ curl https://sh.rustup.rs -sSf | sh -s
+$ curl -LO {{ src_stable }}
+$ tar -xzf {{ src_stable_asset }}
+$ cd {{ src_stable_dir }}
+$ ./get-deps
+$ cargo build --release
+$ cargo run --release --bin wezterm -- start
```
Alternatively, use the full git repo:
-```bash
-curl https://sh.rustup.rs -sSf | sh -s
-git clone --depth=1 --branch=main --recursive https://github.com/wez/wezterm.git
-cd wezterm
-git submodule update --init --recursive
-./get-deps
-cargo build --release
-cargo run --release --bin wezterm -- start
+```console
+$ curl https://sh.rustup.rs -sSf | sh -s
+$ git clone --depth=1 --branch=main --recursive https://github.com/wez/wezterm.git
+$ cd wezterm
+$ git submodule update --init --recursive
+$ ./get-deps
+$ cargo build --release
+$ cargo run --release --bin wezterm -- start
```
**If you get an error about zlib then you most likely didn't initialize the submodules;
@@ -48,8 +48,8 @@ By default, support for both X11 and Wayland is included on Unix systems.
If your distribution has X11 but not Wayland, then you can build WezTerm without
Wayland support by changing the `build` invocation:
-```bash
-cargo build --release --no-default-features vendored-fonts
+```console
+$ cargo build --release --no-default-features vendored-fonts
```
Building without X11 is not supported.
diff --git a/docs/install/windows.markdown b/docs/install/windows.markdown
index e857c16b9..3574ad008 100644
--- a/docs/install/windows.markdown
+++ b/docs/install/windows.markdown
@@ -9,8 +9,8 @@ You can download a setup.exe style installer to guide the installation
(requires admin privileges) or a simple zip file and manage the files for
yourself (no special privileges required).
-Windows (setup.exe)
-Nightly Windows (setup.exe)
+[:simple-windows: Windows (setup.exe) :material-tray-arrow-down:]({{ windows_exe_stable }}){ .md-button }
+[:simple-windows: Nightly Windows (setup.exe) :material-tray-arrow-down:]({{ windows_exe_nightly }}){ .md-button }
WezTerm is available in a setup.exe style installer; the installer is produced
with Inno Setup and will install wezterm to your program files directory and
@@ -19,8 +19,8 @@ as a GUI to guide you through the install, but also offers the [standard
Inno Setup command line options](https://jrsoftware.org/ishelp/index.php?topic=setupcmdline)
to configure/script the installation process.
-Windows (zip)
-Nightly Windows (zip)
+[:simple-windows: Windows (zip) :material-tray-arrow-down:]({{ windows_zip_stable }}){ .md-button }
+[:simple-windows: Nightly Windows (zip) :material-tray-arrow-down:]({{ windows_zip_nightly }}){ .md-button }
WezTerm is also available in a simple zip file that can be extracted and
run from anywhere, including a flash drive for a portable/relocatable
@@ -28,7 +28,7 @@ installation.
1. Download Release
2. Extract the zipfile and double-click `wezterm.exe` to run the UI
-3. Configuration instructions can be [found here](../config/files.html)
+3. Configuration instructions can be [found here](../config/files.md)
### For `winget` users
@@ -39,14 +39,14 @@ that is available from the Microsoft Store.
Once you have `winget`, you can install wezterm like so:
-```bash
-winget install wez.wezterm
+```console
+$ winget install wez.wezterm
```
and to later upgrade it:
-```bash
-winget upgrade wez.wezterm
+```console
+$ winget upgrade wez.wezterm
```
### For `Scoop` users
@@ -57,9 +57,9 @@ software, is [Scoop](https://scoop.sh/).
Wezterm is available from the "Extras" bucket and once you have installed
scoop itself can be installed like so:
-```bash
-scoop bucket add extras
-scoop install wezterm
+```console
+$ scoop bucket add extras
+$ scoop install wezterm
```
### For `Chocolatey` users
@@ -68,6 +68,6 @@ If you prefer to use [Chocolatey](https://chocolatey.org) to manage software,
wezterm is availabe from the Community Repository. It can be installed like
so:
-```bash
-choco install wezterm -y
+```console
+$ choco install wezterm -y
```
diff --git a/docs/javascript/fix-codeblock-console-copy-button.js b/docs/javascript/fix-codeblock-console-copy-button.js
new file mode 100644
index 000000000..3e81c845a
--- /dev/null
+++ b/docs/javascript/fix-codeblock-console-copy-button.js
@@ -0,0 +1,42 @@
+document.addEventListener("DOMContentLoaded", function() {
+ fixCopyOnlyUserSelectable();
+});
+
+function fixCopyOnlyUserSelectable() {
+ buttonsToFix = document.querySelectorAll(
+ '.language-console button.md-clipboard');
+ if (buttonsToFix.length)
+ console.log('Fixing copy-to-clipboard text of console code-blocks.');
+ buttonsToFix.forEach((btn) => {
+ var content = extractUserSelectable(btn.dataset.clipboardTarget);
+ btn.dataset.clipboardText = content;
+ });
+}
+
+function extractUserSelectable(selector) {
+ var result = '';
+ var element = document.querySelector(selector);
+
+ // Attempt to remove the non-selectable sections based on style,
+ // but we haven't seen this work reliably...
+ element.childNodes.forEach((child) => {
+ if (child instanceof Element) {
+ var s=window.getComputedStyle(child);
+ if (s.getPropertyValue('user-select') == 'none' ||
+ s.getPropertyValue('-webkit-user-select') == 'none' ||
+ s.getPropertyValue('-ms-user-select') == 'none')
+ {
+ return;
+ }
+ }
+ result += child.textContent;
+ });
+
+ // ... so we fall back to simple but effective:
+ // remove "$ " and "# " prompt at start of lines in code
+ result = result.replace(/^[\s]?[\$#]\s+/gm, "")
+
+ // remove empty lines
+ result = result.replace(/^\s*\n/gm, '')
+ return result;
+}
diff --git a/docs/mkdocs-base.yml b/docs/mkdocs-base.yml
new file mode 100644
index 000000000..3d2a512ba
--- /dev/null
+++ b/docs/mkdocs-base.yml
@@ -0,0 +1,105 @@
+copyright: Copyright © 2018-Present Wez Furlong
+site_name: Wez's Terminal Emulator
+site_url: https://wezfurlong.org/wezterm/
+site_description: Wez's Terminal Emulator
+repo_url: https://github.com/wez/wezterm
+repo_name: wez/wezterm
+edit_uri: edit/main/docs/
+docs_dir: docs
+site_dir: gh_pages
+theme:
+ name: material
+ logo: favicon.svg
+ favicon: favicon.svg
+ custom_dir: docs/overrides
+ palette:
+ - media: "(prefers-color-scheme: light)"
+ scheme: default
+ primary: deep purple
+ accent: deep purple
+ toggle:
+ icon: material/weather-sunny
+ name: Switch to dark mode
+
+ # Palette toggle for dark mode
+ - media: "(prefers-color-scheme: dark)"
+ scheme: slate
+ primary: deep purple
+ accent: purple
+ toggle:
+ icon: material/weather-night
+ name: Switch to light mode
+ features:
+ - content.action.edit
+ - content.action.view
+ - content.code.copy
+ - content.tabs.link
+ - navigation.footer
+ - navigation.indexes
+ - navigation.instant
+ #- navigation.expand
+ - navigation.tabs
+ - navigation.tabs.sticky
+ - navigation.tracking
+ - navigation.top
+ - search.highlight
+ - search.share
+ - search.suggest
+ - toc.follow
+plugins:
+ - include-markdown
+ - search
+ - social:
+ cards: !ENV [CARDS, false]
+ #- git-revision-date-localized:
+ # enable_creation_date: true
+ # type: timeago
+ - exclude:
+ glob:
+ - "**/_index.md"
+ - "**/*.markdown"
+ - "generate_toc.py"
+ - "README.markdown"
+ - "build.sh"
+ - "SUMMARY.md"
+ - "book.toml"
+ - "overrides/**"
+
+extra_css:
+ - style.css
+ - colorschemes/scheme.css
+ - asciinema-player.css
+extra_javascript:
+ - asciinema-player.min.js
+ - javascript/fix-codeblock-console-copy-button.js
+ - colorschemes/scheme.js
+
+markdown_extensions:
+ - admonition
+ - pymdownx.details
+ - attr_list
+ - md_in_html
+ - def_list
+ - pymdownx.highlight:
+ anchor_linenums: true
+ line_spans: __span
+ pygments_lang_class: true
+ - pymdownx.inlinehilite
+ - pymdownx.snippets
+ - pymdownx.emoji:
+ emoji_index: !!python/name:materialx.emoji.twemoji
+ emoji_generator: !!python/name:materialx.emoji.to_svg
+ - pymdownx.tasklist:
+ custom_checkbox: true
+ - pymdownx.tabbed:
+ alternate_style: true
+ - pymdownx.superfences:
+ custom_fences:
+ - name: mermaid
+ class: mermaid
+ format: !!python/name:pymdownx.superfences.fence_code_format
+
+extra:
+ social:
+ - icon: fontawesome/brands/github
+ link: https://github.com/wez/wezterm
diff --git a/docs/multiplexing.md b/docs/multiplexing.md
index a18b543fb..37bca2923 100644
--- a/docs/multiplexing.md
+++ b/docs/multiplexing.md
@@ -22,7 +22,7 @@ the domain of the current tab, or a specific numbered domain.
## SSH Domains
-*wezterm also supports [regular ad-hoc ssh connections](ssh.html).
+*wezterm also supports [regular ad-hoc ssh connections](ssh.md).
This section of the docs refers to running a wezterm daemon on the remote end
of a multiplexing session that uses ssh as a channel*
diff --git a/docs/overrides/partials/toc-item.html b/docs/overrides/partials/toc-item.html
new file mode 100644
index 000000000..16e11a3a3
--- /dev/null
+++ b/docs/overrides/partials/toc-item.html
@@ -0,0 +1,19 @@
+{% if not page.meta.toc_depth or toc_item.level <= page.meta.toc_depth %}
+
+
+
diff --git a/docs/scrollback.md b/docs/scrollback.md
index 7974ef5f6..a9d238a0a 100644
--- a/docs/scrollback.md
+++ b/docs/scrollback.md
@@ -9,7 +9,7 @@ down.
This section describes working with the scrollback and discusses some
configuration options; be sure to read the [configuration
-docs](config/files.html) to learn how to change your settings!
+docs](config/files.md) to learn how to change your settings!
### Controlling the scrollback size
@@ -50,7 +50,7 @@ return {
}
```
-You may [change the color of the scrollbar](config/appearance.html#defining-your-own-colors) if you wish!
+You may [change the color of the scrollbar](config/appearance.md#defining-your-own-colors) if you wish!
### Scrolling without a scrollbar
@@ -103,7 +103,7 @@ may be more recent than your version of wezterm) is shown below.
You can see the configuration in your version of wezterm by running
`wezterm show-keys --lua --key-table search_mode`.
-{{#include examples/default-search-mode-key-table.markdown}}
+{% include "examples/default-search-mode-key-table.markdown" %}
(Those assignments reference `CopyMode` because search mode is a facet of [Copy Mode](copymode.md)).
@@ -143,5 +143,5 @@ With that in your config you can now:
without needing to reach for your mouse.
-See [the Search action docs](config/lua/keyassignment/Search.html) for more information on
+See [the Search action docs](config/lua/keyassignment/Search.md) for more information on
using the `Search` action.
diff --git a/docs/ssh.md b/docs/ssh.md
index 31cad3312..dbf26d780 100644
--- a/docs/ssh.md
+++ b/docs/ssh.md
@@ -21,7 +21,7 @@ create.
SSH sessions created in this way are non-persistent and all associated
tabs will die if your network connection is interrupted.
-Take a look at [the multiplexing section](multiplexing.html) for an
+Take a look at [the multiplexing section](multiplexing.md) for an
alternative configuration that connects to a remote wezterm instance
and preserves your tabs.
diff --git a/docs/style.css b/docs/style.css
new file mode 100644
index 000000000..35c329ace
--- /dev/null
+++ b/docs/style.css
@@ -0,0 +1,23 @@
+/* prevent selection of prefix and output for console syntax */
+.language-console .gp, .language-console .go {
+ user-select: none;
+ -webkit-user-select: none; /* Chrome/Safari */
+ -ms-user-select: none; /* IE10+ */
+ color: !important pink;
+}
+
+@font-face {
+ font-family: "Symbols Nerd Font Mono";
+ src: url(fonts/Symbols-Nerd-Font-Mono.ttf) format("truetype");
+ font-weight: normal;
+ font-style: normal;
+}
+
+.nf {
+ font-family: "Symbols Nerd Font Mono";
+ speak: none;
+ line-height: 1;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+