From abb420d2d1897d1e4d4ccd05a8990aba97a5f817 Mon Sep 17 00:00:00 2001 From: Hassan Kibirige Date: Tue, 27 Oct 2026 17:57:50 +0300 Subject: [PATCH] refactor: correct the documented term-recording path and drop a dead guard The term-recording pre-render docstring said recordings render into `great-docs/termshow/`. They render into `termshow/` under the build directory, which is not always named `great-docs`. Correct the docstring and document its logger parameter. The term player imports only the standard library and a hard dependency of the package, so the `ImportError` guard around its import could not fire. Remove it. Behaviour is unchanged. --- great_docs/core.py | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/great_docs/core.py b/great_docs/core.py index 371156cb..12823c53 100644 --- a/great_docs/core.py +++ b/great_docs/core.py @@ -15193,14 +15193,19 @@ def _write_metadata_partial(self, config: dict) -> None: html_config["template-partials"] = partials def _prerender_term_player(self, log) -> None: # pragma: no cover - """Pre-render .termshow recordings into SVG keyframes + manifest.json. + """ + Pre-render `.termshow` recordings for the Quarto shortcode + + Render recordings from the source directory as SVG keyframes and a + `manifest.json`, applying companion `.termshow.yml` scripts when present. + Write output to `/termshow//`. + Paths are relative to the source directory, so recordings with the same name + in different directories have separate output directories. - Discovers all .termshow files in the project root, applies any - companion .termshow.yml scripts, and renders SVG frames into - great-docs/termshow// so the Quarto - shortcode can reference them. Keying output by relative path (rather - than basename) keeps same-named recordings in different directories - from overwriting each other. + Parameters + ---------- + log : + Build logger that receives progress and warning messages. """ # Find all .termshow files in the project root (they live outside @@ -15215,15 +15220,12 @@ def _prerender_term_player(self, log) -> None: # pragma: no cover if not termshow_files: return - try: - from great_docs._term_player import ( - apply_script, - generate_manifest, - parse_termshow, - ) - from great_docs._term_player.script import load_script - except ImportError: - return + from great_docs._term_player import ( + apply_script, + generate_manifest, + parse_termshow, + ) + from great_docs._term_player.script import load_script rendered_count = 0 manifest_bytes = 0