code wiki / _hdl_build / nx_sitegen.nx

nx_sitegen.nx

buildroot/runtime/_hdl_build/nx_sitegen.nx

7622 B143 linesdepth 4pulls 7 transitivereach 27 importersview sourcekind librarytopic sitegen
docsdependenciesstructsconstsfunctions

about

nx_sitegen.nx -- THE AUTO-BUILDER ENGINE: build a whole site page from a DECLARATIVE BLUEPRINT (data), deterministically, with NO AI and NO hand-written HTML. A blueprint is an ordered array of typed BLOCKS; the engine walks them in order and dispatches each to the sovereign nx_web_builder emitter for that kind. Because the blueprint is pure DATA: (1) a site is portable / diffable / versionable and NOT trapped in a proprietary editor (Wix/Webflow exceed angle -- their layout lives in a closed cloud store; ours is data the operator owns), (2) the Nishi team can REBUILD or UPDATE a site with no human and no model in the loop (autonomy), (3) a local LLM is OPTIONAL -- its ONLY job is to emit a blueprint; the build + serve path stay deterministic + sovereign whether the blueprint came from a human, the team, or a model. The engine REFUSES (emits nothing, returns -1) any blueprint that is not UX-compliant by construction (wb_ux_compliant: a clear CTA + onsite search + trust signals + <=3 resolution steps + responsive) -- a guarantee the Wix/WordPress "anything-goes canvas" does NOT make. Block kinds map 1:1 to nx_web_builder emitters; new site types (game-publish, video-gallery) add new kinds WITHOUT touching the spine (extensible; unknown kinds are skipped gracefully = forward-compatible). Composes nx_web_builder. license_tier: ORIGINAL

dependencies 3 imports · 7 importers

nx_web_builder.nx nx_html_sanitize.nx nx_syscalls.nx nx_sitegen.nx nx_site_compose.nx nx_sitegen_exceed_gate.nx nx_sitegen_file_gate.nx nx_sitegen_gate.nx nx_sitegen_llm_gate.nx nx_sitegen_parse.nx nx_sitegen_studio.nx

imports: nx_web_builder.nxnx_html_sanitize.nxnx_syscalls.nx

imported by: nx_site_compose.nxnx_sitegen_exceed_gate.nxnx_sitegen_file_gate.nxnx_sitegen_gate.nxnx_sitegen_llm_gate.nxnx_sitegen_parse.nxnx_sitegen_studio.nx

structs

none

consts

21const SG_HEADER: i64 = 1 // a=brand b=cta_label c=cta_href
22const SG_HERO: i64 = 2 // a=headline b=sub c=cta_label d=cta_href
23const SG_SEARCH: i64 = 3 // a=action b=placeholder
24const SG_CARDS: i64 = 4 // a=heading list=[title0,body0,title1,body1,...] lcount=#cards
25const SG_STEPS: i64 = 5 // a=heading list=[label0,label1,...] lcount=#steps (<=3)
26const SG_TRUST: i64 = 6 // list=[sig0,sig1,...] lcount=#signals
27const SG_FOOTER: i64 = 7 // a=text
28const SG_FAQ: i64 = 8 // a=heading list=[q0,a0,q1,a1,...] lcount=#qa pairs (additive content)
29const SG_GALLERY: i64 = 9 // a=heading list=[src0,alt0,...] lcount=#images (additive content)
30const SG_CTA: i64 = 10 // a=heading b=sub c=label d=href (mid-page call-to-action banner)

functions

33func sg_compliant(kind: *i64, b: *i64, c: *i64, lcount: *i64, n: i64) -> i64
52func sg_grade(kind: *i64, b: *i64, c: *i64, lcount: *i64, n: i64) -> i64
called by 1: sg_build_page calls 1: wb_ux_grade
73func sg_esc(src: *u8) -> *u8
called by 1: sg_build_page calls 2: sys_mmaphs_escape
89func sg_build_page(fd: i64, title: *u8, kind: *i64, a: *i64, b: *i64, c: *i64, d: *i64, list: *i64, lcount: *i64, n: i64) -> i64