decktile 0.2.7__tar.gz → 0.3.0__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.
Files changed (63) hide show
  1. decktile-0.3.0/LICENSE +202 -0
  2. decktile-0.3.0/NOTICE +11 -0
  3. {decktile-0.2.7 → decktile-0.3.0}/PKG-INFO +21 -21
  4. {decktile-0.2.7 → decktile-0.3.0}/README.md +18 -18
  5. {decktile-0.2.7 → decktile-0.3.0}/pyproject.toml +33 -3
  6. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/__init__.py +4 -0
  7. decktile-0.3.0/src/decktile/__main__.py +7 -0
  8. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/cli.py +52 -41
  9. decktile-0.3.0/src/decktile/parser/__init__.py +3 -0
  10. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/parser/ast.py +17 -12
  11. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/parser/markdown.py +34 -17
  12. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/plugins/cards.py +4 -0
  13. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/plugins/directives.py +8 -3
  14. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/plugins/fenced.py +12 -7
  15. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/plugins/layouts.py +14 -12
  16. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/plugins/lucide.py +10 -5
  17. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/plugins/lucide_font.py +4 -0
  18. decktile-0.3.0/src/decktile/render/__init__.py +3 -0
  19. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/render/html.py +47 -51
  20. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/render/ir.py +164 -96
  21. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/render/odf/__init__.py +5 -0
  22. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/render/odf/geometry.py +44 -98
  23. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/render/odf/shapes.py +53 -122
  24. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/render/odf/styles.py +73 -85
  25. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/render/odp.py +33 -80
  26. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/render/pdf.py +5 -6
  27. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/render/pdg.py +26 -12
  28. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/render/seaborn.py +11 -7
  29. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/seaborn_styles/__init__.py +4 -0
  30. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/seaborn_styles/ossummit_europe.py +4 -0
  31. decktile-0.3.0/src/decktile/theme/__init__.py +3 -0
  32. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/theme/loader.py +4 -0
  33. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/theme/parser.py +32 -22
  34. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/themes/kubecon_japan.css +3 -2
  35. decktile-0.3.0/tests/__init__.py +3 -0
  36. {decktile-0.2.7 → decktile-0.3.0}/tests/test_cli.py +12 -5
  37. {decktile-0.2.7 → decktile-0.3.0}/tests/test_geometry.py +32 -27
  38. {decktile-0.2.7 → decktile-0.3.0}/tests/test_html.py +16 -14
  39. {decktile-0.2.7 → decktile-0.3.0}/tests/test_ir.py +6 -2
  40. {decktile-0.2.7 → decktile-0.3.0}/tests/test_odf_shapes.py +9 -4
  41. {decktile-0.2.7 → decktile-0.3.0}/tests/test_odp.py +35 -83
  42. {decktile-0.2.7 → decktile-0.3.0}/tests/test_parser.py +11 -3
  43. {decktile-0.2.7 → decktile-0.3.0}/tests/test_pdg.py +9 -7
  44. {decktile-0.2.7 → decktile-0.3.0}/tests/test_seaborn_styles.py +14 -1
  45. {decktile-0.2.7 → decktile-0.3.0}/tests/test_video.py +6 -1
  46. decktile-0.2.7/LICENSE +0 -674
  47. decktile-0.2.7/src/decktile/__main__.py +0 -3
  48. decktile-0.2.7/src/decktile/parser/__init__.py +0 -0
  49. decktile-0.2.7/src/decktile/render/__init__.py +0 -0
  50. decktile-0.2.7/src/decktile/theme/__init__.py +0 -0
  51. decktile-0.2.7/src/decktile/theme/colors.py +0 -53
  52. decktile-0.2.7/tests/__init__.py +0 -0
  53. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/assets/lucide/VENDORED.md +0 -0
  54. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/assets/lucide/lucide.css +0 -0
  55. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/assets/lucide/lucide.ttf +0 -0
  56. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/render/templates/base.css +0 -0
  57. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/render/templates/decktile.js +0 -0
  58. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/render/templates/shell.html +0 -0
  59. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/themes/default.css +0 -0
  60. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/themes/kcd_vietnam.css +0 -0
  61. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/themes/kubecon_china.css +0 -0
  62. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/themes/ossummit_europe.css +0 -0
  63. {decktile-0.2.7 → decktile-0.3.0}/src/decktile/themes/ossummit_korea.css +0 -0
