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§
Source§impl 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
pub fn dot_path<P>(&mut self, path: P) -> &mut Self
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
pub fn java_path<P>(&mut self, path: P) -> &mut Self
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
pub fn plantuml_jar<P>(&mut self, path: P) -> &mut Self
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.