Skip to content

Commit 2799554

Browse files
authored
Merge pull request #20 from zarhus/zdm2_opening_and_closing
ZDM#2 opening and closing presentations
2 parents 9480012 + 89e8610 commit 2799554

27 files changed

+825
-136
lines changed

.markdownlint.yaml

Lines changed: 34 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
# Default state for all rules
66
default: false
77

8-
MD001: false # Heading increment
9-
108
# MD002/first-heading-h1/first-header-h1 - First heading should be a top-level heading
119
MD002:
1210
# Heading level
@@ -17,9 +15,9 @@ MD002:
1715
MD003: false
1816

1917
# MD004/ul-style - Unordered list style
20-
MD004:
21-
# List style
22-
style: "sublist"
18+
# MD004:
19+
# # List style
20+
# style: "sublist"
2321

2422
# MD005/list-indent - Inconsistent indentation for list items at the same level
2523
MD005: true
@@ -30,7 +28,7 @@ MD006: true
3028
# MD007/ul-indent - Unordered list indentation
3129
MD007:
3230
# Spaces for indent
33-
indent: 4
31+
indent: 2
3432
# Whether to indent the first level of the list
3533
start_indented: false
3634

@@ -58,24 +56,25 @@ MD012:
5856
# Consecutive blank lines
5957
maximum: 1
6058
# MD013/line-length - Line length
61-
#
62-
MD013:
63-
# Number of characters
64-
line_length: 80
65-
# Number of characters for headings
66-
heading_line_length: 80
67-
# Number of characters for code blocks
68-
code_block_line_length: 160
69-
# Include code blocks
70-
code_blocks: false
71-
# Include tables
72-
tables: false
73-
# Include headings
74-
headings: true
75-
# Strict length checking (e.g. allow for longer URLs)
76-
strict: false
77-
# Stern length checking
78-
stern: false
59+
# FIXME: disable this check right now, as there is some stuff to fix first.
60+
# Maybe it does not make that much sense for presentations?
61+
# MD013:
62+
# # Number of characters
63+
# line_length: 80
64+
# # Number of characters for headings
65+
# heading_line_length: 80
66+
# # Number of characters for code blocks
67+
# code_block_line_length: 160
68+
# # Include code blocks
69+
# code_blocks: false
70+
# # Include tables
71+
# tables: false
72+
# # Include headings
73+
# headings: true
74+
# # Strict length checking (e.g. allow for longer URLs)
75+
# strict: false
76+
# # Stern length checking
77+
# stern: false
7978

8079
# MD014/commands-show-output - Dollar signs used before commands without showing output
8180
# TODO: set false for now but we should consider enabling it
@@ -94,9 +93,13 @@ MD022: false
9493
# MD023/heading-start-left/header-start-left - Headings must start at the beginning of the line
9594
MD023: true
9695

97-
MD025: false # Allow multiple h1
96+
# MD025/single-title/single-h1 - Multiple top-level headings in the same document
97+
# TODO: consider enabling it
9898

99-
MD026: false # Trailing punctation in heading
99+
# MD026/no-trailing-punctuation - Trailing punctuation in heading
100+
MD026:
101+
# Punctuation characters
102+
punctuation: ".,;:!。,;:!"
100103

101104
# MD027/no-multiple-space-blockquote - Multiple spaces after blockquote symbol
102105
MD027: true
@@ -120,15 +123,12 @@ MD030:
120123
# Spaces for multi-line ordered list items
121124
ol_multi: 1
122125

123-
# MD031/blanks-around-fences - Fenced code blocks should be surrounded by blank lines
124-
MD031:
125-
# Include list items
126-
list_items: true
127-
128-
MD033: false # Allow inline HTML
126+
# MD033/no-inline-html - Inline HTML
127+
# slidev superpowers are in inline html, so it has to be allowed
128+
MD033: false
129129

130130
# MD034/no-bare-urls - Bare URL used
131-
MD034: true
131+
MD034: false
132132

133133
# MD035/hr-style - Horizontal rule style
134134
MD035:
@@ -142,19 +142,14 @@ MD037: true
142142
MD038: true
143143

144144
# MD039/no-space-in-links - Spaces inside link text
145-
MD039: false
145+
MD039: true
146146

147147
# MD040/fenced-code-language - Fenced code blocks should have a language specified
148148
MD040: true
149149

