code wiki / _hdl_build / nx_html_book.nx
nx_html_book.nx
buildroot/runtime/_hdl_build/nx_html_book.nx
about
nx_html_book.nx -- SOVEREIGN HTML (single-file web ebook) -> Nishi reader format. The library holds ~79 .html
books that previously dead-ended at /file. Reads the .html and runs it through the SAME chapter_split pipeline
as the EPUB/MOBI readers (nx_html_to_text -> book.json + chapN.txt) so the zero-JS reader renders it unchanged.
<title> -> book title (else the slug). Usage: nx_html_book <html-path> <slug>. expect_exit: 0 license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_chapter_split.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 7 | const K_MAGIC_1024: i64 = 1024 |
functions
| 9 | func hb_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 10 | func hb_w(fd: i64, s: *u8) -> i64 { sys_write(fd, s, hb_slen(s)); return 0 } |
| 11 | func hb_p(s: *u8) -> i64 { hb_w(1, s); return 0 } |
| 12 | func hb_pn(v: i64) -> i64 { let b: *u8=sys_mmap(24); var m: i64=v; if m<0{m=0-m} let t: *u8=sys_mmap(24); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 } |
| 13 | func ensure_dir(path: *u8) -> i64 { __syscall(258, 0-100, path, 0x1ed, 0, 0, 0); return 0 } called by 1: do_html |
| 14 | func er_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){dst[off+i]=s[i];i=i+1} return off+i } called by 1: do_html |
| 15 | func er_wjson(fd: i64, s: *u8) -> i64 |
| 27 | func find_sub(hay: *u8, hl: i64, needle: *u8) -> i64 |
| 34 | func extract_title(html: *u8, hl: i64, out: *u8, cap: i64) -> i64 |
| 51 | func do_html(path: *u8, slug: *u8) -> i64 |
| 77 | func main(argc: i64, argv: *i64) -> i64 |