Skip to main content

convert

Function convert 

Source
pub fn convert(
    request: ConvertRequest<'_>,
) -> Result<ConvertOutcome, RenderError>
Expand description

Render one Markdown file to HTML: the render pipeline’s single deep entry point.

The workflow: read the source (and any CSS override), render and splice highlighting, sanitize (unless unsafe_html), assemble the page (unless bare), create the output’s parent directory when missing, then write the file (O_NOFOLLOW, mode 0o600 under private_output). The workflow prints nothing itself — success carries a ConvertOutcome with the written file and timing record, failure a typed RenderError — so the same workflow serves the CLI, the setup sample, and any other host, and the generated HTML is byte-identical everywhere it is invoked from.