Skip to main content

render_with_cache

Function render_with_cache 

Source
pub async fn render_with_cache(
    file: PathBuf,
    root_path: &Path,
    oembed_timeout_ms: u64,
    link_transform_config: LinkTransformConfig,
    oembed_cache: Option<Arc<OembedCache>>,
    server_mode: bool,
    transcode_enabled: bool,
    valid_tag_sources: HashSet<String>,
    review: ReviewLines,
    mark_incomplete: bool,
    incomplete_markers: &[String],
    wikilink_index: Option<Arc<WikilinkIndex>>,
) -> Result<MarkdownRenderResult, MarkdownError>
Expand description

Renders a markdown file to HTML with optional OEmbed caching support.

Identical to render_str except that, when oembed_timeout_ms > 0, bare URLs are enriched with OpenGraph metadata fetched over the network. When oembed_cache is provided, cached results are used when available and new results are cached for future use. URLs are fetched in parallel for improved performance when multiple bare URLs are present in the document.

See RenderOptions for the parameters.