diff --git a/.gitignore b/.gitignore index ef7714d..c84fa27 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ codec_bin_section_1.bin # Generated language plugin files + host-side builder binary *.gla languages_builder + +# Generated docs site +website/_build/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 4972e8d..a7a087f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ single running list until the first versioned release. OpenGD77 features and FreeTRX additions, each tagged 🟢 [FreeTRX] or ⚪ [OpenGD77]. Includes the spectrum scope (VFO sweep, hold `#`), channel add/delete, mute, dimming, and a button reference. +- **Documentation website** (`website/`) — MkDocs Material config that renders the + markdown into a static, searchable HTML site (client-side search, dark/light + theme). Built in Docker via `./website/build-docs.sh`; the public URL is set with + `SITE_URL=…`. For self-hosting on Forgejo. ## 0.4.0 diff --git a/website/build-docs.sh b/website/build-docs.sh new file mode 100644 index 0000000..aa2a716 --- /dev/null +++ b/website/build-docs.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash +# +# Build the FreeTRX documentation website (MkDocs Material) entirely in Docker. +# Source markdown lives in the repo root; this assembles it into _build/docs and +# renders a static, self-contained HTML site with client-side search into +# website/_build/site. +# +# Usage: ./website/build-docs.sh # build +# ./website/build-docs.sh serve # live-reload preview on http://localhost:8000 +set -euo pipefail + +HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ROOT="$(cd "$HERE/.." && pwd)" +SRC="$HERE/_build/docs" +IMAGE="squidfunk/mkdocs-material:9" + +# ---- assemble the docs source tree from the root markdown ----------------- +rm -rf "$HERE/_build" +mkdir -p "$SRC/images" + +cp "$HERE/home.md" "$SRC/index.md" +cp "$ROOT/MANUAL.md" "$SRC/MANUAL.md" +cp "$ROOT/TOOLS.md" "$SRC/TOOLS.md" +cp "$ROOT/CHANGELOG.md" "$SRC/CHANGELOG.md" +cp "$ROOT"/docs/images/*.png "$SRC/images/" 2>/dev/null || true + +# MANUAL.md links back to README.md (a repo file, not a site page) -> point it at +# the site home instead. +sed -i.bak 's#(README.md)#(index.md)#g' "$SRC/MANUAL.md" && rm -f "$SRC/MANUAL.md.bak" + +# Optional public URL (sitemap / canonical only). Set SITE_URL to override the +# placeholder in mkdocs.yml — the site works at any URL regardless. +ENVARGS=() +if [[ -n "${SITE_URL:-}" ]]; then + echo "==> Site URL: $SITE_URL" + ENVARGS=(-e "SITE_URL=$SITE_URL") +fi + +# ---- build (or serve) ----------------------------------------------------- +if [[ "${1:-}" == "serve" ]]; then + echo "==> Serving docs on http://localhost:8000 (Ctrl-C to stop)" + docker run --rm -it -p 8000:8000 "${ENVARGS[@]+"${ENVARGS[@]}"}" -v "$HERE":/docs "$IMAGE" serve -a 0.0.0.0:8000 +else + echo "==> Building docs site" + docker run --rm "${ENVARGS[@]+"${ENVARGS[@]}"}" -v "$HERE":/docs "$IMAGE" build + echo + echo "==> Done. Static site (upload the *contents* of this folder):" + echo " $HERE/_build/site" +fi diff --git a/website/home.md b/website/home.md new file mode 100644 index 0000000..7812cc3 --- /dev/null +++ b/website/home.md @@ -0,0 +1,35 @@ +# FreeTRX + +**FreeTRX** is a fork of the [OpenGD77](https://opengd77.org) firmware for the +**TYT MD-UV380 / Retevis RT-3S** and **Baofeng DM-1701 / Retevis RT-84**. + +[Latest release :material-download:](https://git.dk1da.de/DK1DA/FreeTRX/releases){ .md-button .md-button--primary } +[Source :material-git:](https://git.dk1da.de/DK1DA/FreeTRX){ .md-button } + +## Screenshots + +