aboutsummaryrefslogtreecommitdiff
path: root/server/tools/src/diagram_layout.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-09-21 16:39:46 +0200
committermetamuffin <metamuffin@disroot.org>2025-09-21 16:39:49 +0200
commit0ac9cedb4bd6a1a9bf3cbc04c3529b7881e1fec8 (patch)
tree5bec367345163776b2e526f41a5d5aab91107e6d /server/tools/src/diagram_layout.rs
parent829a20227e23ed45ae4949d19160bc412916b2ad (diff)
downloadhurrycurry-0ac9cedb4bd6a1a9bf3cbc04c3529b7881e1fec8.tar
hurrycurry-0ac9cedb4bd6a1a9bf3cbc04c3529b7881e1fec8.tar.bz2
hurrycurry-0ac9cedb4bd6a1a9bf3cbc04c3529b7881e1fec8.tar.zst
start book html exporter
Diffstat (limited to 'server/tools/src/diagram_layout.rs')
-rw-r--r--server/tools/src/diagram_layout.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/server/tools/src/diagram_layout.rs b/server/tools/src/diagram_layout.rs
index e6ae2d76..73bfcb96 100644
--- a/server/tools/src/diagram_layout.rs
+++ b/server/tools/src/diagram_layout.rs
@@ -41,10 +41,14 @@ pub fn diagram_layout(diagram: &mut Diagram) -> Result<()> {
let mut out = String::new();
writeln!(out, "digraph {{")?;
+ for (i, _) in diagram.nodes.iter().enumerate() {
+ writeln!(out, "k{i} [width=2, height=2]")?;
+ }
for edge in &diagram.edges {
writeln!(out, "k{} -> k{}", edge.src, edge.dst)?;
}
writeln!(out, "}}")?;
+ println!("{out}");
child.stdin.as_mut().unwrap().write_all(out.as_bytes())?;
let output = child.wait_with_output()?;