Function aurelius::markdown::to_html_external [] [src]

pub fn to_html_external(command: Command, markdown: &str) -> Result<String>

Renders a markdown string to an HTML string using an external process.

The process should listen for markdown on stdin and output HTML on stdout.

Notes

The output must be encoded as UTF-8.

Examples

use std::process::Command;

use aurelius::markdown;

let mut pandoc = Command::new("pandoc");
pandoc.args(&["-f", "markdown"]).args(&["-t", "html"]);

let html = markdown::to_html_external(pandoc, "# Hello, world!")
    .expect("error executing process");
println!("{}", html);