Skip to main content

build_zip_from_html

Function build_zip_from_html 

Source
pub fn build_zip_from_html(html: &str, base_url: &str) -> Result<Vec<u8>>
Expand description

Build a default --format archive ZIP (Vec<u8>) from raw HTML.

The archive contains exactly:

  • document.md — markdown that references images by relative path to the bundled images/ folder.
  • document.html — the source HTML the markdown was derived from, for reference only (so reviewers can verify the conversion).
  • images/ — every inline base64 image as a separate file, in its original format (PNG/JPEG/SVG…).

§Arguments

  • html - Source HTML to convert.
  • base_url - Base URL used to resolve relative links during conversion.

§Errors

Returns an error if HTML→Markdown conversion or ZIP creation fails.