code wiki / (root) / nx_docpub_render.nx

nx_docpub_render.nx

buildroot/runtime/nx_docpub_render.nx

14298 B336 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind librarytopic docpub
docsdependenciesstructsconstsfunctions

about

nx_docpub_render.nx -- the DOC RENDER CORE for nx_docpub_site / nx_docpub_tree: turn a .nx source file into a zero-JS HTML reference page, plus the byte/file/escape helpers both publishers need. WHY IT IS A SEPARATE MODULE. Both publishers imported nx_docgen_lib.nx expecting these ten symbols; that library is a DIFFERENT organ -- legal clause templating (dg_clause_put / dg_tmpl_put / dg_merge / dg_assemble) -- and never carried them. Verified genuinely UNWRITTEN before writing: `func dg_render` has ZERO matches across all 19,985 files INCLUDING every .dupe-reconciled / .bak-* artifact, so this is new code and not a re-implementation of something a dedupe deleted (the mistake made on nx_bom earlier). The dg_ prefix is heavily overloaded -- ~30 unrelated organs define private dg_puts/dg_cat/dg_num -- so these live in their own file rather than being bolted onto any of them. ZERO-JS BY CONSTRUCTION: nothing here ever emits a <script tag, and every byte taken from source goes through dg_catb_esc. nx_docpub_tree T3 asserts exactly that (page contains `<div class=fn ` and does NOT contain `<script`), so the guarantee is checked, not promised. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 1 imports · 2 importers

nx_syscalls.nx nx_docpub_render.nx nx_docpub_site.nx nx_docpub_tree.nx

imports: nx_syscalls.nx

imported by: nx_docpub_site.nxnx_docpub_tree.nx

structs

none

consts

18const DPR_TAGCAP: i64 = 2048
19const DPR_MODE: i64 = 420

functions

21func dgw(s: *u8) -> i64
called by 3: dgs_onemainmain calls 1: sys_write
28func dgn(v: i64) -> i64
called by 3: dgs_onemainmain calls 2: sys_mmapsys_write
42func dg_cat(dst: *u8, off: i64, s: *u8) -> i64
49func dg_catn(dst: *u8, off: i64, v: i64) -> i64
called by 2: dgs_onemain calls 1: sys_mmap
65func dg_catb_esc(dst: *u8, off: i64, src: *u8, from: i64, to: i64) -> i64
called by 3: dg_renderdgs_onemain calls 1: dg_cat
84func dg_rdfile(path: *u8, buf: *u8, cap: i64) -> i64
100func dg_writefile(path: *u8, buf: *u8, len: i64) -> i64
112func dg_contains(hay: *u8, n: i64, needle: *u8) -> i64
called by 3: dg_rendermainmain
133func dg_first_doc_line(src: *u8, n: i64, out: *u8) -> i64
160func dpr_isidc(c: i64) -> i64
called by 1: dg_render
170func dpr_atline(src: *u8, i: i64) -> i64
called by 1: dg_render
176func dpr_matches(src: *u8, n: i64, i: i64, lit: *u8) -> i64
called by 1: dg_render
192func dg_render(src: *u8, n: i64, base: *u8, out: *u8, cnt: *i64) -> i64