cdl-slides 1.1.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.
- cdl_slides-1.1.0/.github/workflows/ci.yml +91 -0
- cdl_slides-1.1.0/.gitignore +222 -0
- cdl_slides-1.1.0/AGENTS.md +105 -0
- cdl_slides-1.1.0/CHANGELOG.md +45 -0
- cdl_slides-1.1.0/LICENSE +21 -0
- cdl_slides-1.1.0/PKG-INFO +670 -0
- cdl_slides-1.1.0/README.md +634 -0
- cdl_slides-1.1.0/docs/screenshots/01-title-slide.png +0 -0
- cdl_slides-1.1.0/docs/screenshots/02-callout-boxes.png +0 -0
- cdl_slides-1.1.0/docs/screenshots/03-callout-tip-warning.png +0 -0
- cdl_slides-1.1.0/docs/screenshots/04-callout-def-ex-imp.png +0 -0
- cdl_slides-1.1.0/docs/screenshots/05-code-example.png +0 -0
- cdl_slides-1.1.0/docs/screenshots/06-math-katex.png +0 -0
- cdl_slides-1.1.0/docs/screenshots/07-flow-diagram.png +0 -0
- cdl_slides-1.1.0/docs/screenshots/08-emoji-figures.png +0 -0
- cdl_slides-1.1.0/docs/screenshots/09-two-column.png +0 -0
- cdl_slides-1.1.0/docs/screenshots/10-simple-table.png +0 -0
- cdl_slides-1.1.0/docs/screenshots/11-output-formats.png +0 -0
- cdl_slides-1.1.0/docs/screenshots/12-manim-animation.png +0 -0
- cdl_slides-1.1.0/docs/screenshots/poster-sample.png +0 -0
- cdl_slides-1.1.0/examples/animations/AnimateScene_0ddd03e0.gif +0 -0
- cdl_slides-1.1.0/examples/animations/AnimateScene_7ddc19c0.gif +0 -0
- cdl_slides-1.1.0/examples/sample_poster.md +271 -0
- cdl_slides-1.1.0/examples/sample_presentation.html +1532 -0
- cdl_slides-1.1.0/examples/sample_presentation.md +457 -0
- cdl_slides-1.1.0/pyproject.toml +81 -0
- cdl_slides-1.1.0/scripts/install-system-deps.sh +43 -0
- cdl_slides-1.1.0/setup.cfg +4 -0
- cdl_slides-1.1.0/setup.py +42 -0
- cdl_slides-1.1.0/src/cdl_slides/__init__.py +3 -0
- cdl_slides-1.1.0/src/cdl_slides/__main__.py +6 -0
- cdl_slides-1.1.0/src/cdl_slides/animate_parser.py +258 -0
- cdl_slides-1.1.0/src/cdl_slides/animate_transpiler.py +218 -0
- cdl_slides-1.1.0/src/cdl_slides/assets/fonts/AvenirLTStd-Black.otf +0 -0
- cdl_slides-1.1.0/src/cdl_slides/assets/fonts/AvenirLTStd-Book.otf +0 -0
- cdl_slides-1.1.0/src/cdl_slides/assets/fonts/AvenirLTStd-Heavy.otf +0 -0
- cdl_slides-1.1.0/src/cdl_slides/assets/fonts/AvenirLTStd-Light.otf +0 -0
- cdl_slides-1.1.0/src/cdl_slides/assets/fonts/AvenirLTStd-Medium.otf +0 -0
- cdl_slides-1.1.0/src/cdl_slides/assets/fonts/AvenirLTStd-Roman.otf +0 -0
- cdl_slides-1.1.0/src/cdl_slides/assets/fonts/FiraCode-Bold.ttf +0 -0
- cdl_slides-1.1.0/src/cdl_slides/assets/fonts/FiraCode-Medium.ttf +0 -0
- cdl_slides-1.1.0/src/cdl_slides/assets/fonts/FiraCode-Regular.ttf +0 -0
- cdl_slides-1.1.0/src/cdl_slides/assets/fonts/NotoSansSC-VariableFont_wght.ttf +0 -0
- cdl_slides-1.1.0/src/cdl_slides/assets/images/arrow-clean.svg +4 -0
- cdl_slides-1.1.0/src/cdl_slides/assets/images/arrow-head.svg +5 -0
- cdl_slides-1.1.0/src/cdl_slides/assets/images/arrow-stem.svg +4 -0
- cdl_slides-1.1.0/src/cdl_slides/assets/js/chart-animations.js +260 -0
- cdl_slides-1.1.0/src/cdl_slides/assets/js/chart-defaults.js +690 -0
- cdl_slides-1.1.0/src/cdl_slides/assets/themes/background_geometry.svg +6 -0
- cdl_slides-1.1.0/src/cdl_slides/assets/themes/cdl-poster-theme.css +502 -0
- cdl_slides-1.1.0/src/cdl_slides/assets/themes/cdl-theme.css +4063 -0
- cdl_slides-1.1.0/src/cdl_slides/assets/themes/conversation_blue.png +0 -0
- cdl_slides-1.1.0/src/cdl_slides/assets/themes/conversation_green.png +0 -0
- cdl_slides-1.1.0/src/cdl_slides/assets/themes/conversation_green_15pct.png +0 -0
- cdl_slides-1.1.0/src/cdl_slides/assets/themes/conversation_green_32pct.png +0 -0
- cdl_slides-1.1.0/src/cdl_slides/assets.py +278 -0
- cdl_slides-1.1.0/src/cdl_slides/cli.py +420 -0
- cdl_slides-1.1.0/src/cdl_slides/compiler.py +233 -0
- cdl_slides-1.1.0/src/cdl_slides/manim_renderer.py +545 -0
- cdl_slides-1.1.0/src/cdl_slides/marp_cli.py +204 -0
- cdl_slides-1.1.0/src/cdl_slides/poster_compiler.py +197 -0
- cdl_slides-1.1.0/src/cdl_slides/poster_preprocessor.py +284 -0
- cdl_slides-1.1.0/src/cdl_slides/preprocessor.py +1808 -0
- cdl_slides-1.1.0/src/cdl_slides.egg-info/PKG-INFO +670 -0
- cdl_slides-1.1.0/src/cdl_slides.egg-info/SOURCES.txt +105 -0
- cdl_slides-1.1.0/src/cdl_slides.egg-info/dependency_links.txt +1 -0
- cdl_slides-1.1.0/src/cdl_slides.egg-info/entry_points.txt +2 -0
- cdl_slides-1.1.0/src/cdl_slides.egg-info/requires.txt +10 -0
- cdl_slides-1.1.0/src/cdl_slides.egg-info/top_level.txt +1 -0
- cdl_slides-1.1.0/tests/__init__.py +0 -0
- cdl_slides-1.1.0/tests/conftest.py +121 -0
- cdl_slides-1.1.0/tests/fixtures/animate_malformed.md +11 -0
- cdl_slides-1.1.0/tests/fixtures/animate_multi_animation.md +18 -0
- cdl_slides-1.1.0/tests/fixtures/animate_positioning.md +14 -0
- cdl_slides-1.1.0/tests/fixtures/animate_simple.md +10 -0
- cdl_slides-1.1.0/tests/fixtures/arrows.md +8 -0
- cdl_slides-1.1.0/tests/fixtures/callout_boxes.md +24 -0
- cdl_slides-1.1.0/tests/fixtures/code_split.md +32 -0
- cdl_slides-1.1.0/tests/fixtures/flow_diagram.md +11 -0
- cdl_slides-1.1.0/tests/fixtures/images/arrow-clean.svg +4 -0
- cdl_slides-1.1.0/tests/fixtures/images/arrow-head.svg +5 -0
- cdl_slides-1.1.0/tests/fixtures/images/arrow-stem.svg +4 -0
- cdl_slides-1.1.0/tests/fixtures/manim_complex.md +40 -0
- cdl_slides-1.1.0/tests/fixtures/manim_simple.md +17 -0
- cdl_slides-1.1.0/tests/fixtures/math.md +13 -0
- cdl_slides-1.1.0/tests/fixtures/minimal.md +15 -0
- cdl_slides-1.1.0/tests/fixtures/poster_full.md +65 -0
- cdl_slides-1.1.0/tests/fixtures/poster_invalid_grid.md +18 -0
- cdl_slides-1.1.0/tests/fixtures/poster_minimal.md +24 -0
- cdl_slides-1.1.0/tests/fixtures/poster_missing_section.md +25 -0
- cdl_slides-1.1.0/tests/fixtures/table_split.md +21 -0
- cdl_slides-1.1.0/tests/fixtures/themes/background_geometry.svg +6 -0
- cdl_slides-1.1.0/tests/fixtures/themes/conversation_blue.png +0 -0
- cdl_slides-1.1.0/tests/fixtures/themes/conversation_green.png +0 -0
- cdl_slides-1.1.0/tests/fixtures/themes/conversation_green_15pct.png +0 -0
- cdl_slides-1.1.0/tests/fixtures/themes/conversation_green_32pct.png +0 -0
- cdl_slides-1.1.0/tests/test_animate_parser.py +411 -0
- cdl_slides-1.1.0/tests/test_animate_transpiler.py +491 -0
- cdl_slides-1.1.0/tests/test_assets.py +213 -0
- cdl_slides-1.1.0/tests/test_cli.py +91 -0
- cdl_slides-1.1.0/tests/test_compiler.py +123 -0
- cdl_slides-1.1.0/tests/test_manim_renderer.py +161 -0
- cdl_slides-1.1.0/tests/test_marp_cli.py +302 -0
- cdl_slides-1.1.0/tests/test_poster_cli.py +93 -0
- cdl_slides-1.1.0/tests/test_poster_compiler.py +94 -0
- cdl_slides-1.1.0/tests/test_poster_preprocessor.py +272 -0
- cdl_slides-1.1.0/tests/test_preprocessor.py +410 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
name: Test Python ${{ matrix.python-version }} on ${{ matrix.os }}
|
|
12
|
+
runs-on: ${{ matrix.os }}
|
|
13
|
+
strategy:
|
|
14
|
+
fail-fast: false
|
|
15
|
+
matrix:
|
|
16
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
17
|
+
python-version: ["3.9", "3.11", "3.13"]
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- name: Install system dependencies (Linux)
|
|
23
|
+
if: runner.os == 'Linux'
|
|
24
|
+
run: ./scripts/install-system-deps.sh
|
|
25
|
+
|
|
26
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
27
|
+
uses: actions/setup-python@v5
|
|
28
|
+
with:
|
|
29
|
+
python-version: ${{ matrix.python-version }}
|
|
30
|
+
|
|
31
|
+
- name: Install package
|
|
32
|
+
run: pip install -e ".[dev]"
|
|
33
|
+
|
|
34
|
+
- name: Run unit tests
|
|
35
|
+
run: pytest tests/ -v --tb=short
|
|
36
|
+
|
|
37
|
+
lint:
|
|
38
|
+
name: Lint
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
steps:
|
|
41
|
+
- uses: actions/checkout@v4
|
|
42
|
+
|
|
43
|
+
- name: Set up Python
|
|
44
|
+
uses: actions/setup-python@v5
|
|
45
|
+
with:
|
|
46
|
+
python-version: "3.13"
|
|
47
|
+
|
|
48
|
+
- name: Install ruff
|
|
49
|
+
run: pip install ruff
|
|
50
|
+
|
|
51
|
+
- name: Run ruff check
|
|
52
|
+
run: ruff check src/ tests/
|
|
53
|
+
|
|
54
|
+
- name: Run ruff format check
|
|
55
|
+
run: ruff format --check src/ tests/
|
|
56
|
+
|
|
57
|
+
integration:
|
|
58
|
+
name: Integration test (with Marp CLI)
|
|
59
|
+
runs-on: ubuntu-latest
|
|
60
|
+
steps:
|
|
61
|
+
- uses: actions/checkout@v4
|
|
62
|
+
|
|
63
|
+
- name: Install system dependencies
|
|
64
|
+
run: ./scripts/install-system-deps.sh
|
|
65
|
+
|
|
66
|
+
- name: Set up Python
|
|
67
|
+
uses: actions/setup-python@v5
|
|
68
|
+
with:
|
|
69
|
+
python-version: "3.13"
|
|
70
|
+
|
|
71
|
+
- name: Install Google Chrome
|
|
72
|
+
uses: browser-actions/setup-chrome@latest
|
|
73
|
+
with:
|
|
74
|
+
chrome-version: stable
|
|
75
|
+
|
|
76
|
+
- name: Install package and run setup
|
|
77
|
+
run: |
|
|
78
|
+
pip install -e .
|
|
79
|
+
cdl-slides setup
|
|
80
|
+
|
|
81
|
+
- name: Compile sample presentation (HTML)
|
|
82
|
+
run: cdl-slides compile examples/sample_presentation.md --format html --no-animations
|
|
83
|
+
|
|
84
|
+
- name: Verify HTML output exists
|
|
85
|
+
run: test -f examples/sample_presentation.html
|
|
86
|
+
|
|
87
|
+
- name: Compile sample presentation (PDF)
|
|
88
|
+
run: cdl-slides compile examples/sample_presentation.md --format pdf --no-animations
|
|
89
|
+
|
|
90
|
+
- name: Verify PDF output exists
|
|
91
|
+
run: test -f examples/sample_presentation.pdf
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
#poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
+
#pdm.lock
|
|
116
|
+
#pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# pixi
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
+
#pixi.lock
|
|
123
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
+
.pixi
|
|
126
|
+
|
|
127
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
+
__pypackages__/
|
|
129
|
+
|
|
130
|
+
# Celery stuff
|
|
131
|
+
celerybeat-schedule
|
|
132
|
+
celerybeat.pid
|
|
133
|
+
|
|
134
|
+
# SageMath parsed files
|
|
135
|
+
*.sage.py
|
|
136
|
+
|
|
137
|
+
# Environments
|
|
138
|
+
.env
|
|
139
|
+
.envrc
|
|
140
|
+
.venv
|
|
141
|
+
env/
|
|
142
|
+
venv/
|
|
143
|
+
ENV/
|
|
144
|
+
env.bak/
|
|
145
|
+
venv.bak/
|
|
146
|
+
|
|
147
|
+
# Spyder project settings
|
|
148
|
+
.spyderproject
|
|
149
|
+
.spyproject
|
|
150
|
+
|
|
151
|
+
# Rope project settings
|
|
152
|
+
.ropeproject
|
|
153
|
+
|
|
154
|
+
# mkdocs documentation
|
|
155
|
+
/site
|
|
156
|
+
|
|
157
|
+
# mypy
|
|
158
|
+
.mypy_cache/
|
|
159
|
+
.dmypy.json
|
|
160
|
+
dmypy.json
|
|
161
|
+
|
|
162
|
+
# Pyre type checker
|
|
163
|
+
.pyre/
|
|
164
|
+
|
|
165
|
+
# pytype static type analyzer
|
|
166
|
+
.pytype/
|
|
167
|
+
|
|
168
|
+
# Cython debug symbols
|
|
169
|
+
cython_debug/
|
|
170
|
+
|
|
171
|
+
# PyCharm
|
|
172
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
173
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
174
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
175
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
176
|
+
#.idea/
|
|
177
|
+
|
|
178
|
+
# Abstra
|
|
179
|
+
# Abstra is an AI-powered process automation framework.
|
|
180
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
181
|
+
# Learn more at https://abstra.io/docs
|
|
182
|
+
.abstra/
|
|
183
|
+
|
|
184
|
+
# Visual Studio Code
|
|
185
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
186
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
187
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
188
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
189
|
+
# .vscode/
|
|
190
|
+
|
|
191
|
+
# Ruff stuff:
|
|
192
|
+
.ruff_cache/
|
|
193
|
+
|
|
194
|
+
# PyPI configuration file
|
|
195
|
+
.pypirc
|
|
196
|
+
|
|
197
|
+
# Cursor
|
|
198
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
199
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
200
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
201
|
+
.cursorignore
|
|
202
|
+
.cursorindexingignore
|
|
203
|
+
|
|
204
|
+
# Marimo
|
|
205
|
+
marimo/_static/
|
|
206
|
+
marimo/_lsp/
|
|
207
|
+
__marimo__/
|
|
208
|
+
|
|
209
|
+
# cdl-slides project-specific
|
|
210
|
+
cdl-theme-*/
|
|
211
|
+
.marp_processed_*.md
|
|
212
|
+
*.marp_processed_*.md
|
|
213
|
+
.sisyphus/
|
|
214
|
+
notes/
|
|
215
|
+
|
|
216
|
+
# Compiled example output (themes/images are copied during compile)
|
|
217
|
+
examples/themes/
|
|
218
|
+
examples/images/
|
|
219
|
+
examples/*.html
|
|
220
|
+
|
|
221
|
+
# macOS
|
|
222
|
+
.DS_Store
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# CDL-SLIDES KNOWLEDGE BASE
|
|
2
|
+
|
|
3
|
+
**Generated:** 2026-02-06
|
|
4
|
+
**Commit:** 6e9bc74
|
|
5
|
+
**Branch:** main
|
|
6
|
+
|
|
7
|
+
## OVERVIEW
|
|
8
|
+
|
|
9
|
+
Python CLI tool that compiles Markdown into CDL-themed Marp presentations. Core stack: Click CLI, Pygments highlighting, optional Manim animations.
|
|
10
|
+
|
|
11
|
+
## STRUCTURE
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
cdl-slides/
|
|
15
|
+
├── src/cdl_slides/
|
|
16
|
+
│ ├── cli.py # Entry point (cdl-slides command)
|
|
17
|
+
│ ├── preprocessor.py # Main logic: flow diagrams, code splitting, animations
|
|
18
|
+
│ ├── compiler.py # Orchestrates Marp CLI execution
|
|
19
|
+
│ ├── animate_parser.py # DSL parser for ```animate blocks
|
|
20
|
+
│ ├── animate_transpiler.py # Converts DSL AST to Manim Python
|
|
21
|
+
│ ├── manim_renderer.py # Executes Manim, generates GIFs
|
|
22
|
+
│ └── assets/ # Bundled fonts, CSS, images
|
|
23
|
+
├── tests/ # Pytest suite (238 tests)
|
|
24
|
+
└── examples/ # Sample presentations
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## WHERE TO LOOK
|
|
28
|
+
|
|
29
|
+
| Task | Location | Notes |
|
|
30
|
+
|------|----------|-------|
|
|
31
|
+
| Add CLI command | `cli.py` | Uses Click decorators |
|
|
32
|
+
| Modify slide preprocessing | `preprocessor.py` | Battle-tested regexes - don't refactor |
|
|
33
|
+
| Add DSL command | `animate_parser.py` + `animate_transpiler.py` | Add regex pattern + generation logic |
|
|
34
|
+
| Fix animation rendering | `manim_renderer.py` | Handles GIF caching |
|
|
35
|
+
| Update theme styles | `assets/themes/cdl-theme.css` | POSIX paths only |
|
|
36
|
+
|
|
37
|
+
## CRITICAL: ANIMATE DSL USAGE
|
|
38
|
+
|
|
39
|
+
**ALWAYS use the DSL markdown syntax for animations.** The DSL approach is preferred because it handles object creation and animation separation correctly, avoids Manim quirks, and produces cleaner, more maintainable code.
|
|
40
|
+
|
|
41
|
+
**Escape hatch:** For complex animations not expressible in DSL, use `manim <python_code> as NAME` within an animate block. This is the ONLY acceptable way to use raw Manim code.
|
|
42
|
+
|
|
43
|
+
### DSL Syntax (use this):
|
|
44
|
+
```
|
|
45
|
+
write equation "y = \sin(x)" as label
|
|
46
|
+
fade-in label
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Supported DSL Commands:
|
|
50
|
+
- `write equation "LATEX" as NAME [position]` - Create equation
|
|
51
|
+
- `write text "string" as NAME [position]` - Create text
|
|
52
|
+
- `create axes x=[min,max,step] y=[min,max,step] as NAME` - Coordinate system
|
|
53
|
+
- `create graph "formula" x=[min,max] color=COLOR as NAME` - Standalone function graph
|
|
54
|
+
- `plot "formula" on AXES color=COLOR stroke=N as NAME` - Plot on existing axes (stroke sets line width)
|
|
55
|
+
- `create [circle|square|arrow] color=COLOR as NAME` - Shapes
|
|
56
|
+
- `fade-in NAME` / `fade-out NAME` - Animations
|
|
57
|
+
- `draw NAME` - Create animation (for axes/graphs)
|
|
58
|
+
- `transform NAME1 -> NAME2` - Morph animation
|
|
59
|
+
- `wait SECONDS` - Pause
|
|
60
|
+
- `manim <python_code> as NAME` - Escape hatch for complex cases
|
|
61
|
+
|
|
62
|
+
### Position Modifiers:
|
|
63
|
+
- `at center`
|
|
64
|
+
- `above/below/left-of/right-of REFERENCE`
|
|
65
|
+
|
|
66
|
+
### Metadata (block header):
|
|
67
|
+
- `height: 400`, `width: 600`, `quality: high`, `scale: 2.5`
|
|
68
|
+
|
|
69
|
+
## ANTI-PATTERNS
|
|
70
|
+
|
|
71
|
+
| Forbidden | Reason |
|
|
72
|
+
|-----------|--------|
|
|
73
|
+
| Mock objects in tests | Must use real files/calls for verification |
|
|
74
|
+
| Refactoring preprocessor regexes | Battle-tested, port faithfully |
|
|
75
|
+
| Adding manim to core deps | Animation support is optional |
|
|
76
|
+
| External image references | All assets must be bundled |
|
|
77
|
+
| Silently swallowing errors | Must produce warning-box in HTML output |
|
|
78
|
+
| Using gifsicle | Use Pillow for GIF processing |
|
|
79
|
+
|
|
80
|
+
## CONVENTIONS
|
|
81
|
+
|
|
82
|
+
- **Line length**: 120 chars (Ruff)
|
|
83
|
+
- **Python**: >=3.9
|
|
84
|
+
- `preprocessor.py` ignores E501 (embedded templates)
|
|
85
|
+
- Tests must be "real-world" - no mocks
|
|
86
|
+
|
|
87
|
+
## COMMANDS
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# Development
|
|
91
|
+
pip install -e ".[dev,animations]"
|
|
92
|
+
pytest tests/ -v
|
|
93
|
+
ruff check src/ tests/ && ruff format src/ tests/
|
|
94
|
+
|
|
95
|
+
# Usage
|
|
96
|
+
cdl-slides compile slides.md --format html
|
|
97
|
+
cdl-slides compile slides.md --format pdf
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## NOTES
|
|
101
|
+
|
|
102
|
+
- Animation support included by default with `pip install cdl-slides`
|
|
103
|
+
- Marp CLI auto-downloads on first use
|
|
104
|
+
- GIFs cached by content hash in output directory (e.g., `animations/` alongside slides)
|
|
105
|
+
- Graceful degradation: missing manim shows warning-box, not crash
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.0.0] - 2026-02-06
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Animate DSL**: Declarative syntax for creating Manim animations without writing Python code
|
|
13
|
+
- Object commands: `write equation`, `write text`, `create axes`, `create graph`, `plot`, `create circle/square/arrow`
|
|
14
|
+
- Animation commands: `fade-in`, `fade-out`, `draw`, `transform`, `wait`
|
|
15
|
+
- Position modifiers: `at center`, `above/below/left-of/right-of`
|
|
16
|
+
- Metadata options: `height`, `width`, `quality`, `scale`
|
|
17
|
+
- Escape hatch: `manim <python_code> as NAME` for complex animations
|
|
18
|
+
- **Flow diagrams**: Simple ```` ```flow ```` syntax for pipeline diagrams with Dartmouth brand colors
|
|
19
|
+
- **Smart preprocessing**: Auto-splits long code blocks and tables across slides
|
|
20
|
+
- **Callout boxes**: Note, tip, warning, definition, example, and important box styles
|
|
21
|
+
- **Two-column layouts**: Flexbox-based column layouts with callout box styling
|
|
22
|
+
- **Scale directives**: Manual and automatic font scaling for dense slides
|
|
23
|
+
- **Emoji figures**: Styled emoji icons with colored backgrounds
|
|
24
|
+
- **Arrow syntax**: Shorthand for styled arrows (`--[80]->`, `--[lg]->`)
|
|
25
|
+
- **Syntax highlighting**: Code blocks with line numbers via Pygments
|
|
26
|
+
- **Math support**: KaTeX for inline and display equations
|
|
27
|
+
- **Cross-platform Marp CLI**: Auto-downloads standalone binary on first use (macOS, Linux, Windows)
|
|
28
|
+
- **Multiple output formats**: HTML, PDF, and PPTX
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
|
|
32
|
+
- Zero-config installation: `pip install cdl-slides` includes everything (Manim, FFmpeg, fonts)
|
|
33
|
+
- Bundled fonts: Avenir LT Std, Fira Code, Noto Sans SC
|
|
34
|
+
- Bundled ffmpeg via `imageio-ffmpeg` — no system installation required
|
|
35
|
+
- GIF caching by content hash for fast re-compilation
|
|
36
|
+
- Graceful degradation: animation errors show warning-box instead of crash
|
|
37
|
+
|
|
38
|
+
### CLI Commands
|
|
39
|
+
|
|
40
|
+
- `cdl-slides compile` — Compile Markdown to presentation
|
|
41
|
+
- `cdl-slides init` — Create new presentation from template
|
|
42
|
+
- `cdl-slides version` — Show version and Marp CLI status
|
|
43
|
+
- `cdl-slides setup` — Pre-download Marp CLI binary
|
|
44
|
+
|
|
45
|
+
[1.0.0]: https://github.com/ContextLab/cdl-slides/releases/tag/v1.0.0
|
cdl_slides-1.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Contextual Dynamics Laboratory
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|