Windows: product names, the editors, WSL; the Linux page's image step

Assembled from development commit c3c40f6c8fca. Since 830b193: on Windows the
products carry Windows names (ktext.exe, klammertext.dll, document.dll,
reflect.dll) and the console's output code page is UTF-8 for a run; the
editor tooling works on Windows (VS Code, Sublime Text, Vim, with the
interpreter's name chosen by platform) and Notepad++ joins it
(doc/edit/notepadpp: a User Defined Language and two Run-menu commands);
a sixth install page, doc/install/windows_wsl_install.md, for Linux
inside WSL; the Windows page opens with the three routes and gains its
editor section, the PowerShell quoting and Path notes; the Linux page
installs OpenImageIO from the python3-openimageio package and verifies
with kdiag --machine; the README lists all six install pages. Linux and
macOS behaviour is unchanged.
This commit is contained in:
ack committed 2026-09-25 18:43:22 +02:00
1 parent 830b19394d
commit ee8bcf5300
33 files changed
+741 -122

No files matched your search

+9 -7
View File
@@ -18,8 +18,9 @@ language's structure, everywhere.
- VS Code 1.75 or later — a minimum, not a target: VS Code's monthly
releases count 1.75, 1.76, … (1.75 is from January 2023), so any
version from the last few years qualifies.
- `python3` on `PATH` (or set `klammertext.pythonPath`); Klammertext itself
already requires Python.
- `python3` on `PATH` — on Windows `python`, the name python.org installs
(or set `klammertext.pythonPath`); Klammertext itself already requires
Python.
- The language server, found automatically in this order:
1. the `klammertext.serverPath` setting, if set;
2. `klammertext_ls.py` vendored next to `extension.js` (the layout the
@@ -32,8 +33,9 @@ language's structure, everywhere.
## Install
Package the extension as a `.vsix` and install it (the builder needs only
bash and python3; the editing zip from the Klammertext website ships a
prebuilt `klammertext.vsix`, so there the first step is already done):
bash and Python — on Windows, run it in the MSYS2 shell the Klammertext
build uses; the editing zip from the Klammertext website ships a prebuilt
`klammertext.vsix`, so there the first step is already done):
./make_vsix.sh
code --install-extension klammertext.vsix
@@ -129,7 +131,7 @@ Shortcuts** (`Ctrl+K Ctrl+S`), search "klammertext", and rebind.
## Settings
A normal installation needs neither setting: the extension runs `python3`
from `PATH` and finds the language server automatically (the copy vendored
(on Windows `python`) from `PATH` and finds the language server automatically (the copy vendored
next to `extension.js`, then `../shared/`, then
`$KLAMMERTEXT_HOME/doc/edit/shared/`). They exist for unusual setups.
Set them in the Settings UI (`Ctrl+,`, search "klammertext") or in
@@ -138,10 +140,10 @@ reload the window after changing either.
| Setting | Meaning (default) |
|---|---|
| `klammertext.pythonPath` | Python interpreter for the server (`python3`) |
| `klammertext.pythonPath` | Python interpreter for the server (`python3`; on Windows `python`) |
| `klammertext.serverPath` | full path to `klammertext_ls.py` (auto-located) |
`pythonPath` matters when `python3` is not on the `PATH` VS Code sees — a
`pythonPath` matters when the interpreter is not on the `PATH` VS Code sees — a
VS Code launched from the desktop inherits a different environment than
your shell — or when a specific interpreter is wanted. `serverPath`
matters only when the server file lives outside the search chain above.
+5 -1
View File
@@ -165,7 +165,11 @@ function activate(context) {
'diagnostics, formatting, matching and alignment need the server.');
return;
}
const python = vscode.workspace.getConfiguration('klammertext').get('pythonPath') || 'python3';
// The setting's declared default is empty so that this fallback is what
// decides: python3 everywhere but Windows, where python.org installs
// "python" only (the Klammertext commands there use the same name).
const python = vscode.workspace.getConfiguration('klammertext').get('pythonPath') ||
(process.platform === 'win32' ? 'python' : 'python3');
client = new LspClient(python, [serverPath], log);
client.proc.on('error', (err) => {
vscode.window.showWarningMessage(
+9 -3
View File
@@ -9,7 +9,7 @@
# code --install-extension klammertext.vsix
#
# A .vsix is a zip holding a two-file manifest plus the extension payload
# under extension/. This script builds it with bash + python3 only — no
# under extension/. This script builds it with bash + Python only — no
# npm, no vsce — matching the extension's no-dependency design. The shared
# core and language server are vendored into the payload: from this folder
# if present (the editing-zip layout), else from ../shared (the repository
@@ -18,6 +18,12 @@
set -e
cd "$(dirname "$0")"
# The interpreter: $PYTHON if the environment names one (env/runtime.env
# does), else python3, else python -- the only name python.org installs on
# Windows, where this runs in the MSYS2 shell.
PYTHON="${PYTHON:-$(command -v python3 || command -v python)}"
[ -n "$PYTHON" ] || { echo "make_vsix.sh: no python3 or python on PATH" >&2; exit 1; }
OUT="$PWD/klammertext.vsix"
STAGE="$(mktemp -d)"
trap 'rm -rf "$STAGE"' EXIT
@@ -36,7 +42,7 @@ for f in klammertext_edit.py klammertext_ls.py; do
fi
done
VERSION=$(python3 -c "import json; print(json.load(open('package.json'))['version'])")
VERSION=$("$PYTHON" -c "import json; print(json.load(open('package.json'))['version'])")
cat > "$STAGE/[Content_Types].xml" <<'EOF'
<?xml version="1.0" encoding="utf-8"?>
@@ -75,7 +81,7 @@ cat > "$STAGE/extension.vsixmanifest" <<EOF
</PackageManifest>
EOF
python3 - "$STAGE" "$OUT" <<'EOF'
"$PYTHON" - "$STAGE" "$OUT" <<'EOF'
import os, sys, zipfile
stage, out = sys.argv[1], sys.argv[2]
with zipfile.ZipFile(out, 'w', zipfile.ZIP_DEFLATED) as z:
+2 -2
View File
@@ -83,8 +83,8 @@
"properties": {
"klammertext.pythonPath": {
"type": "string",
"default": "python3",
"description": "Python interpreter used to run the Klammertext language server."
"default": "",
"description": "Python interpreter used to run the Klammertext language server. Leave blank for python3 (on Windows: python)."
},
"klammertext.serverPath": {
"type": "string",