Struct pandoc_filter_diagram::DiagramFilter
source · [−]pub struct DiagramFilter { /* private fields */ }
Expand description
Convert inline diagram markup as images for Pandoc.
This acts a filter on the Pandoc Abstract Syntax Tree (AST), to
modify it so that any inline markup for diagrams are rendered as
SVG images. The library is meant to be used with the
pandoc_ast::filter
function.
Filtering may fail. Because of the API constrain imposed by
pandoc_ast::filter
, this library doesn’t return a Result
.
Instead, it collects any errors and lets the caller query for them
after the filtering is done (see the
errors
method). All errors are always
rendered as text in the document as well, but that requires a
human to read the document to spot any errors.
Implementations
sourceimpl DiagramFilter
impl DiagramFilter
sourcepub fn filter(&mut self, doc: Pandoc) -> Pandoc
pub fn filter(&mut self, doc: Pandoc) -> Pandoc
Process a parsed document to convert inline diagram markup
into SVG. This method is suitable to be passed to
pandoc_ast::filter
as the filter function argument.
sourcepub fn errors(&self) -> &[DiagramError]
pub fn errors(&self) -> &[DiagramError]
Return any errors that occurred during the filtering process. The caller can decide how to report them to the user in a suitable way.
sourcepub fn dot_path<P>(&mut self, path: P) -> &mut Self where
P: AsRef<Path>,
pub fn dot_path<P>(&mut self, path: P) -> &mut Self where
P: AsRef<Path>,
Set the name by which to invoke Graphviz dot
program. The
default is “dot
”.
sourcepub fn java_path<P>(&mut self, path: P) -> &mut Self where
P: AsRef<Path>,
pub fn java_path<P>(&mut self, path: P) -> &mut Self where
P: AsRef<Path>,
Set the name by which to invoke the Java runtime, for
PlantUML. The default is “java
”.
sourcepub fn plantuml_jar<P>(&mut self, path: P) -> &mut Self where
P: AsRef<Path>,
pub fn plantuml_jar<P>(&mut self, path: P) -> &mut Self where
P: AsRef<Path>,
Set the location of the PlantUML jar (Java bytecode archive).
The default is “/usr/share/plantuml/plantuml.jar
”.
sourcepub fn roadmap_width(&mut self, w: usize) -> &mut Self
pub fn roadmap_width(&mut self, w: usize) -> &mut Self
Set the maximum width, in characters, of the roadmap text nodes. The default is 50.
Trait Implementations
sourceimpl Debug for DiagramFilter
impl Debug for DiagramFilter
sourceimpl Default for DiagramFilter
impl Default for DiagramFilter
sourceimpl MutVisitor for DiagramFilter
impl MutVisitor for DiagramFilter
fn visit_block(&mut self, block: &mut Block)
fn visit_attr(
&mut self,
attr: &mut (String, Vec<String, Global>, Vec<(String, String), Global>)
)
fn visit_inline(&mut self, inline: &mut Inline)
fn visit_meta(&mut self, _key: &str, meta: &mut MetaValue)
fn visit_vec_block(&mut self, vec_block: &mut Vec<Block, Global>)
fn visit_vec_inline(&mut self, vec_inline: &mut Vec<Inline, Global>)
fn visit_rows(
&mut self,
rows: &mut Vec<((String, Vec<String, Global>, Vec<(String, String), Global>), Vec<((String, Vec<String, Global>, Vec<(String, String), Global>), Alignment, i64, i64, Vec<Block, Global>), Global>), Global>
)
fn walk_meta(&mut self, meta: &mut MetaValue)
fn walk_pandoc(&mut self, pandoc: &mut Pandoc)
fn walk_block(&mut self, block: &mut Block)
fn walk_attr(
&mut self,
_attr: &mut (String, Vec<String, Global>, Vec<(String, String), Global>)
)
fn walk_inline(&mut self, inline: &mut Inline)
fn walk_rows(
&mut self,
rows: &mut Vec<((String, Vec<String, Global>, Vec<(String, String), Global>), Vec<((String, Vec<String, Global>, Vec<(String, String), Global>), Alignment, i64, i64, Vec<Block, Global>), Global>), Global>
)
fn walk_vec_block(&mut self, vec_block: &mut Vec<Block, Global>)
fn walk_vec_inline(&mut self, vec_inline: &mut Vec<Inline, Global>)
Auto Trait Implementations
impl !RefUnwindSafe for DiagramFilter
impl Send for DiagramFilter
impl Sync for DiagramFilter
impl Unpin for DiagramFilter
impl !UnwindSafe for DiagramFilter
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more