summaryrefslogtreecommitdiff
path: root/src/typeset.rs
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers+gitlab@digital-scurf.org>2022-04-26 11:07:50 +0000
committerDaniel Silverstone <dsilvers+gitlab@digital-scurf.org>2022-04-26 11:07:50 +0000
commit12059fcb1ce8237e5587773043cd442e036531c2 (patch)
tree8940d4eca8c663e72cf051b22b9232eb6a84b056 /src/typeset.rs
parent924e05bc3d109340eeee7e06c6badeae12d45c10 (diff)
parent3422999e5a4fc6b08637d00cae11f523c747f036 (diff)
downloadsubplot-12059fcb1ce8237e5587773043cd442e036531c2.tar.gz
Merge branch 'liw/diagram' into 'main'
refactor: use "diagram" instead of "graph" Closes #255 See merge request subplot/subplot!273
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),