decktile-0.3.0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
decktile-0.3.0/NOTICE ADDED
@@ -0,0 +1,11 @@
1
+ decktile
2
+ Copyright 2026 Reza Jelveh
3
+
4
+ Originally created by Reza Jelveh.
5
+ https://github.com/decktile/decktile
6
+
7
+ This product is licensed under the Apache License, Version 2.0.
8
+ Redistributions and derivative works must keep this NOTICE file.
9
+
10
+ The name "decktile" and its logo are not licensed under the
11
+ Apache License. Forks must use a different name and logo.
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: decktile
3
- Version: 0.2.7
3
+ Version: 0.3.0
4
4
  Summary: Markdown to designed slides: HTML, PDF and editable ODP
5
5
  Author-Email: Reza Jelveh <git@jelveh.me>
6
- License: GPL-3.0-or-later
6
+ License: Apache-2.0
7
7
  Project-URL: Homepage, https://github.com/decktile/decktile
8
8
  Project-URL: Source, https://github.com/decktile/decktile
9
9
  Requires-Python: >=3.11
@@ -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.2.4
23
+ Requires-Dist: predictygraph>=0.3.0
24
24
  Provides-Extra: docs
25
25
  Requires-Dist: sphinx>=9.0.4; extra == "docs"
26
26
  Requires-Dist: furo>=2025.12.19; extra == "docs"
@@ -94,16 +94,16 @@ pdm install -G plot # + seaborn/matplotlib for inline charts
94
94
  ## Usage
95
95
 
96
96
  ```bash
97
- pdm run decktile slides.md # HTML + presenter view
98
- pdm run decktile slides.md --odp # + ODP (programmatic)
99
- pdm run decktile slides.md --image-odp # + ODP (screenshots from PDF)
100
- pdm run decktile slides.md --pdf # + PDF (images compressed)
101
- pdm run decktile slides.md --pdf --no-optimize-images # + PDF, full-resolution images
102
- pdm run decktile -w slides.md # watch and rebuild on changes
103
- pdm run decktile --odp -w slides.md # watch + ODP
104
- pdm run decktile --dist slides.md # HTML + all referenced assets as zip
105
- pdm run decktile a.md b.md --pdf # several decks
106
- pdm run decktile '**/*.md' --pdf # quoted globs are expanded (recursive with **)
97
+ pdm run decktile slides.deck.md # HTML + presenter view
98
+ pdm run decktile slides.deck.md --odp # + ODP (programmatic)
99
+ pdm run decktile slides.deck.md --image-odp # + ODP (screenshots from PDF)
100
+ pdm run decktile slides.deck.md --pdf # + PDF (images compressed)
101
+ pdm run decktile slides.deck.md --pdf --no-optimize-images # + PDF, full-resolution images
102
+ pdm run decktile -w slides.deck.md # watch and rebuild on changes
103
+ pdm run decktile --odp -w slides.deck.md # watch + ODP
104
+ pdm run decktile --dist slides.deck.md # HTML + all referenced assets as zip
105
+ pdm run decktile a.deck.md b.deck.md --pdf # several decks
106
+ pdm run decktile '**/*.deck.md' --pdf # quoted globs are expanded (recursive with **)
107
107
  ```
108
108
 
109
109
  A missing or failing file is reported (`error: <file>: <reason>`) and skipped;
@@ -116,7 +116,7 @@ symlinks all directories from the source folder into `dist/`. Files and
116
116
  `.md` files are skipped, only directories are linked.
117
117
 
118
118
  ```bash
119
- pdm run decktile slides.md # symlinks slides/assets/ → slides/dist/assets/
119
+ pdm run decktile slides.deck.md # symlinks slides/assets/ → slides/dist/assets/
120
120
  ```
121
121
 
