add full documentation tab on zinit_ui #46

Open
opened 2026-03-09 07:58:56 +00:00 by despiegk · 3 comments
Owner

use bootstrap

get the content from

/Volumes/T7/codehero/forge.ourworld.tf/geomind_code/zinit/docs

furst update those docs in relation to implementation

make nice to understand documentation

purpose of the objects
how they relate to each other

how to use them

also how to use rust code through SDK

how to use the command line

basically a full blow documentation feature inside

use bootstrap get the content from /Volumes/T7/codehero/forge.ourworld.tf/geomind_code/zinit/docs furst update those docs in relation to implementation make nice to understand documentation purpose of the objects how they relate to each other how to use them also how to use rust code through SDK how to use the command line basically a full blow documentation feature inside
Author
Owner

Implementation Spec for Issue #46: Documentation Tab for zinit_ui

Objective

Add a full-featured "Docs" tab to the zinit web admin dashboard that renders comprehensive, well-structured documentation about zinit — covering concepts, object relationships, CLI usage, SDK/Rust usage, service specs, configuration paths, and the OpenRPC API. Documentation content is embedded at compile time and rendered client-side from Markdown to HTML using Bootstrap styling.

Requirements

  • Add a new "Docs" tab button to the tab bar (icon: bi-book)
  • Add a tab-docs pane with sidebar navigation and content area
  • Documentation content sourced from existing Markdown files, updated and improved
  • Content embedded in binary using rust-embed (same pattern as static assets)
  • Client-side Markdown rendering via vendored marked.js (~50KB)
  • Sidebar + content area layout with Bootstrap classes
  • Dark/light theme support using existing CSS variables
  • Deep linking via hash routing (e.g., #docs/sdk.md)
  • No new Rust crate dependencies

Files to Modify/Create

  • crates/zinit_ui/docs/*.md — 10 documentation files (new/improved)
  • crates/zinit_ui/static/js/marked.min.js — Vendored Markdown renderer
  • crates/zinit_ui/src/assets.rs — Add DocAssets embed struct
  • crates/zinit_ui/src/routes.rs — Add /api/docs and /api/docs/{name} routes
  • crates/zinit_ui/templates/base.html — Add Docs tab button + script tag
  • crates/zinit_ui/templates/index.html — Add docs tab pane HTML
  • crates/zinit_ui/static/css/dashboard.css — Docs layout/typography styles
  • crates/zinit_ui/static/js/dashboard.js — Docs sidebar, loading, rendering logic
  • crates/zinit_ui/scripts/download-assets.sh — Add marked.js download entry

Implementation Plan

Step 1: Write and improve documentation Markdown files

Files: crates/zinit_ui/docs/ (10 files)

  • Create overview.md (architecture, object relationships)
  • Copy and improve existing docs (CLI, SDK, service specs, paths, builders, API)
  • Create database.md from zinitdb_oschema README
    Dependencies: none

Step 2: Add marked.min.js library

Files: crates/zinit_ui/static/js/marked.min.js

  • Download and vendor marked.js for client-side Markdown rendering
    Dependencies: none

Step 3: Add embedded docs asset struct and API route

Files: crates/zinit_ui/src/assets.rs, crates/zinit_ui/src/routes.rs

  • Add DocAssets rust-embed struct
  • Add GET /api/docs and GET /api/docs/{name} routes
    Dependencies: Step 1 (docs files must exist)

Step 4: Add Docs tab button to base.html

Files: crates/zinit_ui/templates/base.html

  • Add tab button with book icon
  • Add marked.min.js script tag
    Dependencies: Step 2

Step 5: Add Docs tab pane to index.html

Files: crates/zinit_ui/templates/index.html

  • Add tab-docs pane with sidebar + content area layout
    Dependencies: none

Step 6: Add docs CSS styles

Files: crates/zinit_ui/static/css/dashboard.css

  • Sidebar, content area, Markdown typography, responsive rules
    Dependencies: none

Step 7: Add docs JavaScript logic

Files: crates/zinit_ui/static/js/dashboard.js

  • Sidebar rendering, page loading, Markdown rendering, hash routing
    Dependencies: Steps 4, 5, 6

Step 8: Update download-assets.sh

Files: crates/zinit_ui/scripts/download-assets.sh

  • Add marked.js download entry
    Dependencies: none

Acceptance Criteria

  • "Docs" tab appears in tab bar with book icon
  • Sidebar shows all documentation sections
  • Clicking sidebar items loads and renders Markdown as styled HTML
  • All 10 documentation pages render correctly
  • Code blocks and tables styled properly
  • Overview page includes architecture and object relationships
  • Works in both dark and light themes
  • Deep linking works (e.g., #docs/sdk.md)
  • Content embedded in binary (no runtime filesystem access)
  • marked.js vendored locally (not CDN)
  • Documentation content accurate to current codebase

Notes

  • Existing docs need updating (dates, API signatures)
  • rust-embed already a dependency — just adding a second struct
  • marked.js is mature and ~50KB minified
  • Client-side rendering avoids adding pulldown-cmark to Cargo.toml
  • Sidebar layout follows standard documentation site patterns
## Implementation Spec for Issue #46: Documentation Tab for zinit_ui ### Objective Add a full-featured "Docs" tab to the zinit web admin dashboard that renders comprehensive, well-structured documentation about zinit — covering concepts, object relationships, CLI usage, SDK/Rust usage, service specs, configuration paths, and the OpenRPC API. Documentation content is embedded at compile time and rendered client-side from Markdown to HTML using Bootstrap styling. ### Requirements - Add a new "Docs" tab button to the tab bar (icon: `bi-book`) - Add a `tab-docs` pane with sidebar navigation and content area - Documentation content sourced from existing Markdown files, updated and improved - Content embedded in binary using `rust-embed` (same pattern as static assets) - Client-side Markdown rendering via vendored marked.js (~50KB) - Sidebar + content area layout with Bootstrap classes - Dark/light theme support using existing CSS variables - Deep linking via hash routing (e.g., `#docs/sdk.md`) - No new Rust crate dependencies ### Files to Modify/Create - `crates/zinit_ui/docs/*.md` — 10 documentation files (new/improved) - `crates/zinit_ui/static/js/marked.min.js` — Vendored Markdown renderer - `crates/zinit_ui/src/assets.rs` — Add DocAssets embed struct - `crates/zinit_ui/src/routes.rs` — Add `/api/docs` and `/api/docs/{name}` routes - `crates/zinit_ui/templates/base.html` — Add Docs tab button + script tag - `crates/zinit_ui/templates/index.html` — Add docs tab pane HTML - `crates/zinit_ui/static/css/dashboard.css` — Docs layout/typography styles - `crates/zinit_ui/static/js/dashboard.js` — Docs sidebar, loading, rendering logic - `crates/zinit_ui/scripts/download-assets.sh` — Add marked.js download entry ### Implementation Plan #### Step 1: Write and improve documentation Markdown files Files: `crates/zinit_ui/docs/` (10 files) - Create overview.md (architecture, object relationships) - Copy and improve existing docs (CLI, SDK, service specs, paths, builders, API) - Create database.md from zinitdb_oschema README Dependencies: none #### Step 2: Add marked.min.js library Files: `crates/zinit_ui/static/js/marked.min.js` - Download and vendor marked.js for client-side Markdown rendering Dependencies: none #### Step 3: Add embedded docs asset struct and API route Files: `crates/zinit_ui/src/assets.rs`, `crates/zinit_ui/src/routes.rs` - Add DocAssets rust-embed struct - Add GET /api/docs and GET /api/docs/{name} routes Dependencies: Step 1 (docs files must exist) #### Step 4: Add Docs tab button to base.html Files: `crates/zinit_ui/templates/base.html` - Add tab button with book icon - Add marked.min.js script tag Dependencies: Step 2 #### Step 5: Add Docs tab pane to index.html Files: `crates/zinit_ui/templates/index.html` - Add tab-docs pane with sidebar + content area layout Dependencies: none #### Step 6: Add docs CSS styles Files: `crates/zinit_ui/static/css/dashboard.css` - Sidebar, content area, Markdown typography, responsive rules Dependencies: none #### Step 7: Add docs JavaScript logic Files: `crates/zinit_ui/static/js/dashboard.js` - Sidebar rendering, page loading, Markdown rendering, hash routing Dependencies: Steps 4, 5, 6 #### Step 8: Update download-assets.sh Files: `crates/zinit_ui/scripts/download-assets.sh` - Add marked.js download entry Dependencies: none ### Acceptance Criteria - [ ] "Docs" tab appears in tab bar with book icon - [ ] Sidebar shows all documentation sections - [ ] Clicking sidebar items loads and renders Markdown as styled HTML - [ ] All 10 documentation pages render correctly - [ ] Code blocks and tables styled properly - [ ] Overview page includes architecture and object relationships - [ ] Works in both dark and light themes - [ ] Deep linking works (e.g., `#docs/sdk.md`) - [ ] Content embedded in binary (no runtime filesystem access) - [ ] marked.js vendored locally (not CDN) - [ ] Documentation content accurate to current codebase ### Notes - Existing docs need updating (dates, API signatures) - `rust-embed` already a dependency — just adding a second struct - marked.js is mature and ~50KB minified - Client-side rendering avoids adding pulldown-cmark to Cargo.toml - Sidebar layout follows standard documentation site patterns
Author
Owner

Build & Test Results

  • Build: cargo build -p zinit_ui — Success (compiled in 25s)
  • Tests: cargo test -p zinit_ui — 0 passed, 0 failed (no unit tests in this crate)
  • Compilation: All new code (DocAssets struct, API routes, embedded docs) compiles cleanly with no warnings

Changes Summary

New Files (12)

  • crates/zinit_ui/docs/ — 10 Markdown documentation files (overview, cli, cli_reference, sdk, sdk_examples, service_specs, paths, builders, api, database)
  • crates/zinit_ui/static/js/marked.min.js — Vendored Markdown renderer (~35KB)

Modified Files (6)

  • crates/zinit_ui/src/assets.rs — Added DocAssets rust-embed struct
  • crates/zinit_ui/src/routes.rs — Added /api/docs and /api/docs/{name} routes
  • crates/zinit_ui/templates/base.html — Added Docs tab button + marked.js script
  • crates/zinit_ui/templates/index.html — Added docs tab pane HTML
  • crates/zinit_ui/static/css/dashboard.css — Added docs layout/typography styles
  • crates/zinit_ui/static/js/dashboard.js — Added docs sidebar, loading, rendering, deep-link logic
  • crates/zinit_ui/scripts/download-assets.sh — Added marked.js download entry
## Build & Test Results - **Build**: ✅ `cargo build -p zinit_ui` — Success (compiled in 25s) - **Tests**: ✅ `cargo test -p zinit_ui` — 0 passed, 0 failed (no unit tests in this crate) - **Compilation**: All new code (DocAssets struct, API routes, embedded docs) compiles cleanly with no warnings ## Changes Summary ### New Files (12) - `crates/zinit_ui/docs/` — 10 Markdown documentation files (overview, cli, cli_reference, sdk, sdk_examples, service_specs, paths, builders, api, database) - `crates/zinit_ui/static/js/marked.min.js` — Vendored Markdown renderer (~35KB) ### Modified Files (6) - `crates/zinit_ui/src/assets.rs` — Added DocAssets rust-embed struct - `crates/zinit_ui/src/routes.rs` — Added /api/docs and /api/docs/{name} routes - `crates/zinit_ui/templates/base.html` — Added Docs tab button + marked.js script - `crates/zinit_ui/templates/index.html` — Added docs tab pane HTML - `crates/zinit_ui/static/css/dashboard.css` — Added docs layout/typography styles - `crates/zinit_ui/static/js/dashboard.js` — Added docs sidebar, loading, rendering, deep-link logic - `crates/zinit_ui/scripts/download-assets.sh` — Added marked.js download entry
Author
Owner

Implementation committed: af1bd42

Browse: geomind_code/zinit@af1bd42

Implementation committed: `af1bd42` Browse: https://forge.ourworld.tf/geomind_code/zinit/commit/af1bd42
despiegk added this to the now milestone 2026-03-09 10:22:55 +00:00
Commenting is not possible because the repository is archived.
No labels
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
geomind_code/zinit_archive2#46
No description provided.