Files
aego/tools/gendocs/main.go
T
sanspie 50be5c04bc
ci-platforms / darwin amd64 smoke (push) Skipped
GitHub / linux amd64 native GitHub-hosted native CI: success
ci-platforms / windows amd64 smoke (push) Skipped
GitHub / windows amd64 native GitHub-hosted native CI: success
GitHub / darwin arm64 native GitHub-hosted native CI: success
GitHub / darwin amd64 native GitHub-hosted native CI: success
ci / checks (push) Failing after 1h21m34s
ci / native-authoring (push) Skipped
ci-platforms / darwin arm64 smoke (push) Skipped
github-native / gitea-pending (push) Skipped
github-native / darwin amd64 native (push) Skipped
github-native / linux amd64 native (push) Skipped
github-native / windows amd64 native (push) Skipped
github-native / darwin arm64 native (push) Skipped
github-native / gitea-result (push) Skipped
ci / build (amd64, linux, ubuntu-24.04) (push) Successful in 12m4s
ci / release (push) Skipped
Stage 12.5: Art Workspace and asset authoring
Add dockable Art tools, animation and previews, guarded asset workflows,
and the Web Asset Studio built on the shared Art Core. Expand English and
Russian documentation, interactive Try scenes, examples and editor icons.

Add audio waveform navigation, source analysis, guarded previews and a
browser Worker mixer. Preserve source changes and recovery with bounded
checks, and strengthen native, browser and interoperability CI.

Prepare version 0.12.5 and manually built native artifact candidates.
Fix the production site image demo build dependency.
Reuse immutable scene indices when capturing keyframes.
Wait for real Persist save/load completion in component tests.
Stabilize browser Game View captures outside pointer hover.
Aseprite interchange and persistent Audio EDL recovery remain limited;
the artifact workflow does not publish releases or change stable.
2026-11-15 10:37:50 +03:00

105 lines
4.8 KiB
Go

package main
import (
"flag"
"fmt"
"os"
"strings"
"time"
"unicode/utf8"
"aego/tools/gendocs/site"
"aego/tools/gendocs/tryassets"
)
func splitList(s string) []string {
var out []string
for _, x := range strings.Split(s, ",") {
if x = strings.TrimSpace(x); x != "" {
out = append(out, x)
}
}
return out
}
func main() {
in := flag.String("in", "", "documentation export written by aego docs export")
out := flag.String("out", "site", "output directory")
title := flag.String("title", "", "site title, defaults to the export title")
play := flag.Bool("playground", false, "add Run buttons that load play/aego.wasm")
studio := flag.Bool("studio", false, "link an already-built Art Studio in studio/")
studioURL := flag.String("studio-url", "", "link a verified, version-pinned standalone Studio release")
studioGuides := flag.Bool("studio-guides", false, "link pre-integrated Studio guides in asset-studio/")
examplesURL := flag.String("examples-url", "https://aego.akarpov.ru/", "canonical HTTPS docs root for complete source example packages; empty disables packaging")
examplesVersion := flag.String("examples-version", "1.0.0", "release version of the example catalog; increment when publishing changed sources")
examplesLicense := flag.String("examples-license", "NOASSERTION", "actual SPDX/source license of documentation examples; never inferred from dependencies")
examplesLicenseFile := flag.String("examples-license-file", "", "file containing reviewed terms to include in every example archive")
examplesProduction := flag.Bool("examples-production", false, "require an explicit known license for official example publication")
repo := flag.String("repo", "", "source repository linked from the header and footer")
edit := flag.String("edit", "", "base URL of Edit this page links, defaults to <repo>/src/branch/main")
version := flag.String("version", "", "engine version shown in the footer")
channel := flag.String("channel", "development", "documentation status, for example stable or development; not an engine feature guarantee")
commit := flag.String("commit", "", "commit shown in the footer")
hero := flag.String("hero", "", "screenshot shown on the landing page")
shots := flag.String("shots", "", "directory of editor screenshots that pages show as shots/<name>.png")
poster := flag.String("poster", "", "image shown before the home page demo starts")
demo := flag.Bool("demo", false, "link the web demo at demo/ from the landing page")
playVersion := flag.String("play-version", "", "cache key of play/aego.wasm")
tryVersion := flag.String("try-version", "", "cache key of try/aego-docs.wasm")
icons := flag.String("icons", "", "comma-separated directories with <id>.svg icons")
prepareTry := flag.String("prepare-try", "", "source .assets project to prepare as adjacent .aetry runtime resources")
checkTry := flag.Bool("check-try", false, "verify prepared Try artifacts against a fresh source import")
flag.Parse()
if *prepareTry != "" {
target, err := tryassets.Generate(*prepareTry, *checkTry)
if err != nil {
fmt.Fprintln(os.Stderr, "gendocs:", err)
os.Exit(1)
}
fmt.Println("gendocs: Try artifacts", target)
return
}
if *in == "" {
fmt.Fprintln(os.Stderr, "usage: gendocs -in export.json [-out dir] [-title name] [-playground] [-repo url] [-version v] [-commit sha] [-hero png]")
os.Exit(2)
}
exp, err := site.Load(*in)
if err != nil {
fmt.Fprintln(os.Stderr, "gendocs:", err)
os.Exit(1)
}
if *title != "" {
exp.Title = *title
}
var licenseText string
if *examplesLicenseFile != "" {
data, err := os.ReadFile(*examplesLicenseFile)
if err != nil || len(data) == 0 || len(data) > 64<<10 || !utf8.Valid(data) || strings.TrimSpace(string(data)) == "" {
fmt.Fprintln(os.Stderr, "gendocs: example license file is unreadable, empty, invalid UTF-8, or larger than 64 KiB")
os.Exit(1)
}
licenseText = string(data)
}
var rel *site.Release
if *repo != "" {
if rel, err = site.FetchRelease(*repo); err != nil {
fmt.Fprintln(os.Stderr, "gendocs: no download buttons:", err)
}
}
rep, err := site.Build(exp, *out, site.Options{
ExamplesURL: *examplesURL, ExamplesVersion: *examplesVersion, ExamplesLicense: *examplesLicense, ExamplesLicenseText: licenseText, ExamplesProduction: *examplesProduction, Channel: *channel,
Playground: *play, Studio: *studio, StudioURL: *studioURL, StudioGuides: *studioGuides, Repo: *repo, Edit: *edit, Version: *version, Commit: *commit, Hero: *hero, Poster: *poster, Shots: *shots, Demo: *demo, PlayVersion: *playVersion, TryVersion: *tryVersion, Release: rel, Icons: splitList(*icons), Time: time.Now(),
})
if err != nil {
fmt.Fprintln(os.Stderr, "gendocs:", err)
os.Exit(1)
}
for _, b := range rep.Broken {
fmt.Fprintln(os.Stderr, "gendocs: broken link", b)
}
fmt.Printf("gendocs: %d pages, %d entries -> %s\n", rep.Pages, rep.Entries, *out)
if len(rep.Broken) > 0 {
os.Exit(1)
}
}