No description
Drops `fmt` + `os` + `path/filepath` + `encoding/json` imports from all 3 test files. ZERO banned-imports remaining in docs. Conversions in catalog_test.go: - os.MkdirAll → MkdirAll (dot-imported Result-shape; bare statement, no error check, matches original Go behaviour) - os.WriteFile → WriteFile (1 site) - filepath.Join → PathJoin (~6 sites) - fmt.Sprintf → Sprintf (5 sites in benchmark) Conversions in generate_test.go: - Adds 2 test helpers: statExists(path) error + readFileBytes(t, path) → []byte. They wrap Stat + ReadFile Result-shape into the conventional test idiom (assertion-on-error / fail-on-error). - os.Stat + AssertNoError → AssertNoError(t, statExists(...)) (3 sites) - os.ReadFile + RequireNoError → readFileBytes(t, ...) (6 sites; collapses 4 lines per site into 1) - json.Unmarshal → JSONUnmarshal Result-shape with t.Fatal on !OK (2 sites) - filepath.Join → PathJoin Conversions in integration_test.go: - os.MkdirAll/WriteFile → MkdirAll/WriteFile Result-shape with t.Fatal on !OK (4 sites) - os.Stat + AssertNoError → statExists() helper (6 sites) - os.ReadFile + RequireNoError → readFileBytes() helper (3 sites) - json.Unmarshal → JSONUnmarshal Result-shape (1 site) - filepath.Join → PathJoin All docs tests pass. Banned-imports: 9 → 0 (-9, FULLY CLEARED) for docs. Refs Mantis #1316 Filed-by: hephaestus Co-authored-by: Hephaestus <hephaestus@lthn.ai> |
||
|---|---|---|
| .core | ||
| .forgejo/workflows | ||
| docs | ||
| external | ||
| go | ||
| .gitignore | ||
| .gitmodules | ||
| .woodpecker.yml | ||
| AGENTS.md | ||
| CLAUDE.md | ||
| go.work | ||
| LICENCE | ||
| llm.txt | ||
| README.md | ||
| sonar-project.properties | ||
| zensical.toml | ||
core/docs
Documentation platform for the Core ecosystem (CLI, Go packages, PHP modules, MCP tools). Published at https://core.help.
Module: dappco.re/go/core/docs
Licence: EUPL-1.2
Language: Go 1.26 (library) + Python 3 (site build via zensical)
Components
docs/— Markdown source files (217+) with YAML frontmatter, organised by section (Go, PHP, TS, GUI, AI, Tools, Deploy, Publish).go/pkg/help/— Go library for help content management: parsing, search, HTTP serving, and static site generation.
Quickstart
Build the static site
pip install zensical
zensical build
# Output: site/
Use the Go help library
import help "dappco.re/go/core/docs/pkg/help"
cat, err := help.LoadContentDir("docs/")
if err != nil { panic(err) }
results := cat.Search("install")
for _, r := range results {
fmt.Println(r.Topic.ID, r.Score)
}
Run as an HTTP server
srv := help.NewServer(cat)
http.ListenAndServe(":8080", srv)
// GET /, /topics/{id}, /search?q=X
// GET /api/topics, /api/topics/{id}, /api/search?q=X
Layout
docs/ Markdown content (217+ files)
go/pkg/help/ Help library (parser, catalog, search, server, generate, render)
external/ Submodule deps
zensical.toml Site build config (Python)
.forgejo/workflows/ Forgejo CI (deploy.yml builds + pushes site/ to BunnyCDN)
See docs/architecture.md for the help-library data flow and docs/development.md for contributor setup.
Licence
EUPL-1.2 — see LICENCE.