code wiki / _hdl_build / nx_tpl_site.nx
nx_tpl_site.nx
buildroot/runtime/_hdl_build/nx_tpl_site.nx
about
nx_tpl_site.nx -- R-WHOLESITE of the SITE FACTORY: ingest a COMPLETE multi-page template/site as ONE
site-graph pattern ("pass it along wholesale"). Walks a site directory (root + one subdir level), and for
every page keeps the abstract structure (archetype + section sequence, via the R4 scanners) plus the NAV
GRAPH (internal href edges between the site's own pages). The whole site collapses to ONE content-addressed
`site:<hash>` record (canonical = byte-lex-sorted per-page arch\x1fseq lines + bucketed edge count) in the
SAME tplcorpus store -- so the corpus now holds three granularities: section BRICKS (part:), page PATTERNS
(pat:), and whole SITE GRAPHS (site:). Budget-guarded (max_pages trap), idempotent, structure-only.
usage: nx_tpl_site <site-dir> <corpus-prefix> [max_pages]
license_tier: ORIGINAL
dependencies 1 imports · 1 importers
imports: nx_tpl_ingest.nx
imported by: nx_tpl_site_gate.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 11 | const TS_MAGIC_131072: i64 = 131072 |
| 12 | const TS_MAGIC_1024: i64 = 1024 |
| 14 | const TS_MAXPG: i64 = 64 |
| 15 | const TS_NAMEW: i64 = 96 |
| 16 | const TS_SEQW: i64 = 200 |
| 17 | const TS_RECCAP: i64 = 8192 |
| 18 | const TS_MAXE: i64 = 96 |
functions
| 21 | func ts_collect(dir: *u8, names: *u8, maxn: i64) -> i64 |
| 99 | func ts_sort(names: *u8, n: i64) -> i64 called by 1: ts_ingest |
| 133 | func ts_nameeq(a: *u8, b: *u8) -> i64 { var i: i64=0; while 1==1 { if (a[i] as i64)!=(b[i] as i64) { return 0 } if a[i]==(0 as u8) { return 1 } i=i+1 } return 1 } called by 1: ts_page_idx |
| 135 | func ts_page_idx(t: *u8, names: *u8, npg: i64) -> i64 |
| 141 | func ts_edges(h: *u8, n: i64, from: i64, names: *u8, npg: i64, ef: *i64, et: *i64, ecnt: *i64) -> i64 |
| 189 | func tp_bucket_site(v: i64) -> i64 called by 1: ts_ingest |
| 197 | func ts_ingest(dir: *u8, prefix: *u8, max_pages: i64, counts: *i64, keyout: *u8) -> i64 |
| 325 | func main(argc: i64, argv: *i64) -> i64 |