decktile 0.4.1__tar.gz → 0.4.3__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.4.1 → decktile-0.4.3}/PKG-INFO +27 -1
- {decktile-0.4.1 → decktile-0.4.3}/README.md +26 -0
- {decktile-0.4.1 → decktile-0.4.3}/pyproject.toml +1 -1
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/render/templates/base.css +42 -0
- {decktile-0.4.1 → decktile-0.4.3}/tests/test_html.py +61 -0
- {decktile-0.4.1 → decktile-0.4.3}/LICENSE +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/NOTICE +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/__init__.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/__main__.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/assets/lucide/VENDORED.md +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/assets/lucide/lucide.css +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/assets/lucide/lucide.ttf +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/chart_themes/kubecon_na.toml +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/chart_themes/ossummit_europe.toml +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/cli.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/parser/__init__.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/parser/ast.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/parser/markdown.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/plugins/cards.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/plugins/directives.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/plugins/fenced.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/plugins/layouts.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/plugins/lucide.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/plugins/lucide_font.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/render/__init__.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/render/html.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/render/ir.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/render/odf/__init__.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/render/odf/geometry.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/render/odf/shapes.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/render/odf/styles.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/render/odp.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/render/pdf.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/render/pdg.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/render/seaborn.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/render/templates/decktile.js +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/render/templates/shell.html +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/theme/__init__.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/theme/loader.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/theme/parser.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/themes/default.css +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/themes/kcd_vietnam.css +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/themes/kubecon_china.css +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/themes/kubecon_japan.css +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/themes/kubecon_na.css +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/themes/ossummit_europe.css +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/themes/ossummit_korea.css +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/themes/skeleton/preview.deck.md +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/src/decktile/themes/skeleton/theme.toml +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/tests/__init__.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/tests/test_cli.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/tests/test_geometry.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/tests/test_ir.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/tests/test_odf_shapes.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/tests/test_odp.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/tests/test_parser.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/tests/test_pdg.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/tests/test_seaborn_styles.py +0 -0
- {decktile-0.4.1 → decktile-0.4.3}/tests/test_video.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: decktile
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.3
|
|
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
|
|
@@ -188,6 +188,7 @@ places that should be one. PRs that consolidate repeated logic are welcome.
|
|
|
188
188
|
| `@layout ecosystem` | Compact stacked layout for partner/device logos. Small labels, uniform image sizing |
|
|
189
189
|
| `@layout timeline-vertical` | Cards alternate left/right of a central vertical spine, connected by stubs |
|
|
190
190
|
| `@layout timeline-horizontal` | Cards alternate above/below a central horizontal spine |
|
|
191
|
+
| `@layout timeline-steps` | Agenda-style: equal columns, each on a rule from a marker at the top; `{label}` sits above the heading |
|
|
191
192
|
| Custom | `@layout <name>` adds CSS class `layout-<name>`, style via frontmatter `style:` block |
|
|
192
193
|
|
|
193
194
|
### Compare layout
|
|
@@ -317,6 +318,30 @@ Next major
|
|
|
317
318
|
title plus one short line) so the connector stub reliably reaches the
|
|
318
319
|
spine regardless of content length.
|
|
319
320
|
|
|
321
|
+
`timeline-steps` is the agenda variant: no spine and no alternating, every
|
|
322
|
+
item gets a column with a marker and a rule down the slide.
|
|
323
|
+
|
|
324
|
+
```markdown
|
|
325
|
+
@layout timeline-steps
|
|
326
|
+
|
|
327
|
+
## Agenda
|
|
328
|
+
|
|
329
|
+
::: grid {cols=3}
|
|
330
|
+
::: card {label="Part"}
|
|
331
|
+
### 01
|
|
332
|
+
Industry trends
|
|
333
|
+
:::
|
|
334
|
+
::: card {label="Part"}
|
|
335
|
+
### 02
|
|
336
|
+
About HAMi
|
|
337
|
+
:::
|
|
338
|
+
::: card {label="Part"}
|
|
339
|
+
### 03
|
|
340
|
+
Use cases
|
|
341
|
+
:::
|
|
342
|
+
:::
|
|
343
|
+
```
|
|
344
|
+
|
|
320
345
|
### Section labels and side images
|
|
321
346
|
|
|
322
347
|
Ecosystem slides use `####` (h4) for section labels above grids, and
|
|
@@ -353,6 +378,7 @@ The arrow block accepts text or images:
|
|
|
353
378
|
```
|
|
354
379
|
::: grid {cols=2} # responsive grid
|
|
355
380
|
::: grid {cols=3} # 3-column grid
|
|
381
|
+
::: grid {cols=5, fill} # rows spread over the rest of the slide (no empty band below)
|
|
356
382
|
::: card # basic card
|
|
357
383
|
::: card{ tag="green" } # colored left border + background
|
|
358
384
|
::: card{ tag="quote" } # accent left border, italic, no fill
|
|
@@ -156,6 +156,7 @@ places that should be one. PRs that consolidate repeated logic are welcome.
|
|
|
156
156
|
| `@layout ecosystem` | Compact stacked layout for partner/device logos. Small labels, uniform image sizing |
|
|
157
157
|
| `@layout timeline-vertical` | Cards alternate left/right of a central vertical spine, connected by stubs |
|
|
158
158
|
| `@layout timeline-horizontal` | Cards alternate above/below a central horizontal spine |
|
|
159
|
+
| `@layout timeline-steps` | Agenda-style: equal columns, each on a rule from a marker at the top; `{label}` sits above the heading |
|
|
159
160
|
| Custom | `@layout <name>` adds CSS class `layout-<name>`, style via frontmatter `style:` block |
|
|
160
161
|
|
|
161
162
|
### Compare layout
|
|
@@ -285,6 +286,30 @@ Next major
|
|
|
285
286
|
title plus one short line) so the connector stub reliably reaches the
|
|
286
287
|
spine regardless of content length.
|
|
287
288
|
|
|
289
|
+
`timeline-steps` is the agenda variant: no spine and no alternating, every
|
|
290
|
+
item gets a column with a marker and a rule down the slide.
|
|
291
|
+
|
|
292
|
+
```markdown
|
|
293
|
+
@layout timeline-steps
|
|
294
|
+
|
|
295
|
+
## Agenda
|
|
296
|
+
|
|
297
|
+
::: grid {cols=3}
|
|
298
|
+
::: card {label="Part"}
|
|
299
|
+
### 01
|
|
300
|
+
Industry trends
|
|
301
|
+
:::
|
|
302
|
+
::: card {label="Part"}
|
|
303
|
+
### 02
|
|
304
|
+
About HAMi
|
|
305
|
+
:::
|
|
306
|
+
::: card {label="Part"}
|
|
307
|
+
### 03
|
|
308
|
+
Use cases
|
|
309
|
+
:::
|
|
310
|
+
:::
|
|
311
|
+
```
|
|
312
|
+
|
|
288
313
|
### Section labels and side images
|
|
289
314
|
|
|
290
315
|
Ecosystem slides use `####` (h4) for section labels above grids, and
|
|
@@ -321,6 +346,7 @@ The arrow block accepts text or images:
|
|
|
321
346
|
```
|
|
322
347
|
::: grid {cols=2} # responsive grid
|
|
323
348
|
::: grid {cols=3} # 3-column grid
|
|
349
|
+
::: grid {cols=5, fill} # rows spread over the rest of the slide (no empty band below)
|
|
324
350
|
::: card # basic card
|
|
325
351
|
::: card{ tag="green" } # colored left border + background
|
|
326
352
|
::: card{ tag="quote" } # accent left border, italic, no fill
|
|
@@ -162,6 +162,10 @@ th { font-weight: 700; }
|
|
|
162
162
|
|
|
163
163
|
.grid { display: grid; gap: var(--gap); margin: 0 0 var(--gap) 0; }
|
|
164
164
|
.grid > * { min-width: 0; }
|
|
165
|
+
/* {fill}: the grid takes the rest of the slide body and spreads its rows over it,
|
|
166
|
+
content centred in each row, so a short grid leaves no empty band at the bottom */
|
|
167
|
+
.slide-body:has(> .grid.fill) { display: flex; flex-direction: column; }
|
|
168
|
+
.grid.fill { flex: 1; grid-auto-rows: 1fr; align-items: center; margin-bottom: 0; }
|
|
165
169
|
|
|
166
170
|
.card {
|
|
167
171
|
border-radius: var(--radius);
|
|
@@ -572,6 +576,44 @@ LOGO_CSS
|
|
|
572
576
|
}
|
|
573
577
|
.layout-timeline-horizontal .card:nth-child(even)::after { top: -2em; }
|
|
574
578
|
.layout-timeline-horizontal .card:nth-child(odd)::after { bottom: -2em; }
|
|
579
|
+
/* timeline-steps: the agenda variant of the timeline. Items sit side by side
|
|
580
|
+
in equal columns, each on its own rule that runs from a marker at the top
|
|
581
|
+
down to the bottom of the slide; nothing alternates. {label="Part"} prints
|
|
582
|
+
above the card's ### heading instead of on a spine. Themes restyle the
|
|
583
|
+
marker (::before) and the rule (border-left). */
|
|
584
|
+
.layout-timeline-steps .slide-body { display: flex; flex-direction: column; padding-bottom: 0; }
|
|
585
|
+
.layout-timeline-steps .grid { display: flex; flex-direction: row; flex: 1; gap: 0; margin: 2em 0 0; padding-left: 0.4em; } /* room for the first marker */
|
|
586
|
+
.layout-timeline-steps .card {
|
|
587
|
+
flex: 1 1 0;
|
|
588
|
+
min-width: 0;
|
|
589
|
+
position: relative;
|
|
590
|
+
display: flex;
|
|
591
|
+
flex-direction: column;
|
|
592
|
+
background: none;
|
|
593
|
+
border: none;
|
|
594
|
+
border-left: 0.06em solid var(--color-accent-primary);
|
|
595
|
+
border-radius: 0;
|
|
596
|
+
padding: 0.4em 0.8em 0 1em;
|
|
597
|
+
}
|
|
598
|
+
.layout-timeline-steps .card::before {
|
|
599
|
+
content: "";
|
|
600
|
+
position: absolute;
|
|
601
|
+
left: -0.33em;
|
|
602
|
+
top: -0.3em;
|
|
603
|
+
width: 0.6em;
|
|
604
|
+
height: 0.6em;
|
|
605
|
+
border-radius: 50%;
|
|
606
|
+
background: var(--color-accent-primary);
|
|
607
|
+
}
|
|
608
|
+
.layout-timeline-steps .timeline-label {
|
|
609
|
+
position: static;
|
|
610
|
+
font-size: 0.75em;
|
|
611
|
+
font-weight: 400;
|
|
612
|
+
color: inherit;
|
|
613
|
+
margin-bottom: 0.1em;
|
|
614
|
+
}
|
|
615
|
+
.layout-timeline-steps .card h3 { font-size: 2.4em; line-height: 1; margin: 0 0 0.4em; }
|
|
616
|
+
|
|
575
617
|
/* {label="..."}: short name printed directly on the spine, next to
|
|
576
618
|
this card's own dot -- distinct from the card's fuller ### header */
|
|
577
619
|
.timeline-label {
|
|
@@ -220,3 +220,64 @@ def test_email_in_speaker_role_is_a_link():
|
|
|
220
220
|
def test_mailto_links_keep_text_colour():
|
|
221
221
|
css = base_css()
|
|
222
222
|
assert 'a[href^="mailto:"]' in css and "color: inherit" in css
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
def test_grid_fill_spreads_rows_over_the_slide():
|
|
226
|
+
"""{fill}: rows of a short grid spread down the slide instead of leaving a band."""
|
|
227
|
+
from weasyprint import HTML
|
|
228
|
+
|
|
229
|
+
md = "---\ntitle: t\n---\n\n## Fill\n\n::: grid {cols=2, %s}\n" + "".join(f"::: card\n### C{i}\nx\n:::\n" for i in range(4)) + ":::\n"
|
|
230
|
+
|
|
231
|
+
def row2_y(flag):
|
|
232
|
+
from decktile.render.ir import assemble_css
|
|
233
|
+
|
|
234
|
+
css = assemble_css(base_css(), default_theme(), (1280, 720))
|
|
235
|
+
doc = HTML(string=render(parse(md % flag), default_theme(), css, (1280, 720))).render()
|
|
236
|
+
page = doc.pages[0]._page_box
|
|
237
|
+
|
|
238
|
+
def walk(box):
|
|
239
|
+
yield box
|
|
240
|
+
for c in getattr(box, "children", []):
|
|
241
|
+
yield from walk(c)
|
|
242
|
+
|
|
243
|
+
ys = [b.position_y for b in walk(page) if getattr(b, "element_tag", "") == "h3" and "C2" in "".join(b.element.itertext())]
|
|
244
|
+
return ys[0], page.height
|
|
245
|
+
|
|
246
|
+
plain, h = row2_y("plain-grid")
|
|
247
|
+
filled, _ = row2_y("fill")
|
|
248
|
+
assert filled > plain + h * 0.1
|
|
249
|
+
assert "grid fill" in _full_page(md % "fill")
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
def test_timeline_steps_columns_with_label_above_heading():
|
|
253
|
+
"""timeline-steps: equal columns side by side, {label} above the ### heading."""
|
|
254
|
+
from weasyprint import HTML
|
|
255
|
+
|
|
256
|
+
from decktile.render.ir import assemble_css
|
|
257
|
+
|
|
258
|
+
md = "---\ntitle: t\n---\n\n@layout timeline-steps\n\n## Agenda\n\n::: grid {cols=4}\n"
|
|
259
|
+
md += "".join(f'::: card {{label="Part"}}\n### 0{i}\nTopic {i}\n:::\n' for i in range(1, 5)) + ":::\n"
|
|
260
|
+
css = assemble_css(base_css(), default_theme(), (1280, 720))
|
|
261
|
+
page = HTML(string=render(parse(md), default_theme(), css, (1280, 720))).render().pages[0]._page_box
|
|
262
|
+
|
|
263
|
+
def walk(box):
|
|
264
|
+
yield box
|
|
265
|
+
for c in getattr(box, "children", []):
|
|
266
|
+
yield from walk(c)
|
|
267
|
+
|
|
268
|
+
def cls(b):
|
|
269
|
+
el = getattr(b, "element", None)
|
|
270
|
+
return el.get("class", "") if el is not None else ""
|
|
271
|
+
|
|
272
|
+
cards = [b for b in walk(page) if getattr(b, "element_tag", "") == "div" and cls(b).split()[:1] == ["card"]]
|
|
273
|
+
cards = list({id(b.element): b for b in cards}.values())
|
|
274
|
+
assert len(cards) == 4
|
|
275
|
+
xs = [c.position_x for c in cards]
|
|
276
|
+
ws = [c.width for c in cards]
|
|
277
|
+
assert xs == sorted(xs) and len({round(x) for x in xs}) == 4
|
|
278
|
+
assert max(ws) - min(ws) < 2
|
|
279
|
+
ys = {round(c.position_y) for c in cards}
|
|
280
|
+
assert len(ys) == 1 # nothing alternates
|
|
281
|
+
label = next(b for b in walk(page) if "timeline-label" in cls(b))
|
|
282
|
+
h3 = next(b for b in walk(page) if getattr(b, "element_tag", "") == "h3")
|
|
283
|
+
assert label.position_y < h3.position_y
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|