Skip to content

Commit f9830a0

Browse files
committed
Add poster extension: ASCII grid layout, per-section callout boxes, meta-descriptive template
- poster_preprocessor.py: parse ASCII layout + ## X: Title sections into CSS Grid HTML - poster_compiler.py: compilation pipeline for HTML/PDF with asset copying - cli.py: poster compile + poster init commands - cdl-poster-theme.css: full poster theme (semi-transparent sections, callout boxes) - sample_poster.md: meta-descriptive template with per-section color coding - 41 poster tests + fixtures - pyproject.toml: animation support included by default
1 parent 578be85 commit f9830a0

25 files changed

Lines changed: 1696 additions & 17 deletions
479 KB
Loading

docs/screenshots/poster-sample.png

538 KB
Loading

examples/sample_poster.md

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
---
2+
marp: true
3+
theme: cdl-poster
4+
size: A0
5+
---
6+
7+
```poster-layout
8+
TTTTTTTTTTTTTTTTTTTTTTTTTTTT
9+
IIIIIIIIMMMMMMMMMMMMRRRRRRRR
10+
IIIIIIIIMMMMMMMMMMMMRRRRRRRR
11+
IIIIIIIIMMMMMMMMMMMMRRRRRRRR
12+
IIIIIIIIMMMMMMMMMMMMRRRRRRRR
13+
CCCCCCCCDDDDDDDDDDDDRRRRRRRR
14+
CCCCCCCCDDDDDDDDDDDDRRRRRRRR
15+
CCCCCCCCDDDDDDDDDDDDRRRRRRRR
16+
CCCCCCCCDDDDDDDDDDDDRRRRRRRR
17+
```
18+
19+
## T: Your poster title goes here
20+
21+
## A brief subtitle that captures the main finding or question
22+
23+
**Author One**¹, **Author Two**¹², **Author Three**²
24+
25+
¹ Department of Psychological and Brain Sciences, Dartmouth College | ² Collaborating Institution
26+
27+
## I: Introduction and motivation
28+
29+
<div class="note-box" data-title="Orient your audience">
30+
31+
Start with the **broad question** your research addresses. Why should the reader care? Narrow from the big picture to your specific contribution in 3–5 sentences.
32+
33+
</div>
34+
35+
<div class="note-box" data-title="What to include">
36+
37+
- The **big-picture problem** your work addresses
38+
- Why existing approaches fall short
39+
- Your specific **research question** or hypothesis
40+
- A visual or diagram that captures the core idea
41+
42+
</div>
43+
44+
<div class="note-box" data-title="Less is more">
45+
46+
Aim for **minimal text** and **maximal visual impact**. A reader should grasp your motivation in under 30 seconds. Use a figure instead of a paragraph wherever possible.
47+
48+
</div>
49+
50+
## M: Methods
51+
52+
<div class="definition-box" data-title="Experimental design">
53+
54+
Describe your **paradigm** concisely: number of participants, key conditions, stimuli, and procedure. A flow diagram is ideal here.
55+
56+
</div>
57+
58+
<div class="definition-box" data-title="Analysis pipeline">
59+
60+
Show your pipeline as a visual flow: **collection → preprocessing → modeling → validation**. A diagram works best here.
61+
62+
</div>
63+
64+
<div class="definition-box" data-title="Figures over formulas">
65+
66+
Prefer **diagrams and flowcharts** over dense notation. Limit to one or two key formulas at most.
67+
68+
</div>
69+
70+
<div class="definition-box" data-title="Tools and code">
71+
72+
List key software and libraries used. If your code is open source, include a link or QR code to the repository.
73+
74+
</div>
75+
76+
## R: Results
77+
78+
<div class="example-box" data-title="Tell a story with your data">
79+
80+
Lead with your **most critical result** first, then provide supporting evidence. Every figure should have a clear, self-explanatory takeaway message.
81+
82+
</div>
83+
84+
<div class="example-box" data-title="Figure 1: Main result">
85+
86+
Place your **primary finding** here. The figure should be self-explanatory — a reader should understand the key message without reading surrounding text.
87+
88+
</div>
89+
90+
<div class="example-box" data-title="Figure 2: Supporting evidence">
91+
92+
Additional results that **support or extend** your main finding. Use tables for quantitative comparisons, or multi-panel figures for consistency across conditions.
93+
94+
</div>
95+
96+
<div class="example-box" data-title="Statistical reporting">
97+
98+
Report key statistics concisely. Use a small **table** for multiple comparisons, or annotate figures directly with significance markers.
99+
100+
</div>
101+
102+
<div class="example-box" data-title="Common pitfall">
103+
104+
Don't overcrowd this section. **Two or three well-designed figures** are far more effective than five cramped ones. Leave white space for visual breathing room.
105+
106+
</div>
107+
108+
<div class="example-box" data-title="Figure 3: Replication">
109+
110+
If applicable, show that your findings **generalize** across datasets, conditions, or participant groups. This strengthens the impact of your main result.
111+
112+
</div>
113+
114+
## C: Conclusions and future directions
115+
116+
<div class="tip-box" data-title="Summary of findings">
117+
118+
Restate your **key findings** in 2–3 bullet points. Connect them back to the motivating question from the introduction.
119+
120+
</div>
121+
122+
<div class="tip-box" data-title="Broader impact">
123+
124+
Explain why your findings **matter** beyond the specific experiment — theoretical, clinical, or practical implications.
125+
126+
</div>
127+
128+
<div class="tip-box" data-title="Limitations">
129+
130+
Acknowledge **limitations** honestly and note how future work might address them.
131+
132+
</div>
133+
134+
<div class="tip-box" data-title="Future directions">
135+
136+
- Next experiments you plan to run
137+
- Extensions of the current approach
138+
- Open questions raised by your findings
139+
140+
</div>
141+
142+
## D: References and acknowledgments
143+
144+
<div class="warning-box" data-title="References">
145+
146+
Include **5–10 key citations** most relevant to your work. Use a numbered list with abbreviated journal names. Prioritize citations the reader might actually look up.
147+
148+
</div>
149+
150+
<div class="warning-box" data-title="Acknowledgments and funding">
151+
152+
Thank funding agencies (with grant numbers), collaborators, and lab members. Mention shared resources and institutional support.
153+
154+
</div>
155+
156+
**Contact**: your.email@dartmouth.edu | **Web**: context-lab.com | **Code**: github.com/ContextLab

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,4 @@ select = ["E", "F", "W", "I"]
7777
[tool.ruff.lint.per-file-ignores]
7878
# Preprocessor contains embedded SVG/HTML templates that naturally exceed line length
7979
"src/cdl_slides/preprocessor.py" = ["E501"]
80+
"src/cdl_slides/poster_preprocessor.py" = ["E501"]

