Skip to main content

mos_html/
lib.rs

1//! Semantic HTML backend (manifest §21.2).
2//!
3//! Output preserves document semantics (`<section>`, `<figure>`,
4//! `<figcaption>`, …) rather than absolute-positioned rectangles.
5
6#![doc(
7    html_logo_url = "https://mosaiclang.dev/assets/A4.svg",
8    html_favicon_url = "https://mosaiclang.dev/assets/A4.svg"
9)]
10
11use std::path::Path;
12
13use mos_core::{CoreError, Result};
14use mos_layout::PageGraph;
15
16/// Emit a `PageGraph` as an HTML file. Stub.
17///
18/// # Errors
19///
20/// Always returns [`CoreError::Unimplemented`] until the HTML backend ships.
21///
22/// # Examples
23///
24/// ```no_run
25/// use std::path::Path;
26///
27/// use mos_layout::PageGraph;
28///
29/// let graph = PageGraph::default();
30/// let result = mos_html::emit(&graph, Path::new("build/main.html"));
31///
32/// assert!(result.is_err());
33/// ```
34pub const fn emit(_graph: &PageGraph, _out: &Path) -> Result<()> {
35    Err(CoreError::Unimplemented("mos-html::emit"))
36}