code wiki / _hdl_build / nx_migrate_ingest.nx

nx_migrate_ingest.nx

buildroot/runtime/_hdl_build/nx_migrate_ingest.nx

7064 B155 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_migrate_ingest.nx -- SITE-MIGRATION ingest (R3b): transform a fetched external page (HTML bytes) into a sovereign `.site` BLUEPRINT that nx_site_provision consumes -> the basis of /api/migrate (e.g. jasonewest.com). Operator: "migrate sites like jasonewest.com easily -- not just hosting but migrating/updating." PURE transform mi_emit_site(html,n,domain,dn,out) -> out_n (bytes in, bytes out, independently gateable); a thin main fetches (adapter) + writes. Extracts <title>/<h1>/<p>/<h2> into title|header|hero|search|cards|... ; STRIPS nested tags, collapses whitespace, and SANITIZES the '|' delimiter out of extracted text (else it corrupts the .site format). (NB: distinct from nx_site_ingest.nx, which is research-library mirroring -- different concern.) license_tier: ORIGINAL

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_migrate_ingest.nx nx_migrate_ingest_gate.nx

imports: nx_syscalls.nx

imported by: nx_migrate_ingest_gate.nx

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_write sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close mi_emit_site sys_mmap ↻ mi_find_ci mi_slen mi_lower mi_inner mi_find_ci ↻ mi_slen ↻ mi_put mi_putb mi_slen ↻ sys_openat_wr sys_close ↻

structs

none

consts

9const K_MAGIC_4096: i64 = 4096
10const K_MAGIC_262144: i64 = 262144

functions

12func mi_lower(c: i64) -> i64 { if c >= 65 { if c <= 90 { return c + 32 } } return c }
called by 1: mi_find_ci
13func mi_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
14func mi_put(out: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { out[o] = s[i]; o = o + 1; i = i + 1 } return o }
called by 1: mi_emit_site
15func mi_putb(out: *u8, o: i64, b: *u8, len: i64) -> i64 { var i: i64 = 0; while i < len { out[o] = b[i]; o = o + 1; i = i + 1 } return o }
called by 1: mi_emit_site
18func mi_find_ci(html: *u8, n: i64, start: i64, pat: *u8) -> i64
34func mi_inner(html: *u8, n: i64, oidx: i64, closepat: *u8, out: *u8, cap: i64, endbox: *i64) -> i64
called by 1: mi_emit_site calls 2: mi_find_cimi_slen
70func mi_emit_site(html: *u8, n: i64, domain: *u8, dn: i64, out: *u8) -> i64
136func main(argc: i64, argv: *i64) -> i64