From 815b894f414298257da3c2a46b6793878525f5ed Mon Sep 17 00:00:00 2001
From: Domenico Iezzi <domenico@iezzi.info>
Date: Thu, 12 Dec 2024 21:25:23 +0100
Subject: [PATCH] Fix documentation, change colors, enable dark mode

---
 README.md          | 99 ++++------------------------------------------
 docs/building.md   |  8 ++--
 docs/changelog.md  |  4 +-
 docs/qemu-debug.md |  1 -
 mkdocs.yml         | 23 ++++++++++-
 5 files changed, 35 insertions(+), 100 deletions(-)

diff --git a/README.md b/README.md
index f558d95..83ecc8b 100644
--- a/README.md
+++ b/README.md
@@ -4,10 +4,7 @@
 ![ci build status](https://github.com/NoMore201/tricore-gcc-toolchain/actions/workflows/build.yml/badge.svg)
 
 C/C++ toolchain based on GCC 11.3 for AURIX Tricore architecture. It supports
-TriCore architectures 1.3, 1.3.1, 1.6, 1.6.1, 1.6.2 and 1.8. 
-
-Prebuilt packages are available in the
-[release section](https://github.com/NoMore201/tricore-gcc-toolchain/releases).
+TriCore architectures 1.3, 1.3.1, 1.6, 1.6.1, 1.6.2 and 1.8.
 
 Documentation is published through Github Pages in [Docs](https://nomore201.github.io/tricore-gcc-toolchain/)
 
@@ -17,94 +14,12 @@ Documentation is published through Github Pages in [Docs](https://nomore201.gith
 > developement process and automated release management. All the meaningful
 > changes will be contributed back to upstream repository
 
-## Building (cross-compile)
-
-This chapter refers to cross-compiling from host architecture to `tricore-elf`
-target. In this scenario, build architecture is the same as the host 
-architecture.
-
-Instructions showed here are tested on Ubuntu 22.04 (see
-[Github Actions script](./.github/workflows/build.yml)), but should ideally
-work on other Linux distributions and also MSYS2 Windows environment.
-
-Clone the repository:
-
-```sh
-git clone --recursive https://github.com/NoMore201/tricore-gcc-toolchain.git
-```
-
-Install build dependencies:
-
-```sh
-sudo ./scripts/install-deps
-```
-
-Create a temporary build directory and call the `configure` script
-
-```sh
-mkdir build && cd build
-../configure --prefix=/path/to/prefix
-make -j$(nproc)
-```
-
-This will build and install everything into `/path/to/prefix`.
-
-It is also possible to compile single components of the toolchain. For further information on the available options, refer to `configure` script help page and
-the [Makefile](./Makefile.in).
+## Download pre-built toolchain packages
 
-## Building (canadian-cross)
-
-Sometimes it may be useful to build a cross-compiler from architecture B to architecture C, by performing the build on a third architecture A. The reason
-is that setting up architecture B for cross-compilation may be not as easy as
-on architecture A. This is called a 
-[canadian cross](https://en.wikipedia.org/wiki/Cross_compiler#Canadian_Cross).
-
-In this case, the idea is to build Win32 tricore-elf-gcc (cross-compiler from
-Win32 to `tricore-elf`) directly on Linux due to easier setup and the 
-reproducibility of the environment.
-
-Canadian cross build is performed by the
-[Github Actions script](./.github/workflows/build.yml). First clone the
-toolchain repository:
-
-```sh
-git clone --recursive git@github.com:EEESlab/tricore-gcc-toolchain-11.3.0.git
-```
-
-Install build dependencies, including MinGW cross-compiler:
-
-```sh
-sudo apt-get update
-sudo apt-get -y install build-essential texinfo \
-    flex bison libmpfr-dev libgmp-dev libmpc-dev zip libdebuginfod-dev \
-    gcc-mingw-w64 g++-mingw-w64
-```
-
-First we need to build the linux -> tricore cross-compiler. Refer to the
-[Build cross-compile section](#building-cross-compile) on how to do so.
-
-When linux -> tricore cross-compiler is ready, we need to install the newlib
-also into the final Win32 prefix. To do so, switch to the linux build directory
-and call make by swapping the prefix variable:
-
-```sh
-cd build-linux/build-newlib
-make install prefix=/path/to/win32-prefix
-```
-
-Now modify `PATH` environment variable with the PATH to linux cross-compiler:
-
-```sh
-export PATH="/path/to/linux-prefix:$PATH"
-```
+Prebuilt packages are available in the
+[release section](https://github.com/NoMore201/tricore-gcc-toolchain/releases).
 
-Finally we configure and build the missing components with the following
-commands
+## Building
 
-```sh
-mkdir build-win32 && cd build-win32
-../configure --prefix /path/to/win32-prefix --with-host=x86_64-w64-mingw32
-make -j$(nproc) stamps/build-binutils-tc
-export PATH="/opt/gcc/linux/bin:$PATH"
-make -j$(nproc) stamps/build-gcc-stage2-only
-```
\ No newline at end of file
+Please refer to [docs/building.md](./docs/building.md) document for build
+instructions.
\ No newline at end of file
diff --git a/docs/building.md b/docs/building.md
index 91a8ff1..57744e9 100644
--- a/docs/building.md
+++ b/docs/building.md
@@ -14,13 +14,13 @@ work on other Linux distributions and also MSYS2 Windows environment.
 Clone the repository:
 
 ```sh
-git clone --recursive git@github.com:EEESlab/tricore-gcc-toolchain-11.3.0.git
+git clone --recursive https://github.com/NoMore201/tricore-gcc-toolchain
 ```
 
 Install build dependencies:
 
 ```sh
-sudo ./scripts/install-gcc-deps
+sudo ./scripts/install-apt-dependencies
 ```
 
 Create a temporary build directory and call the `configure` script
@@ -52,13 +52,13 @@ You can see an example of a canadian cross build in the
 toolchain repository:
 
 ```sh
-git clone --recursive git@github.com:EEESlab/tricore-gcc-toolchain-11.3.0.git
+git clone --recursive https://github.com/NoMore201/tricore-gcc-toolchain
 ```
 
 Install build dependencies, including MinGW cross-compiler:
 
 ```sh
-sudo ./scripts/install-gcc-deps
+sudo ./scripts/install-apt-dependencies
 ```
 
 First we need to build the linux -> tricore cross-compiler. Refer to the
diff --git a/docs/changelog.md b/docs/changelog.md
index 3ea569c..3981d6f 100644
--- a/docs/changelog.md
+++ b/docs/changelog.md
@@ -6,7 +6,9 @@
   tricore support enabled
 - script: Switch build script to a GNU autoconf based solution, insipired by
   [RiscV toolchain repository](https://github.com/riscv-collab/riscv-gnu-toolchain)
-- release: Switched from commit SHA based release number to date release number. From now on, all releases will be tagged as 11.3.1-<date> to better recognize different versions
+- release: Switched from commit SHA based release number to date release number.
+  From now on, all releases will be tagged as `11.3.1-<date>` to better recognize
+  different versions
 
 ## 11.3.1-5e4ca74
 
diff --git a/docs/qemu-debug.md b/docs/qemu-debug.md
index 9845c60..317ede3 100644
--- a/docs/qemu-debug.md
+++ b/docs/qemu-debug.md
@@ -5,7 +5,6 @@
 This toolchain provides `qemu-system-tricore` and `tricore-elf-gdb` executable
 that can be used to run and debug your code in a simulated environment.
 
-> [!IMPORTANT]
 > QEMU support for Tricore architecture is incomplete. It provides only basic
 > CPU instruction decode (no interrupts or multi-core) and no peripheral is
 > available. Only core architecture from tc1.3 up to tc1.6.2 is supported
diff --git a/mkdocs.yml b/mkdocs.yml
index 6b93ebc..106a8b9 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -7,11 +7,30 @@ theme:
     - navigation.tabs
     - navigation.top
     - toc.integrate
+  palette:
+    # Palette toggle for light mode
+    - media: "(prefers-color-scheme: light)"
+      scheme: default
+      primary: teal
+      accent: teal
+      toggle:
+        icon: material/brightness-7
+        name: Switch to dark mode
 
-plugins: []
+    # Palette toggle for dark mode
+    - media: "(prefers-color-scheme: dark)"
+      scheme: slate
+      primary: teal
+      accent: teal
+      toggle:
+        icon: material/brightness-4
+        name: Switch to light mode
+
+plugins:
+  - search
 
 nav:
   - Home: index.md
   - Build: building.md
-  - Changelog: changelog.md
   - Debuggin with QEMU: qemu-debug.md
+  - Changelog: changelog.md