code wiki / _hdl_build / nx_math_render_page.nx
nx_math_render_page.nx
buildroot/runtime/_hdl_build/nx_math_render_page.nx
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
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
structs
| none |
consts
| 21 | const MR_BODY_CAP: i64 = 131072 // body_html scratch (>> the few KB this page needs) |
| 22 | const MR_MML_CAP: i64 = 65536 // per-formula MathML scratch |
functions
| 24 | func 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 } |
| 25 | func mr_num(v: i64) -> i64 |
| 34 | func 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 } |
| 35 | func 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 |
| 36 | func mr_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 40 | func mr_cat_escaped(dst: *u8, off: i64, s: *u8) -> i64 |
| 59 | func mr_card(dst: *u8, off: i64, latex: *u8, caption: *u8) -> i64 |
| 80 | func main() -> i64 |