code wiki / _hdl_build / nx_math_render_page.nx

nx_math_render_page.nx

buildroot/runtime/_hdl_build/nx_math_render_page.nx

10417 B127 linesdepth 10pulls 15 transitivereach 0 importersview sourcekind tooltopic math
docsdependenciesstructsconstsfunctions

about

nx_math_render_page.nx -- GENERATE the live "/wiki/math_render.html" page (IMS Thrust D, rung 1): the VISIBLE proof of the sovereign "arXiv PDF->HTML / LaTeX" capability. A walkable Diataxis REFERENCE page built through the reusable typed generator nx_ims_page (full walk furniture: head/nav/breadcrumb/tree/prev-next/related/backlinks/infobox/toc/footer, nav read from wiki_links.tsv by slug=math_render). The page's OWN content (body_html) embeds REAL presentation MathML produced AT BUILD TIME by nx_tex (tx_render) -- the snippets are rendered, not hand-written: 1. the BM25 term-saturation factor f / (f + k) (the heart of the wiki's own ranker), 2. the full BM25 single-term score IDF * f(k1+1) / (f + k1(1 - b + b|D|/avgdl)), 3. the DLMF Gamma-function integral Gamma(z) = int_0^inf t^{z-1} e^{-t} dt, 4. a quadratic & the quadratic formula (msqrt + mfrac showcase), 5. a relations / greek line. Each formula is shown with its LaTeX source (escaped, in <code>) next to the rendered MathML, so a reader sees input -> output. ADDITIVE: writes web_assets/math_render.html only (the publish step pushes it live + fetch-verifies). REUSE (nothing reinvented): nx_ims_page ims_page (typed walkable generator) + nx_tex tx_render (the sovereign renderer). license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_ims_page.nx nx_tex.nx nx_math_render_page.nx

imports: nx_ims_page.nxnx_tex.nx

imported by: nobody (leaf or entry point)

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

main mr_cat mr_card tx_render tx_slen sys_mmap tx_emit mr_cat ↻ mr_cat_escaped mr_cat ↻ mr_catb mr_w mr_num mr_w ↻ ims_page sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real sh_corpus_store sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close nx_wiki_doc_store_init sys_mmap ↻ nx_wiki_doc_store_add sys_mmap ↻ nx_wib_pool_alloc sys_mmap ↻ ip_render sys_mmap ↻ sh_links_load sys_mmap ↻ ncfg_open ss_open_cached ssc_init ssc_sig_of

structs

none

consts

21const MR_BODY_CAP: i64 = 131072 // body_html scratch (>> the few KB this page needs)
22const MR_MML_CAP: i64 = 65536 // per-formula MathML scratch

functions

24func mr_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: mr_cardmain
25func mr_num(v: i64) -> i64
called by 2: mr_cardmain
34func mr_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 }
35func mr_catb(dst: *u8, off: i64, s: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { dst[off + i] = s[i]; i = i + 1 } return off + i }
called by 1: mr_card
36func mr_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
40func mr_cat_escaped(dst: *u8, off: i64, s: *u8) -> i64
called by 1: mr_card calls 1: mr_cat
59func mr_card(dst: *u8, off: i64, latex: *u8, caption: *u8) -> i64
80func main() -> i64