code wiki / _hdl_build / nx_migrate_ingest.nx
nx_migrate_ingest.nx
buildroot/runtime/_hdl_build/nx_migrate_ingest.nx
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
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
structs
| none |
consts
| 9 | const K_MAGIC_4096: i64 = 4096 |
| 10 | const K_MAGIC_262144: i64 = 262144 |
functions
| 12 | func mi_lower(c: i64) -> i64 { if c >= 65 { if c <= 90 { return c + 32 } } return c } called by 1: mi_find_ci |
| 13 | func mi_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 14 | func 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 |
| 15 | func 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 |
| 18 | func mi_find_ci(html: *u8, n: i64, start: i64, pat: *u8) -> i64 |
| 34 | func mi_inner(html: *u8, n: i64, oidx: i64, closepat: *u8, out: *u8, cap: i64, endbox: *i64) -> i64 |
| 70 | func mi_emit_site(html: *u8, n: i64, domain: *u8, dn: i64, out: *u8) -> i64 |
| 136 | func main(argc: i64, argv: *i64) -> i64 |