Skip to content

Commit

Permalink
Display the hierarchy of non-overlapping groups as a mindmap
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeldycke committed Dec 2, 2024
1 parent ff4b773 commit eba7df1
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
> [!IMPORTANT]
> This version is not released yet and is under active development.
- Display the hierarchy of non-overlapping groups as a mindmap.
- Add URL on all platforms.
- Add support for openSUSE Tumbleweed detection. Closes #133.
- Do not allow icons on platforms and groups to be empty.
Expand Down
40 changes: 38 additions & 2 deletions extra_platforms/docs_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ def generate_platform_sankey() -> str:
output = dedent("""\
```mermaid
---
config: {"sankey": {"showValues": false, "width": 800, "height": 400}}
config:
sankey:
showValues: false
width: 800
height: 400
---
sankey-beta\n
""")
Expand All @@ -88,6 +92,29 @@ def generate_platform_sankey() -> str:
return output


def generate_platform_hierarchy() -> str:
"""Produce a mindmap hierarchy to show the non-overlapping groups."""
group_map = ""
for group in sorted(NON_OVERLAPPING_GROUPS, key=attrgetter("id"), reverse=True):
group_map += f"){group.icon} {group.id.upper()}(\n"
for platform in group.platforms:
group_map += f" ({platform.icon} {platform.id})\n"

output = dedent("""\
```mermaid
---
config:
mindmap:
padding: 5
---
mindmap
((Extra Platforms))
""")
output += indent(group_map, " " * 8)
output += "```"
return output


def generate_platforms_graph(
graph_id: str,
description: str,
Expand Down Expand Up @@ -158,14 +185,23 @@ def update_docs() -> None:
)
assert frozenset(g for groups in all_groups for g in groups["groups"]) == ALL_GROUPS

# Update the platform diagrams in readme.
# Update the Sankey diagram mapping groups to platforms.
replace_content(
project_root.joinpath("readme.md"),
"<!-- platform-sankey-start -->\n\n",
"\n\n<!-- platform-sankey-end -->",
generate_platform_sankey(),
)

# Update diagram showing the hierarchy of non-overlapping groups.
replace_content(
project_root.joinpath("readme.md"),
"<!-- platform-hierarchy-start -->\n\n",
"\n\n<!-- platform-hierarchy-end -->",
generate_platform_hierarchy(),
)

# Update grouping charts of all groups, including non-overlapping and extra groups.
platform_doc = project_root.joinpath("readme.md")
for top_groups in all_groups:
replace_content(
Expand Down
72 changes: 71 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ Relationships between groups and platforms:

```mermaid
---
config: {"sankey": {"showValues": false, "width": 800, "height": 400}}
config:
sankey:
showValues: false
width: 800
height: 400
---
sankey-beta
Expand Down Expand Up @@ -376,6 +380,72 @@ any_windows,windows,1

Each platform is assigned to a group of non-overlpaping families:

<!-- platform-hierarchy-start -->

```mermaid
---
config:
mindmap:
padding: 5
---
mindmap
((Extra Platforms))
)≛ UNIX_LAYERS(
(Ͼ cygwin)
)Ⅴ SYSTEM_V(
(➿ aix)
(🌞 solaris)
)⊎ OTHER_UNIX(
(🐃 hurd)
)≚ LINUX_LAYERS(
(⊞ wsl1)
(⊞ wsl2)
)🐧 LINUX(
(🐧 altlinux)
(🙂 amzn)
(🤖 android)
(🎗️ arch)
(⛑️ buildroot)
(💠 centos)
(꩜ cloudlinux)
(🌀 debian)
(🐽 exherbo)
(🎩 fedora)
(🗜️ gentoo)
(🐃 guix)
(🤹 ibm_powerkvm)
(🤹 kvmibm)
(🌿 linuxmint)
(⍥ mageia)
(💫 mandriva)
(🦎 opensuse)
(🦴 oracle)
(∥ parallels)
(🍓 pidora)
(🍓 raspbian)
(🎩 rhel)
(⛰️ rocky)
(⚛️ scientific)
(🚬 slackware)
(🦎 sles)
(↻ tumbleweed)
(🤵 tuxedo)
(🎯 ubuntu)
(🐧 unknown_linux)
(Ⓧ xenserver)
)🅱️+ BSD(
(😈 freebsd)
(🍎 macos)
(🌘 midnightbsd)
(🚩 netbsd)
(🐡 openbsd)
(☀️ sunos)
)🪟 ANY_WINDOWS(
(🪟 windows)
```

<!-- platform-hierarchy-end -->

<!-- NON_OVERLAPPING_GROUPS-graph-start -->

```mermaid
Expand Down

0 comments on commit eba7df1

Please sign in to comment.