Docs/DocSite.md

Doc site

Apps/DocSite turns the repository into a static website: plain HTML files, no WebAssembly, no server code. The only scripts are the vendored mermaid.js and its init, to draw the ```mermaid diagrams of the docs.

Page File Source
Home index.html README.md + links to every page
Network protocol protocol.html Libs/Shared.Protocol/MsgId.cs (ids, and legs from its // A -> B comments), the sources (.On<T>(MsgId.X) and .OnRaw(MsgId.X) = handlers, other MsgId.X = senders), reflection on the payload structs
Game rules gameplay.html Libs/Shared.Gameplay: Rules, levels table, Weapons.All + charge curves, MobAttacks, Species (one row per species), WorldCoords, WorldGen, SafeZone
World map world.html + world.png WorldGen(1234): 2 km × 2 km around the spawn, terrain colours like the client, trees, rocks, slime spawns, cells, active area, safe zone
Blasters (sub-menu) blasters.html, blaster-<kind>.html Blasters (kinds, ranks, traits, Growth), Shots, Weapons.Blaster: one page per kind (by rank, by level, the traits' shares over seeds 1 to 1000, forged examples)
Mobs (sub-menu) mobs.html, mob-<species>.html Species (biomes, body, health, speed, habits, look), MobAttacks: one page per species (by level, attacks, look) with its sheet from Docs/Mobs.md (the ### <species name> section, Markdown.RenderSection)
Biomes (sub-menu) biomes.html, biome-<name>.html + biome-<biome>-map.png Biomes.All (ground colours, trees, rocks), Species.OfBiome, the biome map's shares; one page per biome with a top-down map of 512 m around its nearest spot from the spawn (WorldGen.FindBiome, WorldMap.AreaPng)
Quests quests.html Libs/Shared.Gameplay/Config/quests.json (QuestSettings.Read) and Libs/Client.Core/Lang/*.json: every quest (giver, prerequisites, what it unlocks, repeat, objectives, rewards, every dialogue line with its languages), the chains as a mermaid graph, the result of QuestAudit (see Quests)
Quests guide quest-guide-<lang>.html (fr, en, de, nl; the menu opens quest-guide-fr.html) The players' page of the quests, from quests.json and the client's Lang/*.json through Loc (Apps/DocSite/Site/QuestsPageModel.cs, Pages/QuestGuidePage.razor): in story order (the main chain by next, then the others), each quest's giver, bound gift, repeat, story, goal, steps with their exact rule and the NPC's line, every NPC line, reward and next quest, values filled. Never edited by hand; QuestsPageModelTests checks no quest is missing and no {placeholder} is left. Its few labels are the docquest.* texts
Docs doc-<path>.html every Docs/**/*.md (Markdig), one navigation section per folder

The notes next to constants and fields are their /// <summary> comments: Shared.Gameplay and Shared.Protocol generate their XML documentation file for that. Write a summary on a new rule constant and it shows on the site.

Images from the game

The pages of the mobs, blasters and biomes show pictures taken by the game client itself (the same models, looks and colours as in play): Apps/DocSite/Assets/img/*.webp, committed with Git LFS, copied as they are by the export. A page shows an image only when its file exists (SiteInfo.Image).

Image What
mob-<species>.webp, mob-<species>-looks.webp one mob in a studio (three-quarter view); eight of it with eight different looks
blaster-<kind>-ranks.webp, blaster-<kind>-traits.webp, blaster-shots.webp the kind at ranks E to S (level 10); four rank S ones with different traits; the shots' shapes
biome-<biome>.webp the nearest spot of each biome from the spawn (world seed 1234), with a few of its mobs
ui-<section>.webp the UI kit's widgets and templates (UiKitGallery), shown by UI kit
wing-sheet.webp, wing-ranks.webp, wing-flight.webp, wing-updraft.webp, wing-forge.webp, wing-icons.webp the wings (-Only wings): every shape with every kind of particles; the 30 wings (type × rank); gliders in flight; an updraft; the forge making a wing; the bag icons (shown by World)

Names: lowercase enum names (mob-snowwolf, biome-denseforest). They come from the client's test hook --doc-shots DIR (Apps/Client/Scripts/DocShots.cs: offline, no server; a studio on the safe zone's plateau with a plain background, or a terrain for the biomes; each picture framed and cropped to what it shows), run by:

./Tools/Dev/Build-DocImages.ps1                 # every image (a GPU: about a minute)
./Tools/Dev/Build-DocImages.ps1 -Only mobs      # or blasters, biomes, ui (the UI kit: a few seconds)
./Tools/Dev/Build-DocImages.ps1 -Software       # no GPU: Direct3D 12 on WARP (slow: ~3 min for mobs and blasters, 10+ for the biomes)

When what they show changed. Take them again when a mob's model or look, a blaster's parts, a biome's ground or props or a widget of the UI kit changed, on the dev PC (GPU) by hand, and commit them. Not on a server (no GPU); the CI does not take them: the doc site and its Docker image only copy the committed files.

Run

dotnet run --project Apps/DocSite                                  # -> BuildOutput/DocSite (git-ignored), opens from file://
dotnet run --project Apps/DocSite -- --out /tmp/site --version 0.1.0 --commit <sha>
docker compose up -d --build docsite                               # nginx, http://localhost:8081

--commit makes the source links point to that commit on Gitea (else main). The export fails if two Markdown files give the same page name, or if the output contains another script than mermaid.

Writing docs

  • Add or edit a .md file under Docs/: it appears in the navigation, titled by its first # heading.
  • Links between Markdown files ([World](World.md#cells), ../README.md) become links between pages; a link to a generated page by its file ([Quests page](quests.html)) stays as it is. Links to other files of the repository go to their source on Gitea. Images are taken from Gitea (raw), except those of Apps/DocSite/Assets/img (![x](../Apps/DocSite/Assets/img/ui-buttons.webp)), served by the site itself.
  • A new generated page: a component in Apps/DocSite/Pages (wrap it in <Shell>), a Render<...> line in Program.cs and an entry in SiteInfo.Generated. A page of a sub-menu goes in a NavGroup of Site/Catalog.cs instead (the navigation shows it as a folding <details>, open on its own pages: no script). A new species, blaster kind or biome gets its page by itself (its images once Build-DocImages.ps1 is run); a species needs its ### Name sheet in Docs/Mobs.md (DocSiteTests checks it). In Razor, an SVG <text> is written <!text> (<text> is a Razor keyword).

Publishing

The docsite image is built and pushed with the others by Tools/Dev/Publish-Images.ps1 (the Deploy workflow's publish job) and served at https://doc.sushivr.ovh by the deploy (see Deploy).