decktile 0.3.2__tar.gz → 0.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {decktile-0.3.2 → decktile-0.3.4}/PKG-INFO +31 -2
- {decktile-0.3.2 → decktile-0.3.4}/README.md +29 -0
- {decktile-0.3.2 → decktile-0.3.4}/pyproject.toml +2 -2
- decktile-0.3.4/src/decktile/chart_themes/kubecon_na.toml +30 -0
- decktile-0.3.4/src/decktile/chart_themes/ossummit_europe.toml +30 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/cli.py +5 -1
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/render/seaborn.py +72 -28
- {decktile-0.3.2 → decktile-0.3.4}/tests/test_seaborn_styles.py +40 -0
- decktile-0.3.2/src/decktile/seaborn_styles/__init__.py +0 -9
- decktile-0.3.2/src/decktile/seaborn_styles/kubecon_na.py +0 -35
- decktile-0.3.2/src/decktile/seaborn_styles/ossummit_europe.py +0 -34
- {decktile-0.3.2 → decktile-0.3.4}/LICENSE +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/NOTICE +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/__init__.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/__main__.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/assets/lucide/VENDORED.md +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/assets/lucide/lucide.css +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/assets/lucide/lucide.ttf +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/parser/__init__.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/parser/ast.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/parser/markdown.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/plugins/cards.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/plugins/directives.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/plugins/fenced.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/plugins/layouts.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/plugins/lucide.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/plugins/lucide_font.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/render/__init__.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/render/html.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/render/ir.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/render/odf/__init__.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/render/odf/geometry.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/render/odf/shapes.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/render/odf/styles.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/render/odp.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/render/pdf.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/render/pdg.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/render/templates/base.css +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/render/templates/decktile.js +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/render/templates/shell.html +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/theme/__init__.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/theme/loader.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/theme/parser.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/themes/default.css +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/themes/kcd_vietnam.css +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/themes/kubecon_china.css +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/themes/kubecon_japan.css +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/themes/kubecon_na.css +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/themes/ossummit_europe.css +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/src/decktile/themes/ossummit_korea.css +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/tests/__init__.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/tests/test_cli.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/tests/test_geometry.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/tests/test_html.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/tests/test_ir.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/tests/test_odf_shapes.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/tests/test_odp.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/tests/test_parser.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/tests/test_pdg.py +0 -0
- {decktile-0.3.2 → decktile-0.3.4}/tests/test_video.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: decktile
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: Markdown to designed slides: HTML, PDF and editable ODP
|
|
5
5
|
Author-Email: Reza Jelveh <git@jelveh.me>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -20,7 +20,7 @@ Requires-Dist: pygments-styles>=0.3.0
|
|
|
20
20
|
Requires-Dist: odfdo>=3.27.2
|
|
21
21
|
Requires-Dist: mermaidx>=0.8.1
|
|
22
22
|
Requires-Dist: python-lucide>=0.5.0
|
|
23
|
-
Requires-Dist: predictygraph>=0.3.
|
|
23
|
+
Requires-Dist: predictygraph>=0.3.1
|
|
24
24
|
Provides-Extra: plot
|
|
25
25
|
Requires-Dist: pillow>=11.0.0; extra == "plot"
|
|
26
26
|
Requires-Dist: seaborn>=0.13.2; extra == "plot"
|
|
@@ -475,6 +475,35 @@ and fonts are parsed from the `:root` block. Falls
|
|
|
475
475
|
back to seaborn palette names (`Paired` is the default, also `deep`,
|
|
476
476
|
`muted`, `pastel`, etc.) if no theme CSS matches.
|
|
477
477
|
|
|
478
|
+
Chart themes are [predictygraph](https://github.com/predictygraph/predictygraph)
|
|
479
|
+
themes, the same TOML as a diagram's `theme=`, so one file styles both.
|
|
480
|
+
`seaborn_theme: hami` uses predictygraph's bundled `hami` theme; decktile adds
|
|
481
|
+
`kubecon_na` and `ossummit_europe`, and `PDG_THEME_PATH` directories are searched
|
|
482
|
+
too. The palette sets the chart: `fg` text, `muted` ticks, `border` axes, `bg`
|
|
483
|
+
background, `bg-alt` grid, and the hues (green, blue, cyan, ...) the colour cycle.
|
|
484
|
+
|
|
485
|
+
To keep a theme in your own repo, point `seaborn_theme` (and diagram `theme=`)
|
|
486
|
+
at a `.toml` file next to the deck. An optional `[seaborn]` table, ignored by
|
|
487
|
+
predictygraph, changes the colour order and sets any matplotlib rcParam;
|
|
488
|
+
values may name palette keys:
|
|
489
|
+
|
|
490
|
+
```toml
|
|
491
|
+
# themes/brand.toml
|
|
492
|
+
schema = 1
|
|
493
|
+
extends = "hami"
|
|
494
|
+
|
|
495
|
+
[palette]
|
|
496
|
+
green = "#0f9d58"
|
|
497
|
+
|
|
498
|
+
[seaborn]
|
|
499
|
+
palette = ["green", "blue", "yellow"]
|
|
500
|
+
"grid.color" = "bg-alt"
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
```yaml
|
|
504
|
+
seaborn_theme: themes/brand.toml
|
|
505
|
+
```
|
|
506
|
+
|
|
478
507
|
### Custom charts with matplotlib
|
|
479
508
|
|
|
480
509
|
For charts beyond seaborn's high-level API, drop into matplotlib directly.
|
|
@@ -443,6 +443,35 @@ and fonts are parsed from the `:root` block. Falls
|
|
|
443
443
|
back to seaborn palette names (`Paired` is the default, also `deep`,
|
|
444
444
|
`muted`, `pastel`, etc.) if no theme CSS matches.
|
|
445
445
|
|
|
446
|
+
Chart themes are [predictygraph](https://github.com/predictygraph/predictygraph)
|
|
447
|
+
themes, the same TOML as a diagram's `theme=`, so one file styles both.
|
|
448
|
+
`seaborn_theme: hami` uses predictygraph's bundled `hami` theme; decktile adds
|
|
449
|
+
`kubecon_na` and `ossummit_europe`, and `PDG_THEME_PATH` directories are searched
|
|
450
|
+
too. The palette sets the chart: `fg` text, `muted` ticks, `border` axes, `bg`
|
|
451
|
+
background, `bg-alt` grid, and the hues (green, blue, cyan, ...) the colour cycle.
|
|
452
|
+
|
|
453
|
+
To keep a theme in your own repo, point `seaborn_theme` (and diagram `theme=`)
|
|
454
|
+
at a `.toml` file next to the deck. An optional `[seaborn]` table, ignored by
|
|
455
|
+
predictygraph, changes the colour order and sets any matplotlib rcParam;
|
|
456
|
+
values may name palette keys:
|
|
457
|
+
|
|
458
|
+
```toml
|
|
459
|
+
# themes/brand.toml
|
|
460
|
+
schema = 1
|
|
461
|
+
extends = "hami"
|
|
462
|
+
|
|
463
|
+
[palette]
|
|
464
|
+
green = "#0f9d58"
|
|
465
|
+
|
|
466
|
+
[seaborn]
|
|
467
|
+
palette = ["green", "blue", "yellow"]
|
|
468
|
+
"grid.color" = "bg-alt"
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
```yaml
|
|
472
|
+
seaborn_theme: themes/brand.toml
|
|
473
|
+
```
|
|
474
|
+
|
|
446
475
|
### Custom charts with matplotlib
|
|
447
476
|
|
|
448
477
|
For charts beyond seaborn's high-level API, drop into matplotlib directly.
|
|
@@ -19,11 +19,11 @@ dependencies = [
|
|
|
19
19
|
"odfdo>=3.27.2",
|
|
20
20
|
"mermaidx>=0.8.1",
|
|
21
21
|
"python-lucide>=0.5.0",
|
|
22
|
-
"predictygraph>=0.3.
|
|
22
|
+
"predictygraph>=0.3.1",
|
|
23
23
|
]
|
|
24
24
|
requires-python = ">=3.11"
|
|
25
25
|
readme = "README.md"
|
|
26
|
-
version = "0.3.
|
|
26
|
+
version = "0.3.4"
|
|
27
27
|
|
|
28
28
|
[project.license]
|
|
29
29
|
text = "Apache-2.0"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Reza Jelveh
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
# KubeCon NA 2026 title-slide colours, as a predictygraph theme (diagrams and charts).
|
|
6
|
+
schema = 1
|
|
7
|
+
name = "kubecon_na"
|
|
8
|
+
dark = false
|
|
9
|
+
|
|
10
|
+
[palette]
|
|
11
|
+
bg = "#ffffff"
|
|
12
|
+
surface = "#ffffff"
|
|
13
|
+
fg = "#052243"
|
|
14
|
+
muted = "#5A6F8E"
|
|
15
|
+
border = "#052243"
|
|
16
|
+
bg-alt = "#E3F6FF"
|
|
17
|
+
red = "#D62293"
|
|
18
|
+
orange = "#D62293"
|
|
19
|
+
yellow = "#E8C400"
|
|
20
|
+
green = "#2E9C68"
|
|
21
|
+
cyan = "#40BE95"
|
|
22
|
+
blue = "#113E82"
|
|
23
|
+
purple = "#D62293"
|
|
24
|
+
|
|
25
|
+
[shape]
|
|
26
|
+
font = "Roboto"
|
|
27
|
+
|
|
28
|
+
[seaborn]
|
|
29
|
+
palette = ["blue", "red", "green", "yellow", "cyan", "fg"]
|
|
30
|
+
"patch.edgecolor" = "#ffffff"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Reza Jelveh
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
# Open Source Summit Europe colours, as a predictygraph theme (diagrams and charts).
|
|
6
|
+
schema = 1
|
|
7
|
+
name = "ossummit_europe"
|
|
8
|
+
dark = false
|
|
9
|
+
|
|
10
|
+
[palette]
|
|
11
|
+
bg = "#ffffff"
|
|
12
|
+
surface = "#ffffff"
|
|
13
|
+
fg = "#003841"
|
|
14
|
+
muted = "#4F6F73"
|
|
15
|
+
border = "#003841"
|
|
16
|
+
bg-alt = "#EDF5F4"
|
|
17
|
+
red = "#E05845"
|
|
18
|
+
orange = "#E58570"
|
|
19
|
+
yellow = "#E58570"
|
|
20
|
+
green = "#0DA89D"
|
|
21
|
+
cyan = "#0DA89D"
|
|
22
|
+
blue = "#0A5560"
|
|
23
|
+
purple = "#0A5560"
|
|
24
|
+
|
|
25
|
+
[shape]
|
|
26
|
+
font = "Roboto"
|
|
27
|
+
|
|
28
|
+
[seaborn]
|
|
29
|
+
palette = ["red", "green", "blue", "orange", "fg"]
|
|
30
|
+
"patch.edgecolor" = "#ffffff"
|
|
@@ -23,7 +23,9 @@ app = typer.Typer(help="Markdown to styled HTML + ODP + PDF", no_args_is_help=Tr
|
|
|
23
23
|
|
|
24
24
|
@app.callback(invoke_without_command=True)
|
|
25
25
|
def main(
|
|
26
|
-
files: list[Path] | None = typer.Argument(
|
|
26
|
+
files: list[Path] | None = typer.Argument(
|
|
27
|
+
None, help="Markdown files to build; globs like '*.deck.md' or 'talks/**/*.deck.md' are expanded"
|
|
28
|
+
),
|
|
27
29
|
output_dir: Path | None = typer.Option(None, "-o", "--output-dir", help="Output directory (default: <input>/dist/)"),
|
|
28
30
|
pdf: bool = typer.Option(False, "--pdf", help="Generate PDF"),
|
|
29
31
|
odp: bool = typer.Option(False, "--odp", help="Generate ODP (programmatic)"),
|
|
@@ -103,6 +105,8 @@ def _build(
|
|
|
103
105
|
) -> None:
|
|
104
106
|
content = file.read_text(encoding="utf-8")
|
|
105
107
|
doc = parse(content)
|
|
108
|
+
if doc.meta.seaborn_theme.endswith(".toml"): # downstream theme file, relative to the deck
|
|
109
|
+
doc.meta.seaborn_theme = str((file.parent / doc.meta.seaborn_theme).resolve())
|
|
106
110
|
dims = doc.meta.dimensions()
|
|
107
111
|
|
|
108
112
|
out_dir = output_dir or file.parent / "dist"
|
|
@@ -10,15 +10,13 @@ SVG strings for both HTML inline and ODP embedding.
|
|
|
10
10
|
Only active when seaborn + matplotlib are installed (pdm install -G plot).
|
|
11
11
|
Falls back to plain code highlighting otherwise.
|
|
12
12
|
|
|
13
|
-
Theme support: the ``seaborn_theme`` frontmatter field
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
and can set ``seaborn_palette`` to override the default ("Paired").
|
|
13
|
+
Theme support: the ``seaborn_theme`` frontmatter field takes a predictygraph
|
|
14
|
+
theme (the same TOML as diagram ``theme=``): a name from ``decktile/chart_themes``,
|
|
15
|
+
``PDG_THEME_PATH`` or predictygraph's bundled themes, or a ``.toml`` path next to
|
|
16
|
+
the deck. Without one, a decktile CSS theme ``decktile/themes/<name>.css`` is
|
|
17
|
+
parsed for colours, else the name is a seaborn palette ("Paired", "deep", ...).
|
|
19
18
|
"""
|
|
20
19
|
|
|
21
|
-
import importlib
|
|
22
20
|
import io
|
|
23
21
|
import re
|
|
24
22
|
from pathlib import Path
|
|
@@ -75,33 +73,79 @@ def _css_theme_rcparams(name: str) -> dict | None:
|
|
|
75
73
|
return style
|
|
76
74
|
|
|
77
75
|
|
|
76
|
+
_CHART_THEMES = Path(__file__).parent.parent / "chart_themes"
|
|
77
|
+
_HUE_ORDER = ("green", "blue", "cyan", "yellow", "purple", "red", "orange")
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def _pdg_theme(name: str) -> dict | None:
|
|
81
|
+
"""A predictygraph theme (decktile's chart_themes, PDG_THEME_PATH, bundled, or a .toml path) as rcParams.
|
|
82
|
+
|
|
83
|
+
Palette roles drive the chart: fg = text, muted = ticks, border = axes, bg = background,
|
|
84
|
+
bg-alt = grid; hues in a fixed order are the colour cycle. An optional ``[seaborn]`` table
|
|
85
|
+
overrides that: ``palette`` (palette keys or hex) and any matplotlib rcParam.
|
|
86
|
+
"""
|
|
87
|
+
from predictygraph.theme import ThemeError, load_theme
|
|
88
|
+
|
|
89
|
+
local = _CHART_THEMES / f"{name}.toml"
|
|
90
|
+
if not local.is_file() and (_THEME_DIR / f"{name}.css").is_file():
|
|
91
|
+
return None # decktile CSS theme wins over a same-named predictygraph one (e.g. default)
|
|
92
|
+
try:
|
|
93
|
+
t = load_theme(str(local) if local.is_file() else name)
|
|
94
|
+
except ThemeError:
|
|
95
|
+
return None
|
|
96
|
+
pal = t.get("palette", {})
|
|
97
|
+
extra = dict(t.get("seaborn", {}))
|
|
98
|
+
order = extra.pop("palette", None) or [h for h in _HUE_ORDER if h in pal]
|
|
99
|
+
style = {
|
|
100
|
+
"seaborn_palette": [pal.get(c, c) for c in order],
|
|
101
|
+
"axes.facecolor": pal.get("surface", "#ffffff"),
|
|
102
|
+
"figure.facecolor": pal.get("bg", "#ffffff"),
|
|
103
|
+
"axes.edgecolor": pal.get("border"),
|
|
104
|
+
"grid.color": pal.get("bg-alt"),
|
|
105
|
+
"patch.force_edgecolor": True,
|
|
106
|
+
}
|
|
107
|
+
for rc in ("axes.labelcolor", "axes.titlecolor", "text.color"):
|
|
108
|
+
style[rc] = pal.get("fg")
|
|
109
|
+
for rc in ("xtick.color", "ytick.color"):
|
|
110
|
+
style[rc] = pal.get("muted")
|
|
111
|
+
if font := t.get("shape", {}).get("font"):
|
|
112
|
+
style |= {"font.family": "sans-serif", "font.sans-serif": [font, "Arial", "Helvetica", "sans-serif"]}
|
|
113
|
+
style |= {k: pal.get(v, v) if isinstance(v, str) else v for k, v in extra.items()}
|
|
114
|
+
return {k: v for k, v in style.items() if v is not None}
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def _apply(style: dict) -> None:
|
|
118
|
+
global _palette, _style
|
|
119
|
+
import matplotlib
|
|
120
|
+
|
|
121
|
+
matplotlib.use("Agg")
|
|
122
|
+
import matplotlib.pyplot as plt
|
|
123
|
+
import seaborn as sns
|
|
124
|
+
|
|
125
|
+
palette = style.pop("seaborn_palette", _DEFAULT_PALETTE)
|
|
126
|
+
sns.set_theme(style="darkgrid", palette=palette)
|
|
127
|
+
plt.rcParams.update(style)
|
|
128
|
+
_style, _palette = style, palette
|
|
129
|
+
|
|
130
|
+
|
|
78
131
|
def set_theme(name: str) -> None:
|
|
79
|
-
"""Apply a
|
|
132
|
+
"""Apply a chart theme by name or ``.toml`` path.
|
|
80
133
|
|
|
81
|
-
Resolution order:
|
|
134
|
+
Resolution order: predictygraph theme (decktile chart_themes, PDG_THEME_PATH,
|
|
135
|
+
predictygraph bundled, ``.toml`` path) > decktile CSS theme > seaborn palette name.
|
|
82
136
|
"""
|
|
83
137
|
global _palette, _style
|
|
84
138
|
if not name:
|
|
85
139
|
name = _DEFAULT_PALETTE
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
import seaborn as sns
|
|
96
|
-
|
|
97
|
-
palette = style.pop("seaborn_palette", _DEFAULT_PALETTE)
|
|
98
|
-
sns.set_theme(style="darkgrid", palette=palette)
|
|
99
|
-
plt.rcParams.update(style)
|
|
100
|
-
_style = style
|
|
101
|
-
_palette = palette
|
|
102
|
-
return
|
|
103
|
-
except ImportError:
|
|
104
|
-
pass
|
|
140
|
+
style = _pdg_theme(name)
|
|
141
|
+
if style is None and name.endswith(".toml"):
|
|
142
|
+
raise FileNotFoundError(f"seaborn theme file not found: {name}")
|
|
143
|
+
if style is not None:
|
|
144
|
+
try:
|
|
145
|
+
_apply(style)
|
|
146
|
+
except ImportError: # charts are optional (decktile[plot])
|
|
147
|
+
_palette, _style = name, None
|
|
148
|
+
return
|
|
105
149
|
|
|
106
150
|
# 2) CSS theme file (single source of truth for brand colors)
|
|
107
151
|
css_style = _css_theme_rcparams(name)
|
|
@@ -140,3 +140,43 @@ class TestStyleModulePalette:
|
|
|
140
140
|
set_theme("ossummit_europe")
|
|
141
141
|
svg = render_seaborn_svg(self.BAR)
|
|
142
142
|
assert "#e05845" in svg.lower()
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
class TestPredictygraphThemes:
|
|
146
|
+
def test_hami_from_predictygraph(self):
|
|
147
|
+
import pytest
|
|
148
|
+
|
|
149
|
+
pytest.importorskip("seaborn")
|
|
150
|
+
import decktile.render.seaborn as sb
|
|
151
|
+
|
|
152
|
+
sb.set_theme("hami")
|
|
153
|
+
assert sb._palette[0] == "#16a34a"
|
|
154
|
+
assert sb._style["text.color"] == "#1e293b"
|
|
155
|
+
|
|
156
|
+
def test_kubecon_na_chart_theme(self):
|
|
157
|
+
import pytest
|
|
158
|
+
|
|
159
|
+
pytest.importorskip("seaborn")
|
|
160
|
+
import decktile.render.seaborn as sb
|
|
161
|
+
|
|
162
|
+
sb.set_theme("kubecon_na")
|
|
163
|
+
assert sb._palette[:2] == ["#113E82", "#D62293"]
|
|
164
|
+
assert sb._style["patch.edgecolor"] == "#ffffff"
|
|
165
|
+
|
|
166
|
+
def test_toml_file_extends_with_seaborn_section(self, tmp_path):
|
|
167
|
+
import pytest
|
|
168
|
+
|
|
169
|
+
pytest.importorskip("seaborn")
|
|
170
|
+
import decktile.render.seaborn as sb
|
|
171
|
+
|
|
172
|
+
f = tmp_path / "brand.toml"
|
|
173
|
+
f.write_text('schema = 1\nextends = "hami"\n[seaborn]\npalette = ["blue", "#112233"]\n"grid.color" = "muted"\n')
|
|
174
|
+
sb.set_theme(str(f))
|
|
175
|
+
assert sb._palette == ["#2563eb", "#112233"]
|
|
176
|
+
assert sb._style["grid.color"] == "#64748b"
|
|
177
|
+
|
|
178
|
+
def test_missing_toml_theme_file(self, tmp_path):
|
|
179
|
+
import pytest
|
|
180
|
+
|
|
181
|
+
with pytest.raises(FileNotFoundError):
|
|
182
|
+
set_theme(str(tmp_path / "nope.toml"))
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2026 Reza Jelveh
|
|
2
|
-
#
|
|
3
|
-
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
|
|
5
|
-
"""Seaborn/matplotlib style modules for decktile themes.
|
|
6
|
-
|
|
7
|
-
Each module exports a STYLE dict of matplotlib rcParams.
|
|
8
|
-
Named to match the CSS theme it pairs with (e.g. kcd_vietnam.css -> kcd_vietnam).
|
|
9
|
-
"""
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2026 Reza Jelveh
|
|
2
|
-
#
|
|
3
|
-
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
|
|
5
|
-
"""Seaborn/matplotlib style for the KubeCon NA 2026 theme.
|
|
6
|
-
|
|
7
|
-
Colors from the Title slide: blue #113E82, magenta #D62293, green #2E9C68,
|
|
8
|
-
yellow #E8C400 (darkened #FFEE88 so it reads on white), navy #052243.
|
|
9
|
-
"""
|
|
10
|
-
|
|
11
|
-
PALETTE = [
|
|
12
|
-
"#113E82", # blue, primary
|
|
13
|
-
"#D62293", # magenta
|
|
14
|
-
"#2E9C68", # green
|
|
15
|
-
"#E8C400", # yellow
|
|
16
|
-
"#40BE95", # mint
|
|
17
|
-
"#052243", # navy
|
|
18
|
-
]
|
|
19
|
-
|
|
20
|
-
STYLE = {
|
|
21
|
-
"seaborn_palette": PALETTE,
|
|
22
|
-
"font.family": "sans-serif",
|
|
23
|
-
"font.sans-serif": ["Roboto", "Arial", "Helvetica Neue", "sans-serif"],
|
|
24
|
-
"axes.facecolor": "#ffffff",
|
|
25
|
-
"axes.edgecolor": "#052243",
|
|
26
|
-
"axes.labelcolor": "#052243",
|
|
27
|
-
"axes.titlecolor": "#052243",
|
|
28
|
-
"text.color": "#052243",
|
|
29
|
-
"figure.facecolor": "#ffffff",
|
|
30
|
-
"xtick.color": "#5A6F8E",
|
|
31
|
-
"ytick.color": "#5A6F8E",
|
|
32
|
-
"grid.color": "#E3F6FF",
|
|
33
|
-
"patch.edgecolor": "#ffffff",
|
|
34
|
-
"patch.force_edgecolor": True,
|
|
35
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2026 Reza Jelveh
|
|
2
|
-
#
|
|
3
|
-
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
|
|
5
|
-
"""Seaborn/matplotlib style for the Open Source Summit Europe theme.
|
|
6
|
-
|
|
7
|
-
Brand palette: coral #E05845, green #0DA89D, teal #0A5560,
|
|
8
|
-
light coral #E58570, dark navy #003841. Background #ffffff.
|
|
9
|
-
"""
|
|
10
|
-
|
|
11
|
-
PALETTE = [
|
|
12
|
-
"#E05845", # coral, primary accent
|
|
13
|
-
"#0DA89D", # green, secondary accent
|
|
14
|
-
"#0A5560", # teal
|
|
15
|
-
"#E58570", # light coral, gradient end
|
|
16
|
-
"#003841", # dark navy, contrast
|
|
17
|
-
]
|
|
18
|
-
|
|
19
|
-
STYLE = {
|
|
20
|
-
"seaborn_palette": PALETTE,
|
|
21
|
-
"font.family": "sans-serif",
|
|
22
|
-
"font.sans-serif": ["Roboto", "Arial", "Helvetica Neue", "sans-serif"],
|
|
23
|
-
"axes.facecolor": "#ffffff",
|
|
24
|
-
"axes.edgecolor": "#003841",
|
|
25
|
-
"axes.labelcolor": "#003841",
|
|
26
|
-
"axes.titlecolor": "#003841",
|
|
27
|
-
"text.color": "#003841",
|
|
28
|
-
"figure.facecolor": "#ffffff",
|
|
29
|
-
"xtick.color": "#4F6F73",
|
|
30
|
-
"ytick.color": "#4F6F73",
|
|
31
|
-
"grid.color": "#EDF5F4",
|
|
32
|
-
"patch.edgecolor": "#ffffff",
|
|
33
|
-
"patch.force_edgecolor": True,
|
|
34
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|