code wiki / _hdl_build / nx_wiki_shell.nx
nx_wiki_shell.nx
buildroot/runtime/_hdl_build/nx_wiki_shell.nx
about
nx_wiki_shell.nx -- THE AUTOMATIC PAGE BUILDER: the standard wiki-page furniture as reusable
emitters, so EVERY Nishi wiki page clears the MediaWiki/Wikipedia feature bar measured by
nx_wiki_exceed. Each function appends to a caller buffer and returns the new offset.
Features emitted (the census signals): responsive-viewport, print-css (media="print"),
lang-links (hreflang=), permalink (rel="bookmark") [sh_head]; navbar (<nav), search (type="search"),
wikilinks (href="/wiki/) [sh_nav]; toc (class="toc") [sh_toc_*]; section-anchors (<h2 id=)
[sh_section]; infobox (class="infobox") [sh_infobox_*]; references (class="references") [sh_refs_*];
categories (class="catlinks"), seealso (id="seealso"), edit-affordance (class="wiki-edit") [sh_footer].
The page supplies its own <h1> + freshness chip + body. Sovereign: nx_syscalls. license_tier: ORIGINAL
dependencies 3 imports · 13 importers
diagram shows first 10 each side; +0 more imports, +3 more importers in the complete lists below.
imports: nx_syscalls.nxnx_wiki_backlinks.nxnx_native_config.nx
imported by: nx_ims_page.nxnx_status_page.nxnx_wiki_ai_start_page.nxnx_wiki_board_page.nxnx_wiki_charter_page.nxnx_wiki_codec_status_page.nxnx_wiki_devlog.nxnx_wiki_econsim_page.nxnx_wiki_nist_stem_page.nxnx_wiki_products_page.nxnx_wiki_roadmap_page.nxnx_wiki_viz_atlas.nxnx_wiki_walk_metrics.nx
structs
| 113 | struct NxWikiLinks |
consts
| 109 | const SH_WL_MAXROWS: i64 = 64 |
| 110 | const SH_WL_MAXBYTES: i64 = 65536 |
| 111 | const SH_WL_NCOLS: i64 = 7 |
| 365 | const SH_BL_CAP: i64 = 32768 |
| 382 | const SH_CORPUS_PATH: *u8 = "knowledge/status/ims_live_corpus.txt" |
| 383 | const SH_CORPUS_CAP: i64 = 4194304 |
| 384 | const SH_CORPUS_MARKN: i64 = 8 // len("###PAGE ") |
functions
| 16 | func sh_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != 0 as u8 { n = n + 1 } return n } |
| 17 | func sh_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 } |
| 18 | func sh_catn(dst: *u8, off: i64, v: i64) -> i64 |
| 30 | func sh_head(buf: *u8, off: i64, title: *u8, slug: *u8) -> i64 |
| 58 | func sh_nav(buf: *u8, off: i64, slug: *u8) -> i64 |
| 67 | func sh_toc_open(buf: *u8, off: i64) -> i64 { return sh_cat(buf, off, "<nav class=\"toc\" aria-label=\"Contents\"><b>Contents</b><ol>\n" as *u8) } |
| 68 | func sh_toc_item(buf: *u8, off: i64, id: *u8, title: *u8) -> i64 |
| 73 | func sh_toc_close(buf: *u8, off: i64) -> i64 { return sh_cat(buf, off, "</ol></nav>\n" as *u8) } |
| 76 | func sh_section(buf: *u8, off: i64, id: *u8, title: *u8) -> i64 |
| 83 | func sh_infobox_open(buf: *u8, off: i64, title: *u8) -> i64 |
| 88 | func sh_infobox_row(buf: *u8, off: i64, k: *u8, v: *u8) -> i64 |
| 93 | func sh_infobox_close(buf: *u8, off: i64) -> i64 { return sh_cat(buf, off, "</table></aside>\n" as *u8) } |
| 96 | func sh_refs_open(buf: *u8, off: i64) -> i64 { return sh_cat(buf, off, "<section class=\"references\"><h2 id=\"refs\"><a href=\"#refs\">References & evidence</a></h2><ol>\n" as *u8) } |
| 97 | func sh_refs_close(buf: *u8, off: i64) -> i64 { return sh_cat(buf, off, "</ol></section>\n" as *u8) } |
| 121 | func sh_wl_field(wl: *NxWikiLinks, row: i64, col: i64) -> *u8 |
| 131 | func sh_streq(a: *u8, b: *u8) -> i64 |
| 144 | func sh_wl_row_of(wl: *NxWikiLinks, slug: *u8) -> i64 called by 6: sh_breadcrumbsh_prevnextsh_relatedsh_treesh_footer_wlwm_measure calls 2: sh_wl_fieldsh_streq |
| 155 | func sh_wikilinks_prefix() -> *u8 { return "knowledge/store/wiki-links-\x00" as *u8 } called by 1: sh_links_load |
| 157 | func sh_wl_cell(keys: *i64, vals: *i64, nf: i64, name: *u8) -> i64 |
| 171 | func sh_links_load(wl: *NxWikiLinks, path: *u8) -> i64 called by 10: ip_rendermainmainmainmainmain+4 calls 6: sys_mmapncfg_opensh_wikilinks_prefixncfg_countncfg_rowsh_wl_cell |
| 206 | func sh_title_of(dst: *u8, off: i64, slug: *u8) -> i64 |
| 223 | func sh_breadcrumb(buf: *u8, off: i64, wl: *NxWikiLinks, slug: *u8) -> i64 |
| 264 | func sh_prevnext(buf: *u8, off: i64, wl: *NxWikiLinks, slug: *u8) -> i64 |
| 289 | func sh_related(buf: *u8, off: i64, wl: *NxWikiLinks, slug: *u8) -> i64 |
| 328 | func sh_tree(buf: *u8, off: i64, wl: *NxWikiLinks, slug: *u8) -> i64 |
| 366 | func sh_backlinks(buf: *u8, off: i64, store: *NxWikiDocStore, slug: *u8) -> i64 |
| 385 | func sh_corpus_store() -> *NxWikiDocStore called by 10: ims_pagemainmainmainmainmain+4 calls 4: sys_mmapsys_read_filenx_wiki_doc_store_initnx_wiki_doc_store_add |
| 440 | func sh_walk_furniture(buf: *u8, off: i64, wl: *NxWikiLinks, store: *NxWikiDocStore, slug: *u8) -> i64 called by 9: ip_rendermainmainmainmainmain+3 calls 6: sh_catsh_breadcrumbsh_treesh_prevnextsh_relatedsh_backlinks |
| 455 | func sh_footer_wl(buf: *u8, off: i64, wl: *NxWikiLinks, slug: *u8, epoch: i64) -> i64 called by 8: ip_rendermainmainmainmainmain+2 calls 6: sh_wl_row_ofsh_catsh_wl_fieldsys_mmapsh_title_ofsh_catn |
| 536 | func sh_footer(buf: *u8, off: i64, slug: *u8, epoch: i64) -> i64 |