From a931a75c4f036f10a48aa09df09fbe04310455f1 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 15 Jul 2024 15:58:45 +0000 Subject: [PATCH] docs(GNode): Traversal diagrams, color & dark-mode * Create a dark-mode variant of each traversal diagram, with the traversal path colorized `--primary` blue, instead of the original black. * Apply the same colorizations to the light-mode diagrams, but using the light-theme `--primary` blue. * Add SPDX license/copyright comments to all eight SVG files. * Add new files to documentation configs in `glib.toml.in`. * Update documentation comment in `gnode.c` to embed both color variants via picture tags, instead of markdown image embeds. * Add alt text to all four images. * Add additional blank lines to documentation comment, so that a. First item in bulleted list does not get folded into preceding intro paragraph b. Intro paragraph and diagrams are not part of first paragraph in documentation. (This also gets them out of the top-level table-of-contents/index list, where they previously appeared in full.) * (Accidental change I didn't realize I was making): Convert line endings in breadth-first diagram from CRLF to LF. --- ...nary_tree_breadth-first_traversal-dark.svg | 138 ++++ ...ed_binary_tree_breadth-first_traversal.svg | 272 +++---- .../glib/Sorted_binary_tree_inorder-dark.svg | 758 ++++++++++++++++++ .../glib/Sorted_binary_tree_inorder.svg | 41 +- .../Sorted_binary_tree_postorder-dark.svg | 755 +++++++++++++++++ .../glib/Sorted_binary_tree_postorder.svg | 41 +- .../glib/Sorted_binary_tree_preorder-dark.svg | 755 +++++++++++++++++ .../glib/Sorted_binary_tree_preorder.svg | 41 +- docs/reference/glib/glib.toml.in | 4 + glib/gnode.c | 34 +- 10 files changed, 2645 insertions(+), 194 deletions(-) create mode 100644 docs/reference/glib/Sorted_binary_tree_breadth-first_traversal-dark.svg create mode 100644 docs/reference/glib/Sorted_binary_tree_inorder-dark.svg create mode 100644 docs/reference/glib/Sorted_binary_tree_postorder-dark.svg create mode 100644 docs/reference/glib/Sorted_binary_tree_preorder-dark.svg diff --git a/docs/reference/glib/Sorted_binary_tree_breadth-first_traversal-dark.svg b/docs/reference/glib/Sorted_binary_tree_breadth-first_traversal-dark.svg new file mode 100644 index 000000000..04c7a448b --- /dev/null +++ b/docs/reference/glib/Sorted_binary_tree_breadth-first_traversal-dark.svg @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + sorted_binary_tree + + C + + C + + + E + + E + + + H + + H + + + A + + A + + + D + + D + + + D->C + + + + + D->E + + + + + I + + I + + + I->H + + + + + B + + B + + + B->A + + + + + B->D + + + + + G + + G + + + G->I + + + + + F + + F + + + F->B + + + + + F->G + + + + + diff --git a/docs/reference/glib/Sorted_binary_tree_breadth-first_traversal.svg b/docs/reference/glib/Sorted_binary_tree_breadth-first_traversal.svg index 697d7dbb6..bb74ce5ff 100644 --- a/docs/reference/glib/Sorted_binary_tree_breadth-first_traversal.svg +++ b/docs/reference/glib/Sorted_binary_tree_breadth-first_traversal.svg @@ -1,134 +1,138 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - sorted_binary_tree - - C - - C - - - E - - E - - - H - - H - - - A - - A - - - D - - D - - - D->C - - - - - D->E - - - - - I - - I - - - I->H - - - - - B - - B - - - B->A - - - - - B->D - - - - - G - - G - - - G->I - - - - - F - - F - - - F->B - - - - - F->G - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + sorted_binary_tree + + C + + C + + + E + + E + + + H + + H + + + A + + A + + + D + + D + + + D->C + + + + + D->E + + + + + I + + I + + + I->H + + + + + B + + B + + + B->A + + + + + B->D + + + + + G + + G + + + G->I + + + + + F + + F + + + F->B + + + + + F->G + + + + + diff --git a/docs/reference/glib/Sorted_binary_tree_inorder-dark.svg b/docs/reference/glib/Sorted_binary_tree_inorder-dark.svg new file mode 100644 index 000000000..20f5fbe6b --- /dev/null +++ b/docs/reference/glib/Sorted_binary_tree_inorder-dark.svg @@ -0,0 +1,758 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + sorted_binary_tree + + C + + C + + + E + + E + + + H + + H + + + A + + A + + + D + + D + + + D->C + + + + + D->E + + + + + I + + I + + + I->H + + + + + B + + B + + + B->A + + + + + B->D + + + + + G + + G + + + G->I + + + + + F + + F + + + F->B + + + + + F->G + + + + + + + + + + + + + + + + diff --git a/docs/reference/glib/Sorted_binary_tree_inorder.svg b/docs/reference/glib/Sorted_binary_tree_inorder.svg index 3927430da..6a75e9ebe 100644 --- a/docs/reference/glib/Sorted_binary_tree_inorder.svg +++ b/docs/reference/glib/Sorted_binary_tree_inorder.svg @@ -1,6 +1,11 @@ + - @@ -44,17 +49,17 @@ @@ -70,7 +75,7 @@ @@ -83,7 +88,7 @@ style="overflow:visible"> @@ -98,7 +103,7 @@ @@ -652,7 +657,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + sorted_binary_tree + + C + + C + + + E + + E + + + H + + H + + + A + + A + + + D + + D + + + D->C + + + + + D->E + + + + + I + + I + + + I->H + + + + + B + + B + + + B->A + + + + + B->D + + + + + G + + G + + + G->I + + + + + F + + F + + + F->B + + + + + F->G + + + + + + + + + + + + + + + + diff --git a/docs/reference/glib/Sorted_binary_tree_postorder.svg b/docs/reference/glib/Sorted_binary_tree_postorder.svg index 1160e42b3..94120f5fc 100644 --- a/docs/reference/glib/Sorted_binary_tree_postorder.svg +++ b/docs/reference/glib/Sorted_binary_tree_postorder.svg @@ -1,6 +1,11 @@ + - @@ -41,17 +46,17 @@ @@ -67,7 +72,7 @@ @@ -80,7 +85,7 @@ style="overflow:visible"> @@ -95,7 +100,7 @@ @@ -649,7 +654,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + sorted_binary_tree + + C + + C + + + E + + E + + + H + + H + + + A + + A + + + D + + D + + + D->C + + + + + D->E + + + + + I + + I + + + I->H + + + + + B + + B + + + B->A + + + + + B->D + + + + + G + + G + + + G->I + + + + + F + + F + + + F->B + + + + + F->G + + + + + + + + + + + + + + + + diff --git a/docs/reference/glib/Sorted_binary_tree_preorder.svg b/docs/reference/glib/Sorted_binary_tree_preorder.svg index ae3d22cb3..e4f315b26 100644 --- a/docs/reference/glib/Sorted_binary_tree_preorder.svg +++ b/docs/reference/glib/Sorted_binary_tree_preorder.svg @@ -1,6 +1,11 @@ + - @@ -41,17 +46,17 @@ @@ -67,7 +72,7 @@ @@ -80,7 +85,7 @@ style="overflow:visible"> @@ -95,7 +100,7 @@ @@ -649,7 +654,7 @@ + * + * Sorted binary tree, in-order traversal + * * - Pre order: F, B, A, D, C, E, G, I, H - * ![](Sorted_binary_tree_preorder.svg) + * + * + * Sorted binary tree, pre-order traversal + * * - Post order: A, C, E, D, B, H, I, G, F - * ![](Sorted_binary_tree_postorder.svg) + * + * + * Sorted binary tree, post-order traversal + * * - Level order: F, B, G, A, D, I, C, E, H - * ![](Sorted_binary_tree_breadth-first_traversal.svg) + * + * + * Sorted binary tree, breadth-first level order traversal + * */ /**