code wiki / hub / nx_search_render_html.nx

nx_search_render_html.nx

buildroot/runtime/hub/nx_search_render_html.nx

16742 B380 linesdepth 6pulls 9 transitivereach 9 importersview sourcekind librarytopic search
docsdependenciesstructsconstsfunctions

about

nx_search_render_html.nx -- HUB primitive; site-agnostic HTML render of NxSearchResults. Operator cardinal: "make sure you make the onsite and offsite search reusable and not just tied to the wiki but with capabilities to be used on other sites" (2026-05-27). COMPOSES (per NISHI_SMALL_SHARP_COMPOSABLE_STANDARD §4.1 M3 + M7): hub/nx_search_query_parser (NxSearchQuery) nx_search_onsite_engine (NxSearchResults) nx_search_snippet_extract (snippet w/ <mark>) nx_html_escape (html_escape) COMPOSED BY: hub/nx_search_handler_flow (next commit; site-agnostic HTTP flow) wiki/nx_wiki_search_wiring (next; THIN wiki adapter) (future) obd-config/nx_obd_search_wiring (THIN obd-config adapter) (future) sprinkler-config search wiring any site rendering search results DESIGN PRINCIPLE (per operator cardinal 2026-05-27): - Emits to RAW BYTE BUFFER (out + cap + *off) -- NOT to any site-specific writer struct. Reusable across wiki, obd-config, sprinkler-config, third-party-hosted Nishi pages. - Per-site CSS classes are PARAMETERIZED via NxSearchRenderTheme (site picks wiki-result vs obd-result vs sprinkler-result). - Per-result data (title/url/body) passed inp via parallel arrays (NxSearchRenderInputs) -- site provides whatever its doc store returns; render emits structure. V1 SCOPE per NISHI_SEARCH_CHARTER.md §6: - Sealed render: results banner + per-result card + empty state - QoS observable (elapsed_us per Cardinal 18) - Defensive at boundary: null title/url/body render explicitly V2 SCOPE (TODO): - Faceted filters sidebar (when nx_search_facets ships) - Pagination controls - "Did you mean?" suggestions - Per-result archive-snapshot link (when nx_archive ships) Status: V1. 2026-05-27.

dependencies 5 imports · 3 importers

nx_syscalls.nx nx_search_query_parser.nx nx_search_onsite_engine.nx nx_search_snippet_extract.nx nx_html_escape.nx nx_search_render_html.nx nx_search_handler_flow.nx nx_wiki_search_render.nx nx_wiki_search_wiring.nx

imports: nx_syscalls.nxnx_search_query_parser.nxnx_search_onsite_engine.nxnx_search_snippet_extract.nxnx_html_escape.nx

imported by: nx_search_handler_flow.nxnx_wiki_search_render.nxnx_wiki_search_wiring.nx

structs

73struct NxSearchRenderTheme
115struct NxSearchRenderInputs

consts

49const NX_SRH_OK: i64 = 0
50const NX_SRH_BAD_INPUT: i64 = 1900
51const NX_SRH_OUTPUT_OVERFLOW: i64 = 1901
52const NX_SRH_INPUTS_MISMATCH: i64 = 1902
53const NX_SRH_SNIPPET_FAIL: i64 = 1903
54const NX_SRH_LOOP_BUDGET: i64 = 1904
55const NX_SRH_THEME_INVALID: i64 = 1905
58const NX_SRH_MAX_RESULTS_RENDER: i64 = 200
59const NX_SRH_SNIPPET_BUF_CAP: i64 = 2048
60const NX_SRH_TITLE_CAP_BYTES: i64 = 512
61const NX_SRH_URL_CAP_BYTES: i64 = 512
62const NX_SRH_LOOP_BUDGET_CAP: i64 = 1000000
63const NX_SRH_INT_BUF_CAP: i64 = 32

functions

89func nx_srh_theme_init(t: *NxSearchRenderTheme,
126func nx_srh_inputs_init(inp: *NxSearchRenderInputs,
150func nx_srh_put_raw(out: *u8, cap: i64, off: i64,
163func nx_srh_put_z(out: *u8, cap: i64, off: i64, s: *u8) -> i64
172func nx_srh_put_escaped(out: *u8, cap: i64, off: i64,
called by 1: nx_srh_write_card calls 1: html_escape
183func nx_srh_int_to_dec(v: i64, out: *u8, cap: i64) -> i64
215func nx_srh_write_banner(out: *u8, cap: i64, off: i64,
244func nx_srh_write_empty(out: *u8, cap: i64, off: i64,
265func nx_srh_write_card(out: *u8, cap: i64, off: i64,
338func nx_search_render_html(out: *u8, cap: i64, off: i64,