ooad1-2 Exercise 3: A Diagrams Folder and the Render Script ========================================================== Folder ex3/ contains a.class.mmd (Mermaid) and b.sequence.puml (PlantUML), and uses render_diagrams.py from the chapter. Commands and real output: $ py render_diagrams.py ex3 (first run) rendered ex3\a.class.mmd -> a.class.mmd.svg (23 KB) rendered ex3\b.sequence.puml -> b.sequence.puml.svg (4 KB) $ py render_diagrams.py ex3 (second run, nothing changed) up to date ex3\a.class.mmd up to date ex3\b.sequence.puml ... edit b.sequence.puml (add one message) ... $ py render_diagrams.py ex3 (after the edit) up to date ex3\a.class.mmd rendered ex3\b.sequence.puml -> b.sequence.puml.svg (4 KB) ... add a broken file, c.class.mmd ... $ py render_diagrams.py ex3 (with a broken file) up to date ex3\a.class.mmd up to date ex3\b.sequence.puml FAILED ex3\c.class.mmd Error: Parse error on line 2: exit code: 1 WHY THIS WORKS AS AN ANSWER --------------------------- Each of the four behaviours matters. The first run produces both pictures. The second run proves the "only if newer" check works, which keeps the command fast enough to run before every commit. Editing one source re-renders only that one. The broken Mermaid file is reported as FAILED with the parser's message and the script's exit status is 1, so a build or a git hook can refuse to continue. The editing step is a scripted one-line change; the one-second pause before it is there because file timestamps have limited resolution and a change in the same instant could look unchanged.