From 7efd5e294bb2b814803d9555457c1163716bbf0d Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Fri, 18 Nov 2022 11:57:56 +0100 Subject: [PATCH] chore: use Iosevka as a default font MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Use Iosevka as a default font (with few reasonable fallbacks) • Introduce a „steam machine“ for regenerating graphviz files · Use same monospace fonts for graphviz too Signed-off-by: Matej Focko --- ib002/03-time-complexity/extend.md | 2 +- makefile | 5 +- regenerate-dots.sh | 8 + src/css/custom.css | 4 + static/files/ib002/bfs-tree/bfs_graph.dot | 17 ++ static/files/ib002/bfs-tree/bfs_graph.svg | 81 ++++---- .../bfs_graph_with_additional_edge.dot | 18 ++ .../bfs_graph_with_additional_edge.svg | 85 ++++---- static/files/ib002/bfs-tree/bfs_tree.dot | 13 ++ static/files/ib002/bfs-tree/bfs_tree.svg | 87 ++++---- .../bfs_tree_with_additional_edge.dot | 12 ++ .../bfs_tree_with_additional_edge.svg | 87 ++++---- static/files/ib002/extend/construction.dot | 25 +++ static/files/ib002/extend/construction.svg | 194 ++++++++++++++++++ static/files/ib002/extend/rendered.svg | 192 ----------------- 15 files changed, 468 insertions(+), 362 deletions(-) create mode 100644 regenerate-dots.sh create mode 100644 static/files/ib002/bfs-tree/bfs_graph.dot create mode 100644 static/files/ib002/bfs-tree/bfs_graph_with_additional_edge.dot create mode 100644 static/files/ib002/bfs-tree/bfs_tree.dot create mode 100644 static/files/ib002/bfs-tree/bfs_tree_with_additional_edge.dot create mode 100644 static/files/ib002/extend/construction.dot create mode 100644 static/files/ib002/extend/construction.svg delete mode 100644 static/files/ib002/extend/rendered.svg diff --git a/ib002/03-time-complexity/extend.md b/ib002/03-time-complexity/extend.md index 8dd2392..d348e46 100644 --- a/ib002/03-time-complexity/extend.md +++ b/ib002/03-time-complexity/extend.md @@ -78,7 +78,7 @@ As we could observe in the example above, `extend` iterates over all of the elem Consider constructing of this list: -![Rendered construction of the list](/files/ib002/extend/rendered.svg) +![Rendered construction of the list](/files/ib002/extend/construction.svg)
Source for the rendered construction of the list diff --git a/makefile b/makefile index a0775dd..52e93dc 100644 --- a/makefile +++ b/makefile @@ -11,4 +11,7 @@ deploy-poincare: deploy: deploy-aisa deploy-poincare -.PHONY: deploy-aisa deploy-poincare +regenerate-dots: + bash regenerate-dots.sh + +.PHONY: deploy-aisa deploy-poincare regenerate-dots diff --git a/regenerate-dots.sh b/regenerate-dots.sh new file mode 100644 index 0000000..a4e9c79 --- /dev/null +++ b/regenerate-dots.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +FONT="Iosevka,'Iosevka Term','Cascadia Code','JetBrains Mono','Fira Code',monospace" + +for pic in $(find ./static/files -name '*.dot' -print); do + SVG_NAME=".$(echo $pic | cut -d'.' -f2).svg" + dot $pic -Tsvg -Gfontname="$FONT" -Nfontname="$FONT" -Efontname="$FONT" > $SVG_NAME +done; \ No newline at end of file diff --git a/src/css/custom.css b/src/css/custom.css index 3859140..b19f6ab 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -28,3 +28,7 @@ --ifm-color-primary-lightest: #4fddbf; --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3); } + +pre, code, kbd, var, tt { + font-family: Iosevka, 'Iosevka Term', 'Cascadia Code', 'JetBrains Mono', 'Fira Code', monospace; +} \ No newline at end of file diff --git a/static/files/ib002/bfs-tree/bfs_graph.dot b/static/files/ib002/bfs-tree/bfs_graph.dot new file mode 100644 index 0000000..abaefdf --- /dev/null +++ b/static/files/ib002/bfs-tree/bfs_graph.dot @@ -0,0 +1,17 @@ +graph { + a -- c + a -- e + + c -- i + c -- b + + e -- j + + i -- d + + b -- h + + d -- h + + h -- j +} \ No newline at end of file diff --git a/static/files/ib002/bfs-tree/bfs_graph.svg b/static/files/ib002/bfs-tree/bfs_graph.svg index ec38d6f..2cb753b 100644 --- a/static/files/ib002/bfs-tree/bfs_graph.svg +++ b/static/files/ib002/bfs-tree/bfs_graph.svg @@ -1,104 +1,105 @@ - - - - + + -%0 - + a - -a + +a c - -c + +c -a--c - +a--c + e - -e + +e -a--e - +a--e + i - -i + +i -c--i - +c--i + b - -b + +b -c--b - +c--b + j - -j + +j -e--j - +e--j + d - -d + +d -i--d - +i--d + h - -h + +h -b--h - +b--h + -d--h - +d--h + -h--j - +h--j + diff --git a/static/files/ib002/bfs-tree/bfs_graph_with_additional_edge.dot b/static/files/ib002/bfs-tree/bfs_graph_with_additional_edge.dot new file mode 100644 index 0000000..b242f2e --- /dev/null +++ b/static/files/ib002/bfs-tree/bfs_graph_with_additional_edge.dot @@ -0,0 +1,18 @@ +graph { + a -- c + a -- e + + c -- i + c -- b + + e -- j + e -- h + + i -- d + + b -- h + + d -- h + + h -- j +} \ No newline at end of file diff --git a/static/files/ib002/bfs-tree/bfs_graph_with_additional_edge.svg b/static/files/ib002/bfs-tree/bfs_graph_with_additional_edge.svg index 1cee56e..0bcc7e8 100644 --- a/static/files/ib002/bfs-tree/bfs_graph_with_additional_edge.svg +++ b/static/files/ib002/bfs-tree/bfs_graph_with_additional_edge.svg @@ -1,109 +1,110 @@ - - - - + + -%0 - + a - -a + +a c - -c + +c -a--c - +a--c + e - -e + +e -a--e - +a--e + i - -i + +i -c--i - +c--i + b - -b + +b -c--b - +c--b + j - -j + +j -e--j - +e--j + h - -h + +h -e--h - +e--h + d - -d + +d -i--d - +i--d + -b--h - +b--h + -h--j - +h--j + -d--h - +d--h + diff --git a/static/files/ib002/bfs-tree/bfs_tree.dot b/static/files/ib002/bfs-tree/bfs_tree.dot new file mode 100644 index 0000000..b964dd6 --- /dev/null +++ b/static/files/ib002/bfs-tree/bfs_tree.dot @@ -0,0 +1,13 @@ +digraph { + a -> c + a -> e + + c -> b + c -> i + + e -> j + + b -> h + + i -> d +} \ No newline at end of file diff --git a/static/files/ib002/bfs-tree/bfs_tree.svg b/static/files/ib002/bfs-tree/bfs_tree.svg index 968c9ed..ee67d36 100644 --- a/static/files/ib002/bfs-tree/bfs_tree.svg +++ b/static/files/ib002/bfs-tree/bfs_tree.svg @@ -1,101 +1,102 @@ - - - - + + -%0 - + a - -a + +a c - -c + +c -a->c - - +a->c + + e - -e + +e -a->e - - +a->e + + b - -b + +b -c->b - - +c->b + + i - -i + +i -c->i - - +c->i + + j - -j + +j -e->j - - +e->j + + h - -h + +h -b->h - - +b->h + + d - -d + +d -i->d - - +i->d + + diff --git a/static/files/ib002/bfs-tree/bfs_tree_with_additional_edge.dot b/static/files/ib002/bfs-tree/bfs_tree_with_additional_edge.dot new file mode 100644 index 0000000..280cf15 --- /dev/null +++ b/static/files/ib002/bfs-tree/bfs_tree_with_additional_edge.dot @@ -0,0 +1,12 @@ +digraph { + a -> c + a -> e + + c -> b + c -> i + + e -> h + e -> j + + i -> d +} \ No newline at end of file diff --git a/static/files/ib002/bfs-tree/bfs_tree_with_additional_edge.svg b/static/files/ib002/bfs-tree/bfs_tree_with_additional_edge.svg index eb83336..5988d13 100644 --- a/static/files/ib002/bfs-tree/bfs_tree_with_additional_edge.svg +++ b/static/files/ib002/bfs-tree/bfs_tree_with_additional_edge.svg @@ -1,101 +1,102 @@ - - - - + + -%0 - + a - -a + +a c - -c + +c -a->c - - +a->c + + e - -e + +e -a->e - - +a->e + + b - -b + +b -c->b - - +c->b + + i - -i + +i -c->i - - +c->i + + h - -h + +h -e->h - - +e->h + + j - -j + +j -e->j - - +e->j + + d - -d + +d -i->d - - +i->d + + diff --git a/static/files/ib002/extend/construction.dot b/static/files/ib002/extend/construction.dot new file mode 100644 index 0000000..357e4de --- /dev/null +++ b/static/files/ib002/extend/construction.dot @@ -0,0 +1,25 @@ +digraph G { + node [shape=record]; + + a_node [label="1|2|3|4|5|6|7|8|9"] + + b_node [label="1|2|3"] + c_node [label="4|5|6"] + d_node [label="7|8|9"] + + a_node -> b_node [label="B"] + a_node -> c_node [label="C"] + a_node -> d_node [label="D"] + + b_node -> "1" + b_node -> "2" + b_node -> "3" + + c_node -> "4" + c_node -> "5" + c_node -> "6" + + d_node -> "7" + d_node -> "8" + d_node -> "9" +} \ No newline at end of file diff --git a/static/files/ib002/extend/construction.svg b/static/files/ib002/extend/construction.svg new file mode 100644 index 0000000..043018d --- /dev/null +++ b/static/files/ib002/extend/construction.svg @@ -0,0 +1,194 @@ + + + + + + +G + + + +a_node + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + + + +b_node + +1 + +2 + +3 + + + +a_node->b_node + + +B + + + +c_node + +4 + +5 + +6 + + + +a_node->c_node + + +C + + + +d_node + +7 + +8 + +9 + + + +a_node->d_node + + +D + + + +1 + +1 + + + +b_node->1 + + + + + +2 + +2 + + + +b_node->2 + + + + + +3 + +3 + + + +b_node->3 + + + + + +4 + +4 + + + +c_node->4 + + + + + +5 + +5 + + + +c_node->5 + + + + + +6 + +6 + + + +c_node->6 + + + + + +7 + +7 + + + +d_node->7 + + + + + +8 + +8 + + + +d_node->8 + + + + + +9 + +9 + + + +d_node->9 + + + + + diff --git a/static/files/ib002/extend/rendered.svg b/static/files/ib002/extend/rendered.svg deleted file mode 100644 index f79127a..0000000 --- a/static/files/ib002/extend/rendered.svg +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - -G - - - -a_node - -1 - -2 - -3 - -4 - -5 - -6 - -7 - -8 - -9 - - - -b_node - -1 - -2 - -3 - - - -a_node->b_node - - -B - - - -c_node - -4 - -5 - -6 - - - -a_node->c_node - - -C - - - -d_node - -7 - -8 - -9 - - - -a_node->d_node - - -D - - - -1 - -1 - - - -b_node->1 - - - - - -2 - -2 - - - -b_node->2 - - - - - -3 - -3 - - - -b_node->3 - - - - - -4 - -4 - - - -c_node->4 - - - - - -5 - -5 - - - -c_node->5 - - - - - -6 - -6 - - - -c_node->6 - - - - - -7 - -7 - - - -d_node->7 - - - - - -8 - -8 - - - -d_node->8 - - - - - -9 - -9 - - - -d_node->9 - - - - -