code wiki / (root) / atom.nx

atom.nx

buildroot/runtime/atom.nx

6523 B181 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind tooltopic atom
docsdependenciesstructsconstsfunctions

about

atom.nx -- Atom 1.0 feed builder (RFC 4287). Modern alternative to RSS 2.0. Atom's strictness (required id, updated, author; XML namespaces; RFC 3339 dates) makes it cleaner for programmatic parsing. Google, NetNewsWire, and many news APIs prefer Atom. Nishi-pages should emit both -- RSS for universal compatibility, Atom for correctness. Feed skeleton: <?xml version=\"1.0\" encoding=\"utf-8\"?> <feed xmlns=\"http://www.w3.org/2005/Atom\"> <title>...</title> <link href=\"...\"/> <id>...</id> <updated>2026-04-22T12:34:56Z</updated> <author><name>...</name></author> <entry> <title>...</title> <link href=\"...\"/> <id>...</id> <updated>...</updated> <summary>...</summary> <content type=\"html\"><![CDATA[...]]></content> </entry> </feed> Dates: ISO 8601 (iso8601.nx) -- RFC 3339 is the Atom-specified subset. HTML content: CDATA wrap, same convention as rss.nx. Invariants: A1 id must be a stable tag: URI or URL. Caller supplies; we emit as-is (escaped). A2 updated is required at both feed + entry level; we require it rather than defaulting. A3 Stream builder: atom_begin -> atom_entry* -> atom_end.

dependencies 3 imports · 0 importers

syscalls.nx html_escape.nx iso8601.nx atom.nx

imports: syscalls.nxhtml_escape.nxiso8601.nx

imported by: nobody (leaf or entry point)

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

main atom_begin atom_put atom_put_escaped html_escape he_is_safe he_put atom_put_iso iso_format_unix civil_from_unix cd_fdiv cd_fmod cd_fdiv ↻ iso_format iso_put_4d iso_put_2d atom_end atom_put ↻

structs

none

consts

41const ATOM_ERR_SHORT: i64 = -1

functions

43func atom_put(out: *u8, cap: i64, off: i64,
54func atom_put_escaped(out: *u8, cap: i64, off: i64,
called by 2: atom_beginatom_entry calls 1: html_escape
62func atom_put_iso(out: *u8, cap: i64, off: i64, unix_sec: i64) -> i64 {
69func atom_begin(out: *u8, cap: i64, off: i64,
110func atom_entry(out: *u8, cap: i64, off: i64,
148func atom_end(out: *u8, cap: i64, off: i64) -> i64 {
153func main() -> i64 {