004 - new / new-pptx / new-docx commands
Purpose: Scaffold new Quarto projects from bundled templates.
Status: Implemented (2026-05-07)
Requirements
Section titled “Requirements”mdd new-pptx <dir>creates a Quarto PowerPoint projectmdd new-pptx --compact <dir>does the same against the compact reference template (18 / 16 / 14 / 12 pt body text instead of 28 / 24 / 20 / 18 pt)mdd new-docx <dir>creates a Quarto Word projectmdd new <dir>creates a project with both outputs- Each creates:
<dir>/<dir>.qmd,<dir>/render.sh, symlink(s) to reference template(s) - Error if no directory name given or name starts with
-
Design Approach
Section titled “Design Approach”- Commands in
src/mdd/commands/new*.py; shared logic insrc/mdd/utils/scaffolding.py - Templates bundled at
src/mdd/templates/— resolved relative to__file__ create_quarto_project()is the shared helper{{TITLE}}in QMD templates is replaced with the base directory name{{FILE_NAME}}in render.sh.template is replaced with the base directory name
Implementation Notes
Section titled “Implementation Notes”Ported from quarto4sbp (cmd_new, cmd_new_pptx, cmd_new_docx). The
cmd_*(args) entrypoint shape was superseded by
S35’s register(subparsers, parents) convention;
the three modules now expose register() and _run_* handlers in
src/mdd/commands/new*.py.
Template files
Section titled “Template files”simple-presentation.{qmd,pptx}— PowerPoint outputsimple-presentation-compact.{qmd,pptx}— PowerPoint output, compact scalesimple-document.{qmd,docx}— Word outputcombined-document.qmd— both outputs from one sourcerender.sh.template— shell script to render and export PDF
Compact presentation template
Section titled “Compact presentation template”The default slide master runs a 28 / 24 / 20 / 18 pt body scale, which
overflows on dense slides (a table plus a few bullets). Rather than shrink the
default and reflow every existing deck, --compact selects a second bundled
reference template at 18 / 16 / 14 / 12 pt. The default stays pixel-stable.
simple-presentation-compact.pptxis byte-identical tosimple-presentation.pptxapart from nineszattributes inppt/slideMasters/slideMaster1.xml’s<p:bodyStyle>: levels 1-4 become1800/1600/1400/1200, and levels 5-9 follow level 4 at1200(the default already pins 5-9 to level 4). The4400title in<p:titleStyle>, the1800<p:otherStyle>default, the1200date/footer/slide-number placeholders, the1000disclaimer textbox and everyppt/slideLayouts/*.xmloverride are untouched.scripts/derive-compact-pptx.pyregenerates the binary from the default (--checkasserts the committed copy is up to date), so the change stays reviewable instead of arriving as an opaque blob. It rezips in the original entry order with the original compression,[Content_Types].xmlfirst, because a naively rebuilt archive triggers PowerPoint’s repair dialog.- Selection is front-matter only: the scaffolded
.qmdsetsreference-doc: simple-presentation-compact.pptxandcreate_quarto_projectsymlinks that name into the project. No converter change is needed —mdd.converters.quartoonly passes--reference-docon the S17 publish path, which uses its owntemplates/quarto/reference.pptx. mdd new(both outputs) andmdd new-docxkeep a single template each; the compact variant is a presentation-only concern.
Site built 2026-07-30.