pub fn to_html_external(mut command: Command, markdown: &str) -> Result<String> {
    let child = command
        .stdin(Stdio::piped())
        .stdout(Stdio::piped())
        .spawn()?;

    child.stdin.unwrap().write_all(markdown.as_bytes())?;

    let mut html = String::new();
    child.stdout.unwrap().read_to_string(&mut html)?;

    Ok(html)
}
/// 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
///
/// ```no_run
/// 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);
/// ```
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.
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 .
pub fn to_html_external(mut command: Command, markdown: &str) -> Result<String> {
    let child = command
        .stdin(Stdio::piped())
        .stdout(Stdio::piped())
        .spawn()?;
    child.stdin.unwrap().write_all(markdown.as_bytes())?;
    let mut html = String::new();
    child.stdout.unwrap().read_to_string(&mut html)?;
    Ok(html)
}
pub fn to_html_external ( mut command : Command , markdown : & str ) -> Result < String > { let child = command . stdin ( Stdio :: piped ( ) ) . stdout ( Stdio :: piped ( ) ) . spawn ( ) ? ; child . stdin . unwrap ( ) . write_all ( markdown . as_bytes ( ) ) ? ; let mut html = String :: new ( ) ; child . stdout . unwrap ( ) . read_to_string ( & mut html ) ? ; Ok ( html ) }
Renders a markdown string to an HTML string using an external process.
Renders a markdown string to an HTML string using an external process .
command
Command
markdown
&str
command
Command
markdown
&str
notes
The output must be encoded as UTF-8.
The output must be encoded as UTF - 8 .
examples
```no_run
use std::process::Command.

use aurelius::markdown.



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