122
122
  `--odp` is the production-ready ODP path: a native ODF renderer (styles.py,
@@ -500,7 +500,7 @@ ok = cmap(2.5 / 12) # green
500
500
  neutral = cmap(0.5 / 12) # light blue
501
501
  ```
502
502
 
503
- See `examples/seaborn_demo.md` for the memory oversubscription chart
503
+ See `examples/seaborn_demo.deck.md` for the memory oversubscription chart
504
504
  (horizontal stacked bars, limit markers, annotations).
505
505
 
506
506
  ## Layout caveats
@@ -582,20 +582,20 @@ They appear in the presenter view.
582
582
 
583
583
  ## Demo
584
584
 
585
- `examples/features_demo.md` is a 17-slide deck exercising every feature:
585
+ `examples/features_demo.deck.md` is a 17-slide deck exercising every feature:
586
586
  title slides, `@layout two-col`, `@layout image-right`, `@layout compare`,
587
587
  grids with tagged cards, tables, fenced code blocks, mermaid diagrams,
588
588
  seaborn charts, predictygraph diagrams, lucide icons, blockquotes, speaker notes,
589
589
  and all directives.
590
590
 
591
- See also: `examples/mermaid_demo.md`, `examples/seaborn_demo.md`,
592
- `examples/pdg_demo.md`, `examples/lucide_demo.md`, `examples/timeline_demo.md`.
593
- `examples/seaborn_demo.md` ends with hand-drawn matplotlib explainer charts from a real talk.
591
+ See also: `examples/mermaid_demo.deck.md`, `examples/seaborn_demo.deck.md`,
592
+ `examples/pdg_demo.deck.md`, `examples/lucide_demo.deck.md`, `examples/timeline_demo.deck.md`.
593
+ `examples/seaborn_demo.deck.md` ends with hand-drawn matplotlib explainer charts from a real talk.
594
594
 
595
595
  ## Pipeline
596
596
 
597
597
  ```
598
- slides.md
598
+ slides.deck.md
599
599
  → markdown-it-py (parse)
600
600
  → Document AST (headings, paragraphs, grids, cards, tables)
601
601
  → build_ir() (resolve theme styles via tinycss2)
@@ -645,7 +645,7 @@ Deployable as a single binary via PyInstaller or Nuitka when needed.
645
645
 
646
646
  ## License
647
647
 
648
- GPL-3.0-or-later. See [LICENSE](LICENSE).
648
+ Apache-2.0, see [LICENSE](LICENSE). Forks must keep [NOTICE](NOTICE).
649
649
 
650
650
  ## Related projects
651
651
 
@@ -65,16 +65,16 @@ pdm install -G plot # + seaborn/matplotlib for inline charts
65
65
  ## Usage
66
66
 
67
67
  ```bash
68
- pdm run decktile slides.md # HTML + presenter view
69
- pdm run decktile slides.md --odp # + ODP (programmatic)
70
- pdm run decktile slides.md --image-odp # + ODP (screenshots from PDF)
71
- pdm run decktile slides.md --pdf # + PDF (images compressed)
72
- pdm run decktile slides.md --pdf --no-optimize-images # + PDF, full-resolution images
73
- pdm run decktile -w slides.md # watch and rebuild on changes
74
- pdm run decktile --odp -w slides.md # watch + ODP
75
- pdm run decktile --dist slides.md # HTML + all referenced assets as zip
76
- pdm run decktile a.md b.md --pdf # several decks
77
- pdm run decktile '**/*.md' --pdf # quoted globs are expanded (recursive with **)
68
+ pdm run decktile slides.deck.md # HTML + presenter view
69
+ pdm run decktile slides.deck.md --odp # + ODP (programmatic)
70
+ pdm run decktile slides.deck.md --image-odp # + ODP (screenshots from PDF)
71
+ pdm run decktile slides.deck.md --pdf # + PDF (images compressed)
72
+ pdm run decktile slides.deck.md --pdf --no-optimize-images # + PDF, full-resolution images
73
+ pdm run decktile -w slides.deck.md # watch and rebuild on changes
74
+ pdm run decktile --odp -w slides.deck.md # watch + ODP
75
+ pdm run decktile --dist slides.deck.md # HTML + all referenced assets as zip
76
+ pdm run decktile a.deck.md b.deck.md --pdf # several decks
77
+ pdm run decktile '**/*.deck.md' --pdf # quoted globs are expanded (recursive with **)
78
78
  ```
79
79
 
80
80
  A missing or failing file is reported (`error: <file>: <reason>`) and skipped;
@@ -87,7 +87,7 @@ symlinks all directories from the source folder into `dist/`. Files and
87
87
  `.md` files are skipped, only directories are linked.
88
88
 
89
89
  ```bash
90
- pdm run decktile slides.md # symlinks slides/assets/ → slides/dist/assets/
90
+ pdm run decktile slides.deck.md # symlinks slides/assets/ → slides/dist/assets/
91
91
  ```
92
92
 
93
93
  `--odp` is the production-ready ODP path: a native ODF renderer (styles.py,
@@ -471,7 +471,7 @@ ok = cmap(2.5 / 12) # green
471
471
  neutral = cmap(0.5 / 12) # light blue
472
472
  ```
473
473
 
474
- See `examples/seaborn_demo.md` for the memory oversubscription chart
474
+ See `examples/seaborn_demo.deck.md` for the memory oversubscription chart
475
475
  (horizontal stacked bars, limit markers, annotations).
476
476
 
477
477
  ## Layout caveats
@@ -553,20 +553,20 @@ They appear in the presenter view.
553
553
 
554
554
  ## Demo
555
555
 
556
- `examples/features_demo.md` is a 17-slide deck exercising every feature:
556
+ `examples/features_demo.deck.md` is a 17-slide deck exercising every feature:
557
557
  title slides, `@layout two-col`, `@layout image-right`, `@layout compare`,
558
558
  grids with tagged cards, tables, fenced code blocks, mermaid diagrams,
559
559
  seaborn charts, predictygraph diagrams, lucide icons, blockquotes, speaker notes,
560
560
  and all directives.
561
561
 
562
- See also: `examples/mermaid_demo.md`, `examples/seaborn_demo.md`,
563
- `examples/pdg_demo.md`, `examples/lucide_demo.md`, `examples/timeline_demo.md`.
564
- `examples/seaborn_demo.md` ends with hand-drawn matplotlib explainer charts from a real talk.
562
+ See also: `examples/mermaid_demo.deck.md`, `examples/seaborn_demo.deck.md`,
563
+ `examples/pdg_demo.deck.md`, `examples/lucide_demo.deck.md`, `examples/timeline_demo.deck.md`.
564
+ `examples/seaborn_demo.deck.md` ends with hand-drawn matplotlib explainer charts from a real talk.
565
565
 
566
566
  ## Pipeline
567
567
 
568
568
  ```
569
- slides.md
569
+ slides.deck.md
570
570
  → markdown-it-py (parse)
571
571
  → Document AST (headings, paragraphs, grids, cards, tables)
572
572
  → build_ir() (resolve theme styles via tinycss2)
@@ -616,7 +616,7 @@ Deployable as a single binary via PyInstaller or Nuitka when needed.
616
616
 
617
617
  ## License
618
618
 
619
- GPL-3.0-or-later. See [LICENSE](LICENSE).
619
+ Apache-2.0, see [LICENSE](LICENSE). Forks must keep [NOTICE](NOTICE).
620
620
 
621
621
  ## Related projects
622
622
 
@@ -19,14 +19,14 @@ dependencies = [
19
19
  "odfdo>=3.27.2",
20
20
  "mermaidx>=0.8.1",
21
21
  "python-lucide>=0.5.0",
22
- "predictygraph>=0.2.4",
22
+ "predictygraph>=0.3.0",
23
23
  ]
24
24
  requires-python = ">=3.11"
25
25
  readme = "README.md"
26
- version = "0.2.7"
26
+ version = "0.3.0"
27
27
 
28
28
  [project.license]
29
- text = "GPL-3.0-or-later"
29
+ text = "Apache-2.0"
30
30
 
31
31
  [project.scripts]
32
32
  decktile = "decktile.cli:app"
@@ -76,3 +76,33 @@ distribution = true
76
76
 
77
77
  [tool.pdm.version]
78
78
  source = "scm"
79
+
80
+ [tool.ruff]
81
+ line-length = 140
82
+ target-version = "py311"
83
+
84
+ [tool.ruff.lint]
85
+ select = [
86
+ "F",
87
+ "E",
88
+ "W",
89
+ "I",
90
+ "UP",
91
+ "B",
92
+ "SIM",
93
+ ]
94
+ ignore = [
95
+ "E501",
96
+ "B007",
97
+ "B008",
98
+ "B019",
99
+ "B023",
100
+ "B039",
101
+ "B905",
102
+ ]
103
+
104
+ [tool.ruff.lint.isort]
105
+ split-on-trailing-comma = false
106
+
107
+ [tool.ruff.format]
108
+ skip-magic-trailing-comma = true
@@ -1,3 +1,7 @@
1
+ # SPDX-FileCopyrightText: 2026 Reza Jelveh
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
1
5
  """decktile -- markdown to styled PPTX + PDF."""
2
6
 
3
7
  from decktile.cli import app
@@ -0,0 +1,7 @@
1
+ # SPDX-FileCopyrightText: 2026 Reza Jelveh
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
5
+ from decktile.cli import app
6
+
7
+ app(prog_name="decktile")
@@ -1,14 +1,19 @@
1
+ # SPDX-FileCopyrightText: 2026 Reza Jelveh
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
1
5
  """decktile CLI entry point."""
2
6
 
3
7
  import glob
8
+ import re
4
9
  import time
5
10
  from pathlib import Path
6
- from typing import Optional
7
11
 
8
12
  import typer
9
13
 
10
14
  from decktile.parser.markdown import parse
11
- from decktile.render.html import render as render_html, default_theme, load_theme, base_css
15
+ from decktile.render.html import base_css, default_theme, load_theme
16
+ from decktile.render.html import render as render_html
12
17
  from decktile.render.ir import assemble_css
13
18
  from decktile.render.odp import render as render_odp
14
19
  from decktile.render.pdf import render as render_pdf
@@ -18,16 +23,20 @@ app = typer.Typer(help="Markdown to styled HTML + ODP + PDF", no_args_is_help=Tr
18
23
 
19
24
  @app.callback(invoke_without_command=True)
20
25
  def main(
21
- files: Optional[list[Path]] = typer.Argument(None, help="Markdown files to build; globs like '*.md' or 'talks/**/*.md' are expanded"),
22
- output_dir: Optional[Path] = typer.Option(None, "-o", "--output-dir", help="Output directory (default: <input>/dist/)"),
26
+ files: list[Path] | None = typer.Argument(None, help="Markdown files to build; globs like '*.deck.md' or 'talks/**/*.deck.md' are expanded"),
27
+ output_dir: Path | None = typer.Option(None, "-o", "--output-dir", help="Output directory (default: <input>/dist/)"),
23
28
  pdf: bool = typer.Option(False, "--pdf", help="Generate PDF"),
24
29
  odp: bool = typer.Option(False, "--odp", help="Generate ODP (programmatic)"),
25
30
  image_odp: bool = typer.Option(False, "--image-odp", help="Generate ODP (PDF screenshots)"),
26
31
  dist: bool = typer.Option(False, "--dist", help="Package HTML + referenced assets into a zip"),
27
- optimize_images: bool = typer.Option(True, "--optimize-images/--no-optimize-images", help="Compress images in PDF output (jpeg_quality=85, dpi=150). On by default; --no-optimize-images keeps full-resolution images"),
32
+ optimize_images: bool = typer.Option(
33
+ True,
34
+ "--optimize-images/--no-optimize-images",
35
+ help="Compress images in PDF output (jpeg_quality=85, dpi=150). On by default; --no-optimize-images keeps full-resolution images",
36
+ ),
28
37
  watch: bool = typer.Option(False, "-w", "--watch", help="Watch file and rebuild on changes"),
29
38
  debug: bool = typer.Option(False, "--debug", help="Dump AST + write debug CSS"),
30
- css: Optional[Path] = typer.Option(None, "--css", help="Custom CSS theme file (overrides default)"),
39
+ css: Path | None = typer.Option(None, "--css", help="Custom CSS theme file (overrides default)"),
31
40
  ):
32
41
  if not files:
33
42
  raise typer.Exit()
@@ -37,8 +46,7 @@ def main(
37
46
 
38
47
  paths, missing = _expand(files)
39
48
  for f in missing:
40
- _error(f, "no files match" if any(c in str(f) for c in "*?[")
41
- else "not a file" if f.exists() else "no such file")
49
+ _error(f, "no files match" if any(c in str(f) for c in "*?[") else "not a file" if f.exists() else "no such file")
42
50
 
43
51
  if watch:
44
52
  _watch(paths, output_dir, pdf, odp, image_odp, debug, css)
@@ -67,10 +75,8 @@ def _expand(args: list[Path]) -> tuple[list[Path], list[Path]]:
67
75
  seen: set[Path] = set()
68
76
  missing: list[Path] = []
69
77
  for a in args:
70
- matches = ([Path(m) for m in glob.glob(str(a), recursive=True)]
71
- if any(c in str(a) for c in "*?[") else [a])
72
- found = sorted((m for m in matches if m.is_file()),
73
- key=lambda m: (m.resolve() != m.absolute(), str(m)))
78
+ matches = [Path(m) for m in glob.glob(str(a), recursive=True)] if any(c in str(a) for c in "*?[") else [a]
79
+ found = sorted((m for m in matches if m.is_file()), key=lambda m: (m.resolve() != m.absolute(), str(m)))
74
80
  if not found:
75
81
  missing.append(a)
76
82
  for m in found:
@@ -84,9 +90,17 @@ def _error(path: Path, msg: object) -> None:
84
90
  typer.echo(f"error: {path}: {msg}", err=True)
85
91
 
86
92
 
87
- def _build(file: Path, output_dir: Optional[Path], pdf: bool,
88
- odp: bool, image_odp: bool, dist: bool, optimize_images: bool,
89
- debug: bool, css_path: Optional[Path]) -> None:
93
+ def _build(
94
+ file: Path,
95
+ output_dir: Path | None,
96
+ pdf: bool,
97
+ odp: bool,
98
+ image_odp: bool,
99
+ dist: bool,
100
+ optimize_images: bool,
101
+ debug: bool,
102
+ css_path: Path | None,
103
+ ) -> None:
90
104
  content = file.read_text(encoding="utf-8")
91
105
  doc = parse(content)
92
106
  dims = doc.meta.dimensions()
@@ -94,20 +108,24 @@ def _build(file: Path, output_dir: Optional[Path], pdf: bool,
94
108
  out_dir = output_dir or file.parent / "dist"
95
109
  out_dir.mkdir(parents=True, exist_ok=True)
96
110
  _symlink_assets(file.parent, out_dir)
97
- stem = file.stem
111
+ stem = file.name.removesuffix(".deck.md") if file.name.endswith(".deck.md") else file.stem
98
112
 
99
- if doc.meta.theme and doc.meta.theme != "default":
100
- theme_css = load_theme(doc.meta.theme)
101
- else:
102
- theme_css = default_theme()
113
+ theme_css = load_theme(doc.meta.theme) if doc.meta.theme not in (None, "", "default") else default_theme()
103
114
  if css_path and css_path.is_file():
104
115
  theme_css += "\n" + css_path.read_text(encoding="utf-8")
105
116
  theme_css += "\n" + (doc.meta.style or "")
106
117
 
107
118
  # Assemble CSS: base.css (with dims) + theme + logo + pygments
108
- css = assemble_css(base_css(), theme_css, dims, doc.meta.logo,
109
- doc.meta.watermark, doc.meta.pygments_style or "default",
110
- doc.meta.logo_dark, doc.meta.background)
119
+ css = assemble_css(
120
+ base_css(),
121
+ theme_css,
122
+ dims,
123
+ doc.meta.logo,
124
+ doc.meta.watermark,
125
+ doc.meta.pygments_style or "default",
126
+ doc.meta.logo_dark,
127
+ doc.meta.background,
128
+ )
111
129
 
112
130
  html = render_html(doc, theme_css, css, dims, doc.meta.logo)
113
131
  html_path = out_dir / f"{stem}.html"
@@ -127,8 +145,7 @@ def _build(file: Path, output_dir: Optional[Path], pdf: bool,
127
145
 
128
146
  if odp:
129
147
  odp_path = out_dir / f"{stem}.odp"
130
- render_odp(doc, odp_path, base_css(), theme_css,
131
- source_dir=file.parent)
148
+ render_odp(doc, odp_path, base_css(), theme_css, source_dir=file.parent)
132
149
  typer.echo(f"Wrote {odp_path} ({odp_path.stat().st_size} bytes)")
133
150
 
134
151
  if image_odp:
@@ -148,13 +165,12 @@ def _build(file: Path, output_dir: Optional[Path], pdf: bool,
148
165
  typer.echo(f"Parsed {len(doc.slides)} slides")
149
166
  if debug:
150
167
  for i, slide in enumerate(doc.slides):
151
- typer.echo(f" Slide {i+1}: {slide.layout} ({len(slide.children)} children)")
168
+ typer.echo(f" Slide {i + 1}: {slide.layout} ({len(slide.children)} children)")
152
169
  for n in slide.children:
153
170
  typer.echo(f" {type(n).__name__}: {_node_summary(n)}")
154
171
 
155
172
 
156
- def _watch(files: list[Path], output_dir: Optional[Path], pdf: bool,
157
- odp: bool, image_odp: bool, debug: bool, css_path: Optional[Path]) -> None:
173
+ def _watch(files: list[Path], output_dir: Path | None, pdf: bool, odp: bool, image_odp: bool, debug: bool, css_path: Path | None) -> None:
158
174
  if not files:
159
175
  raise typer.Exit(1)
160
176
  mtimes: dict[Path, float] = {}
@@ -181,7 +197,9 @@ def _watch(files: list[Path], output_dir: Optional[Path], pdf: bool,
181
197
 
182
198
 
183
199
  def _pdf_to_odp(pdf_path: Path, output_path: Path, dims: tuple[int, int]) -> None:
184
- import os, subprocess, tempfile
200
+ import subprocess
201
+ import tempfile
202
+
185
203
  from odfdo import Document, DrawPage, Frame
186
204
 
187
205
  sw, sh = dims
@@ -189,19 +207,13 @@ def _pdf_to_odp(pdf_path: Path, output_path: Path, dims: tuple[int, int]) -> Non
189
207
  odp.body.clear()
190
208
 
191
209
  with tempfile.TemporaryDirectory() as tmp:
192
- subprocess.run(
193
- ["pdftoppm", "-png", "-r", "150", str(pdf_path), f"{tmp}/page"],
194
- capture_output=True, text=True, timeout=60,
195
- )
210
+ subprocess.run(["pdftoppm", "-png", "-r", "150", str(pdf_path), f"{tmp}/page"], capture_output=True, text=True, timeout=60)
196
211
  for png_file in sorted(Path(tmp).glob("page-*.png")):
197
212
  i = int(png_file.stem.split("-")[1]) - 1
198
213
  page = DrawPage(f"slide{i + 1}", name=f"Slide {i + 1}")
199
214
  uri = odp.add_file(str(png_file))
200
215
  frame = Frame.image_frame(
201
- image=uri, text="",
202
- size=(f"{sw * 2.54 / 96:.2f}cm", f"{sh * 2.54 / 96:.2f}cm"),
203
- position=("0cm", "0cm"),
204
- anchor_type="page",
216
+ image=uri, text="", size=(f"{sw * 2.54 / 96:.2f}cm", f"{sh * 2.54 / 96:.2f}cm"), position=("0cm", "0cm"), anchor_type="page"
205
217
  )
206
218
  page.append(frame)
207
219
  odp.body.append(page)
@@ -210,7 +222,7 @@ def _pdf_to_odp(pdf_path: Path, output_path: Path, dims: tuple[int, int]) -> Non
210
222
 
211
223
 
212
224
  def _node_summary(node) -> str:
213
- from decktile.parser.ast import Heading, Table, Grid, AttrNode
225
+ from decktile.parser.ast import AttrNode, Grid, Heading, Table
214
226
 
215
227
  if isinstance(node, Heading):
216
228
  return f"L{node.level}: {node.content[0].content if node.content else ''}"
@@ -235,9 +247,8 @@ def _symlink_assets(source_dir: Path, dist_dir: Path) -> None:
235
247
  dest.symlink_to(item.resolve())
236
248
 
237
249
 
238
- def _make_dist(source_dir: Path, out_dir: Path, html_path: Path,
239
- html: str, theme_css: str, stem: str) -> None:
240
- import re, zipfile
250
+ def _make_dist(source_dir: Path, out_dir: Path, html_path: Path, html: str, theme_css: str, stem: str) -> None:
251
+ import zipfile
241
252
 
242
253
  zip_path = out_dir / f"{stem}.zip"
243
254
  seen = set()