summaryrefslogtreecommitdiff
path: root/src/typeset.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-04-26 07:48:22 +0300
committerLars Wirzenius <liw@liw.fi>2022-04-26 08:14:22 +0300
commit3422999e5a4fc6b08637d00cae11f523c747f036 (patch)
tree8940d4eca8c663e72cf051b22b9232eb6a84b056 /src/typeset.rs
parent924e05bc3d109340eeee7e06c6badeae12d45c10 (diff)
downloadsubplot-3422999e5a4fc6b08637d00cae11f523c747f036.tar.gz
refactor: use "diagram" instead of "graph"
Change everywhere to use the word "diagram" instead of "graph. Diagram seems like the better word. It's mostly used in comments and documentation, but there was one filename and one trait name that needed changing. I used "rg -iw graph" and "find -iname '*graph*'" to find everywhere that needed changing. Sponsored-by: author
Diffstat (limited to 'src/typeset.rs')
-rw-r--r--src/typeset.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/typeset.rs b/src/typeset.rs
index bc86ef8..18e5a44 100644
--- a/src/typeset.rs
+++ b/src/typeset.rs
@@ -4,7 +4,7 @@ use crate::PartialStep;
use crate::ScenarioStep;
use crate::StepKind;
use crate::SubplotError;
-use crate::{DotMarkup, GraphMarkup, PikchrMarkup, PlantumlMarkup};
+use crate::{DiagramMarkup, DotMarkup, PikchrMarkup, PlantumlMarkup};
use crate::{Warning, Warnings};
use pandoc_ast::Attr;
@@ -147,10 +147,10 @@ pub fn link_as_note(attr: Attr, text: Vec<Inline>, target: Target) -> Inline {
Inline::Span(attr, text)
}
-/// Take a pikchr graph, render it as SVG, and return an AST block element.
+/// Take a pikchr diagram, render it as SVG, and return an AST block element.
///
-/// The `Block` will contain the SVG data. This allows the graph to be
-/// rendered without referencing external entities.
+/// The `Block` will contain the SVG data. This allows the diagram to
+/// be rendered without referencing external entities.
///
/// If the code block which contained the pikchr contains other classes, they
/// can be added to the SVG for use in later typesetting etc.
@@ -164,9 +164,9 @@ pub fn pikchr_to_block(pikchr: &str, class: Option<&str>, warnings: &mut Warning
}
}
-// Take a dot graph, render it as SVG, and return an AST Block
-// element. The Block will contain the SVG data. This allows the graph
-// to be rendered without referending external entities.
+// Take a dot diagram, render it as SVG, and return an AST Block
+// element. The Block will contain the SVG data. This allows the
+// diagram to be rendered without referending external entities.
pub fn dot_to_block(dot: &str, warnings: &mut Warnings) -> Block {
match DotMarkup::new(dot).as_svg() {
Ok(svg) => typeset_svg(svg),
@@ -177,9 +177,9 @@ pub fn dot_to_block(dot: &str, warnings: &mut Warnings) -> Block {
}
}
-// Take a PlantUML graph, render it as SVG, and return an AST Block
-// element. The Block will contain the SVG data. This allows the graph
-// to be rendered without referending external entities.
+// Take a PlantUML diagram, render it as SVG, and return an AST Block
+// element. The Block will contain the SVG data. This allows the
+// diagram to be rendered without referending external entities.
pub fn plantuml_to_block(markup: &str, warnings: &mut Warnings) -> Block {
match PlantumlMarkup::new(markup).as_svg() {
Ok(svg) => typeset_svg(svg),