150-
# MD041/first-line-heading/first-line-h1 - First line in a file should be a top-level heading
151-
MD041: false
152-
153150
# MD042/no-empty-links - No empty links
154151
MD042: true
155152

156-
MD045: false # Allow no alt text
157-
158153
# MD046/code-block-style - Code block style
159154
MD046:
160155
# Block style

.pre-commit-config.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2025 3mdeb <[email protected]>
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
15
---
26
default_stages: [pre-commit]
37

@@ -8,15 +12,14 @@ exclude: ^hooks/test/
812
ci:
913
autoupdate_commit_msg: 'pre-commit: autoupdate hooks'
1014
autofix_prs: false
11-
# shellcheck requires docker, which is not available on pre-commit.ci
15+
# docker is not supported on pre-commit.ci
1216
skip: [shellcheck]
1317

1418
repos:
1519
- repo: https://github.com/pre-commit/pre-commit-hooks
1620
rev: v5.0.0
1721
hooks:
1822
- id: check-added-large-files
19-
args: ['--maxkb=1024']
2023
- id: check-merge-conflict
2124
- id: check-symlinks
2225
- id: detect-private-key
@@ -35,6 +38,7 @@ repos:
3538
rev: v2.4.1
3639
hooks:
3740
- id: codespell
41+
args: ['--config', '.codespellrc']
3842
exclude: >
3943
(?x)^(
4044
.*\.svg|
@@ -62,4 +66,4 @@ repos:
6266
- repo: https://github.com/psf/black
6367
rev: 25.1.0
6468
hooks:
65-
- id: black
69+
- id: black

diagrams/dts_releases.py

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#!/usr/bin/env python3
2+
3+
# SPDX-FileCopyrightText: 2024 3mdeb <[email protected]>
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
import matplotlib.pyplot as plt
7+
8+
dts = {}
9+
10+
# Dasharo Tools Suite
11+
dts["v1.2.8"] = 23 # wic+iso
12+
dts["v1.2.13"] = 50
13+
dts["v1.2.14"] = 49
14+
dts["v1.2.15"] = 23
15+
dts["v1.2.16"] = 37
16+
dts["v1.2.17"] = 37
17+
dts["v1.2.18"] = 158
18+
dts["v1.2.19"] = 132
19+
dts["v1.2.20"] = 46 # only wic
20+
dts["v1.2.21"] = 200
21+
dts["v1.2.22"] = 8
22+
dts["v1.2.23"] = 131
23+
dts["v2.0.0"] = 221
24+
dts["v2.1.0"] = 31
25+
dts["v2.1.1"] = 51
26+
dts["v2.1.2"] = 21
27+
dts["v2.1.3"] = 606
28+
dts["v2.2.0"] = 51
29+
dts["v2.2.1"] = 87
30+
dts["v2.3.0"] = 24
31+
dts["v2.4.0"] = 106
32+
dts["v2.5.0"] = 100
33+
34+
releases = list(dts.keys())
35+
dts_values = list(dts.values())
36+
37+
plt.figure(figsize=(12, 7))
38+
39+
bars_dts = plt.bar(
40+
releases,
41+
dts_values,
42+
color="#38d430",
43+
label="Dasharo Tools Suite Releases",
44+
)
45+
46+
plt.xticks(rotation=30, ha="right")
47+
48+
plt.title(
49+
"Number of DTS Public Releases Downloads per version",
50+
fontsize=18,
51+
fontweight="bold",
52+
color="#272727",
53+
)
54+
plt.xlabel("Version", fontsize=16, fontweight="bold", color="#272727")
55+
plt.ylabel("Number of Downloads", fontsize=16, fontweight="bold", color="#272727")
56+
57+
# Add sum on top of stacked bars
58+
for i in range(len(releases)):
59+
if dts_values[i] != 0:
60+
total = dts_values[i]
61+
plt.annotate(
62+
f"{total}",
63+
xy=(
64+
bars_dts[i].get_x() + bars_dts[i].get_width() / 2,
65+
bars_dts[i].get_y() + bars_dts[i].get_height(),
66+
),
67+
xytext=(0, 3), # 3 points vertical offset
68+
textcoords="offset points",
69+
ha="center",
70+
va="bottom",
71+
color="black",
72+
fontsize=14,
73+
fontweight="bold",
74+
)
75+
76+
plt.legend(fontsize=12)
77+
78+
plt.gca().set_facecolor("#f5f5f5")
79+
80+
plt.savefig("img/zdm_2/dts_release_downloads.png", dpi=300)
81+
82+
plt.close()

diagrams/gh_rel.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/usr/bin/env python3
2+
import argparse
3+
import os
4+
import sys
5+
6+
import requests
7+
8+
9+
def fetch_releases(repo, token=None):
10+
"""Yield release dictionaries from the GitHub API, handling pagination."""
11+
url = f"https://api.github.com/repos/{repo}/releases"
12+
headers = {"Accept": "application/vnd.github+json"}
13+
if token:
14+
headers["Authorization"] = f"token {token}"
15+
page = 1
16+
while True:
17+
resp = requests.get(
18+
url, headers=headers, params={"per_page": 100, "page": page}, timeout=30
19+
)
20+
resp.raise_for_status()
21+
data = resp.json()
22+
if not data:
23+
break
24+
for release in data:
25+
yield release
26+
page += 1
27+
28+
29+
def main() -> None:
30+
parser = argparse.ArgumentParser(
31+
description="Print download counts for every release in a GitHub repository"
32+
)
33+
parser.add_argument("repo", help="repository in the form owner/name")
34+
parser.add_argument(
35+
"--token", help="GitHub personal access token " "(or set GITHUB_TOKEN)"
36+
)
37+
parser.add_argument(
38+
"--per-asset", action="store_true", help="show counts for each asset as well"
39+
)
40+
args = parser.parse_args()
41+
42+
token = args.token or os.getenv("GITHUB_TOKEN")
43+
try:
44+
for rel in fetch_releases(args.repo, token):
45+
tag = rel.get("tag_name") or rel.get("name") or "<no-tag>"
46+
assets = rel.get("assets", [])
47+
total = sum(asset.get("download_count", 0) for asset in assets)
48+
print(f"{tag}: {total} downloads")
49+
if args.per_asset:
50+
for asset in assets:
51+
name = asset.get("name", "<unnamed>")
52+
count = asset.get("download_count", 0)
53+
print(f" {name}: {count}")
54+
except requests.HTTPError as e:
55+
sys.exit(f"GitHub API error: {e.response.status_code} {e.response.reason}")
56+
except requests.RequestException as e:
57+
sys.exit(f"Network error: {e}")
58+
59+
60+
if __name__ == "__main__":
61+
main()

diagrams/rte_releases.py

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/usr/bin/env python3
2+
3+
# SPDX-FileCopyrightText: 2024 3mdeb <[email protected]>
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
import matplotlib.pyplot as plt
7+
8+
rte = {}
9+
10+
# RTE OS
11+
rte["v0.7.1"] = 19
12+
rte["v0.7.3"] = 35
13+
rte["v0.7.4"] = 11
14+
rte["v0.7.5"] = 33
15+
rte["v0.8.0-rc1"] = 10
16+
17+
releases = list(rte.keys())
18+
rte_values = list(rte.values())
19+
20+
plt.figure(figsize=(12, 7))
21+
22+
bars_rte = plt.bar(
23+
releases,
24+
rte_values,
25+
color="#38d430",
26+
label="RTE OS Releases",
27+
)
28+
29+
plt.xticks(rotation=30, ha="right")
30+
31+
plt.title(
32+
"Number of rte Public Releases Downloads per version",
33+
fontsize=18,
34+
fontweight="bold",
35+
color="#272727",
36+
)
37+
plt.xlabel("Version", fontsize=16, fontweight="bold", color="#272727")
38+
plt.ylabel("Number of Downloads", fontsize=16, fontweight="bold", color="#272727")
39+
40+
# Add sum on top of stacked bars
41+
for i in range(len(releases)):
42+
if rte_values[i] != 0:
43+
total = rte_values[i]
44+
plt.annotate(
45+
f"{total}",
46+
xy=(
47+
bars_rte[i].get_x() + bars_rte[i].get_width() / 2,
48+
bars_rte[i].get_y() + bars_rte[i].get_height(),
49+
),
50+
xytext=(0, 3), # 3 points vertical offset
51+
textcoords="offset points",
52+
ha="center",
53+
va="bottom",
54+
color="black",
55+
fontsize=14,
56+
fontweight="bold",
57+
)
58+
59+
plt.legend(fontsize=12)
60+
61+
plt.gca().set_facecolor("#f5f5f5")
62+
63+
plt.savefig("img/zdm_2/rte_release_downloads.png", dpi=300)
64+
65+
plt.close()

0 commit comments

Comments
 (0)