Skip to main content

render_with

Function render_with 

Source
pub fn render_with(src: &str, ctx: &MdCtx) -> String
Expand description

Render src to HTML with link bases from ctx.

ยงExamples

use solid_pod_rs_forge::markdown::{render_with, MdCtx};
let ctx = MdCtx { raw_base: "/raw".into(), blob_base: "/blob".into() };
let html = render_with("[doc](docs/notes.txt)", &ctx);
assert!(html.contains("<a href=\"/blob/docs/notes.txt\">doc</a>"));