[−][src]Struct mdbook::renderer::CmdRenderer
A generic renderer which will shell out to an arbitrary executable.
Rendering Protocol
When the renderer's render() method is invoked, CmdRenderer will spawn
the cmd as a subprocess. The RenderContext is passed to the subprocess
as a JSON string (using serde_json).
Note: The command used doesn't necessarily need to be a single executable (i.e.
/path/to/renderer). Thecmdstring lets you pass in command line arguments, so there's no reason why it couldn't bepython /path/to/renderer --from mdbook --to epub.
Anything the subprocess writes to stdin or stdout will be passed through
to the user. While this gives the renderer maximum flexibility to output
whatever it wants, to avoid spamming users it is recommended to avoid
unnecessary output.
To help choose the appropriate output level, the RUST_LOG environment
variable will be passed through to the subprocess, if set.
If the subprocess wishes to indicate that rendering failed, it should exit with a non-zero return code.
Methods
impl CmdRenderer[src]
pub fn new(name: String, cmd: String) -> CmdRenderer[src]
Create a new CmdRenderer which will invoke the provided cmd string.
Trait Implementations
impl Renderer for CmdRenderer[src]
impl Clone for CmdRenderer[src]
fn clone(&self) -> CmdRenderer[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl PartialEq<CmdRenderer> for CmdRenderer[src]
fn eq(&self, other: &CmdRenderer) -> bool[src]
fn ne(&self, other: &CmdRenderer) -> bool[src]
impl Debug for CmdRenderer[src]
Auto Trait Implementations
impl Send for CmdRenderer
impl Sync for CmdRenderer
impl Unpin for CmdRenderer
impl UnwindSafe for CmdRenderer
impl RefUnwindSafe for CmdRenderer
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,