code wiki / _hdl_build / nx_html_book.nx

nx_html_book.nx

buildroot/runtime/_hdl_build/nx_html_book.nx

4869 B84 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tooltopic html
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_chapter_split.nx nx_html_book.nx

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

main do_html sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close hb_p hb_w sys_write hb_slen extract_title find_sub hb_slen ↻ ensure_dir er_cat sys_openat_wr hb_w ↻ er_wjson sys_write ↻ chapter_split sys_mmap ↻ cs_split_on cs_slen cs_find_sub cs_slen ↻ nx_html_to_text nx_html_to_text_x h2t_state_new sys_mmap ↻ sys_mmap ↻ h2t_scan_tag h2t_skip_to_gt h2t_scan_name h2t_is_block_tag h2t_name_eq_lit h2t_lc h2t_is_suppress_tag

structs

none

consts

7const K_MAGIC_1024: i64 = 1024

functions

9func hb_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 2: hb_wfind_sub
10func hb_w(fd: i64, s: *u8) -> i64 { sys_write(fd, s, hb_slen(s)); return 0 }
called by 2: hb_pdo_html calls 2: sys_writehb_slen
11func hb_p(s: *u8) -> i64 { hb_w(1, s); return 0 }
called by 2: do_htmlmain calls 1: hb_w
12func 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 }
called by 1: do_html calls 2: sys_mmapsys_write
13func ensure_dir(path: *u8) -> i64 { __syscall(258, 0-100, path, 0x1ed, 0, 0, 0); return 0 }
called by 1: do_html
14func 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
15func er_wjson(fd: i64, s: *u8) -> i64
called by 1: do_html calls 1: sys_write
27func find_sub(hay: *u8, hl: i64, needle: *u8) -> i64
called by 1: extract_title calls 1: hb_slen
34func extract_title(html: *u8, hl: i64, out: *u8, cap: i64) -> i64
called by 1: do_html calls 1: find_sub
51func do_html(path: *u8, slug: *u8) -> i64
77func main(argc: i64, argv: *i64) -> i64