Esc

write_page

procedureextensionexperimentalsince 0.36.1Source
  • macOS: write_page works on macOS
  • Linux: write_page works on Linux
  • Windows: write_page works on Windows
  • Wasm: write_page is not available on Wasm

Writes a page as <path>.html (the root page, with an empty path, as index.html) and copies its unescaped links into writer-owned storage. Paths are relative and have no trailing / or .html, so a page is served at its path without an extension; each page path has one producer.

Signature

write_page :: (w: *Writer, path: string, out: *Out) -> bool
Example
w := writer_init("unused", "/", true);
defer deinit(*w);
out: Out;
defer deinit(*out);
html(*out, "<p>Hi</p>");
assert(write_page(*w, "api", *out));

See also