From: Kai Moritz Date: Wed, 17 Jun 2026 17:08:56 +0000 (+0000) Subject: Add Maven site documentation generated from CLAUDE.md X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=74ac5a2f6146a53a06d9d3776c038588462e2e6f;p=maven-thymeleaf-skin Add Maven site documentation generated from CLAUDE.md Replace outdated XHTML stubs (copied from a different project) with proper Markdown documentation covering the StILi architecture and both import scripts. CLAUDE.md is the SSOT; the site docs are regenerated from it on demand, not automatically before each release. Changes: - src/site/site.xml: rewrite for StILi (maven-fluido-skin, clean nav) - src/site/markdown/index.md: overview, name origin, quick start, community extensibility model - src/site/markdown/architecture.md: site.vm mechanics, stili-json format, page types, body extraction - src/site/markdown/import-in-hugo.md: full Hugo script reference - src/site/markdown/import-in-astro.md: full Astro script reference - src/site/xhtml/: remove four legacy XHTML stubs from Thymeleaf skin - pom.xml: add doxia-module-markdown dependency, update maven-project-info-reports-plugin 2.9 → 3.7.0 with explicit report set (index, summary, licenses, team, scm, dependency-info, plugins) - CLAUDE.md: add documentation section with SSOT contract, file mapping, regeneration rules and minimal-diff principle Co-Authored-By: Claude Sonnet 4.6 --- diff --git a/CLAUDE.md b/CLAUDE.md index 39f210c..11547bd 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -12,6 +12,56 @@ Diese Datei enthält Anweisungen für Claude Code (claude.ai/code) beim Arbeiten - Erstelle nach dem Abschluss einer Aufgabe jeweils einen Commit — direkt, ohne vorher nachzufragen. - Fasse in der Commit-Nachricht zusammen, was und warum geändert wurde. +## Maven-Site-Dokumentation + +Die Projektdokumentation liegt unter `src/site/` und wird mit `mvn site` gerendert. +Diese CLAUDE.md ist die **Single Source of Truth (SSOT)** für den inhaltlichen Teil der Dokumentation. +Die Markdown-Dateien unter `src/site/markdown/` sind aus dieser CLAUDE.md abgeleitet und werden +**manuell auf Anforderung** neu generiert — nicht automatisch vor jedem Release. + +### Struktur + +``` +src/site/ + site.xml ← Navigation, Skin (maven-fluido-skin), Menüname + markdown/ + index.md ← Übersicht: Name, Ziel, Quick Start, Community-Prinzip + architecture.md ← Technisches: site.vm, stili-json-Format, Seitentypen, Body-Extraktion + import-in-hugo.md ← Referenz: Hugo-Import-Skript + import-in-astro.md ← Referenz: Astro-Import-Skript +``` + +**Mapping CLAUDE.md → Dokumentation:** + +| CLAUDE.md-Abschnitt | Datei | +|---|---| +| Was ist StILi? + Architektur-Prinzip | `index.md` | +| Funktionsweise: site.vm + JSON-Struktur + Seitentypen + Extraktion | `architecture.md` | +| Import-Skripte → import-in-hugo.sh | `import-in-hugo.md` | +| Import-Skripte → import-in-astro.sh | `import-in-astro.md` | + +### Wann neu generieren? + +Nur bei **inhaltlichen Änderungen** an den folgenden CLAUDE.md-Abschnitten: + +- „Was ist StILi?" oder „Architektur-Prinzip" +- „Funktionsweise: site.vm" oder „JSON-Struktur" oder „Seitentypen" oder „Extraktion" +- „Import-Skripte" (Parameter, Ausgaben, Beispiele) + +Nicht neu generieren für: Arbeitsregeln, Commit-Anweisungen, reine Formulierungsänderungen ohne Informationsgewinn. + +### Wie neu generieren (Aufruf für Claude Code) + +**Trigger:** `"Bitte generiere die Maven-Site-Dokumentation neu"` oder sinngemäß. + +**Vorgehen:** +1. Lies die inhaltlich relevanten Abschnitte dieser CLAUDE.md +2. Überarbeite **nur** die betroffenen Stellen in den entsprechenden Markdown-Dateien (Mapping siehe oben) +3. Halte Formatierung, Überschriften-Hierarchie und Tabellenstruktur stabil — ändere nur was sich inhaltlich geändert hat +4. Committe die aktualisierten Dateien + +**Prinzip für minimale Diffs:** Jeder inhaltliche Unterschied zur CLAUDE.md erzeugt genau einen entsprechenden Diff in der Dokumentation — kein Rauschen durch Umformatierung, Neustrukturierung oder Neusortierung. + --- ## Was ist StILi? diff --git a/pom.xml b/pom.xml index e2961bd..0d261e4 100644 --- a/pom.xml +++ b/pom.xml @@ -89,6 +89,13 @@ ${project.build.directory}/filtered-site + + + org.apache.maven.doxia + doxia-module-markdown + 1.9.1 + + @@ -98,10 +105,23 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 2.9 + 3.7.0 true + + + + index + summary + licenses + team + scm + dependency-info + plugins + + + diff --git a/src/site/markdown/architecture.md b/src/site/markdown/architecture.md new file mode 100644 index 0000000..ee42fcb --- /dev/null +++ b/src/site/markdown/architecture.md @@ -0,0 +1,89 @@ +# Architecture + +## How `site.vm` Works + +The Velocity template `src/main/resources/META-INF/maven/site.vm` is the core of StILi. It renders every Maven page in the following structure: + +```html +

Page Title

+
+ $bodyContent +
+``` + +**For `index.html` only**, a JSON metadata block is appended after the body: + +```html + +``` + +This block is the machine-readable interface between StILi and the import scripts. It appears only in `index.html` so that the import scripts have a single, predictable location for the full site metadata. + +## The `stili-json` Format + +The top-level fields mirror the Maven project coordinates: + +| Field | Source | +|---|---| +| `project` | Display name from POM `` | +| `groupId` | POM `` | +| `artifactId` | POM `` | +| `version` | POM `` | +| `generator` | Maven Doxia Site Renderer version | +| `generated` | ISO-8601 timestamp of generation | +| `pages` | Array of all pages (see below) | + +### The `pages` Array + +The `pages` array contains every page of the Maven site in the order they appear in the configured navigation menu. Array position serves as the `weight` for navigation sorting in the target system. + +Each entry: + +```json +{ + "name": "Project Reports", + "href": "project-reports.html", + "childs": ["plugin-info.html"], + "crumbs": [], + "path": "" +} +``` + +| Field | Meaning | +|---|---| +| `name` | Display name of the page | +| `href` | Filename relative to the site root (e.g. `project-reports.html`; for generated directories e.g. `apidocs/index.html`) | +| `childs` | Direct children in the menu tree (their `href` values) | +| `crumbs` | Ancestor pages from the root, excluding `index.html` (e.g. `["project-reports.html"]`) | +| `path` | Ancestors as a directory path — `crumbs` with `.html` replaced by `/` (e.g. `"project-reports/"`) | + +## Page Types + +| Type | Example | Detection | +|---|---|---| +| Root | `index.html` | `href == "index.html"` | +| Section node (has children) | `project-reports.html` | `childs.length > 0` | +| Leaf page | `configuration.html` | `childs.length == 0` | +| Generated content | `apidocs/`, `xref/` etc. | Subdirectory, not an HTML file | + +Generated content (JavaDocs, cross-references, etc.) appears as a subdirectory in the Maven site output and has a `pages` entry with an `href` like `apidocs/index.html`. + +## Body Extraction + +Import scripts extract the page body from each HTML file using this pattern: + +```bash +sed -n '/