src/cdl_slides/assets.py

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -143,34 +143,35 @@ def replace_url(match: re.Match) -> str:
143143
return url_pattern.sub(replace_url, css_content)
144144

145145

146-
def prepare_theme_for_compilation(work_dir: Path) -> Path:
146+
def prepare_theme_for_compilation(work_dir: Path, theme_name: str = "cdl-theme") -> Path:
147147
"""Prepare the CDL theme for Marp compilation with proper asset paths.
148148
149149
Creates a temporary directory in the same location as the work directory
150150
with the following structure:
151151
152-
cdl-theme-XXXX/
153-
├── cdl-theme.css (font urls rewritten to file://)
154-
├── themes/ (copied from package assets)
155-
│ ├── background_geometry.svg
156-
│ ├── conversation_green_32pct.png
157-
│ └── ...
158-
└── images/ (copied from package assets)
159-
├── arrow-clean.svg
160-
└── ...
152+
cdl-theme-XXXX/
153+
├── cdl-theme.css (font urls rewritten to file://)
154+
├── themes/ (copied from package assets)
155+
│ ├── background_geometry.svg
156+
│ ├── conversation_green_32pct.png
157+
│ └── ...
158+
└── images/ (copied from package assets)
159+
├── arrow-clean.svg
160+
└── ...
161161
162162
The CSS references themes/ and images/ via relative paths, which resolve
163163
because those directories are copied alongside the CSS file.
164164
165165
Args:
166-
work_dir: Directory containing the input markdown file
166+
work_dir: Directory containing the input markdown file
167+
theme_name: Name of the theme CSS file (default: "cdl-theme")
167168
168169
Returns:
169-
Path to the directory containing the rewritten CSS file
170-
(suitable for use with marp --theme-set)
170+
Path to the directory containing the rewritten CSS file
171+
(suitable for use with marp --theme-set)
171172
"""
172173
assets_dir = get_assets_dir()
173-
original_theme = get_themes_dir() / "cdl-theme.css"
174+
original_theme = get_themes_dir() / f"{theme_name}.css"
174175

175176
if not original_theme.exists():
176177
raise FileNotFoundError(f"CDL theme not found at {original_theme}")
@@ -181,15 +182,15 @@ def prepare_theme_for_compilation(work_dir: Path) -> Path:
181182
css_content = original_theme.read_text(encoding="utf-8")
182183
rewritten_css = _rewrite_css_urls(css_content, assets_dir)
183184

184-
output_theme = temp_dir / "cdl-theme.css"
185+
output_theme = temp_dir / f"{theme_name}.css"
185186
output_theme.write_text(rewritten_css, encoding="utf-8")
186187

187188
# Copy themes/ directory (background SVG, conversation PNGs)
188189
src_themes = get_themes_dir()
189190
dst_themes = temp_dir / "themes"
190191
dst_themes.mkdir(exist_ok=True)
191192
for f in src_themes.iterdir():
192-
if f.is_file() and f.name != "cdl-theme.css":
193+
if f.is_file() and not f.name.endswith(".css"):
193194
shutil.copy2(f, dst_themes / f.name)
194195

195196
# Copy images/ directory (arrow SVGs)
@@ -225,7 +226,7 @@ def copy_assets_alongside_output(output_html: Path, source_dir: Optional[Path] =
225226
src_themes = get_themes_dir()
226227
dst_themes.mkdir(exist_ok=True)
227228
for f in src_themes.iterdir():
228-
if f.is_file() and f.name != "cdl-theme.css":
229+
if f.is_file() and not f.name.endswith(".css"):
229230
shutil.copy2(f, dst_themes / f.name)
230231

231232
# Copy images/ (arrow SVGs)

0 commit comments

Comments
 (0)