code wiki / _hdl_build / nx_ims_page.nx
nx_ims_page.nx
buildroot/runtime/_hdl_build/nx_ims_page.nx
about
nx_ims_page.nx -- THE REUSABLE TYPE-AWARE PAGE GENERATOR. ONE function, ims_page,
renders ANY real Nishi content into a fully WALKABLE, S-class typed wiki page --
replacing the per-page cloned emitters (nx_wiki_nist_stem_page-style copies). It
reuses nx_wiki_shell VERBATIM for every piece of furniture (head, nav, the walk
block = breadcrumb+tree+prev/next+related+backlinks, anchored sections, infobox,
toc, footer) and reads the page's nav relationships from wiki_links.tsv BY SLUG,
so a new page becomes part of the walkable tree the moment its wiki_links.tsv row
exists. The Diataxis doc_type drives a small, DATA-DRIVEN layout difference read
from knowledge/registry/ims_typemap.tsv (a type label + which optional sections
show) -- no layout magic in code (CLAUDE.md #11). The caller supplies title +
body_html (already valid, escaped HTML for the page's own content) + the corpus
set used by the guarded publish step (the generator itself only WRITES the file).
REUSE (zero furniture reinvented): nx_wiki_shell sh_head/sh_nav/sh_walk_furniture/
sh_section/sh_infobox_*/sh_toc_*/sh_footer_wl + sh_links_load/sh_corpus_store +
sh_cat/sh_catn + NxWikiLinks. nx_syscalls for I/O. license_tier: ORIGINAL
dependencies 3 imports · 7 importers
imports: nx_syscalls.nxnx_wiki_shell.nxnx_native_config.nx
imported by: nx_asset_dashboard_lib.nxnx_figures_page.nxnx_ims_batch1.nxnx_ims_batch2.nxnx_ims_page_selftest.nxnx_math_render_page.nxnx_wiki_search_page.nx
structs
| 42 | struct NxTypeMap |
consts
| 22 | const IP_OK: i64 = 0 |
| 23 | const IP_BAD_INPUT: i64 = 2820 |
| 24 | const IP_WRITE_FAIL: i64 = 2821 |
| 27 | const IP_CAP: i64 = 262144 // 256 KB per emitted page (>> any real page) |
| 28 | const IP_MODE_0644: i64 = 0x1a4 |
| 29 | const IP_LINKS_PATH: *u8 = "knowledge/registry/wiki_links.tsv" |
| 30 | const IP_TYPEMAP_PREFIX: *u8 = "knowledge/store/ims-typemap-" |
| 31 | const IP_OUT_DIR: *u8 = "web_assets/" |
| 38 | const IP_TM_MAXROWS: i64 = 16 |
| 39 | const IP_TM_MAXBYTES: i64 = 8192 |
| 40 | const IP_TM_NCOLS: i64 = 5 |
functions
| 49 | func ip_tm_field(tm: *NxTypeMap, row: i64, col: i64) -> *u8 |
| 59 | func ip_tm_flag(tm: *NxTypeMap, row: i64, col: i64) -> i64 |
| 66 | func ip_typemap_load(tm: *NxTypeMap, prefix: *u8) -> i64 |
| 99 | func ip_type_row(tm: *NxTypeMap, doc_type: *u8) -> i64 |
| 115 | func ip_render(slug: *u8, doc_type: *u8, title: *u8, body_html: *u8, called by 2: ims_pagemain calls 16: sys_mmapsh_links_loadip_typemap_loadip_type_rowip_tm_fieldip_tm_flag+10 |
| 183 | func ims_page(slug: *u8, doc_type: *u8, title: *u8, body_html: *u8) -> i64 |