Skip to content

feat: name offline HTML files after explicit titles - #319

Open
the8thbit wants to merge 1 commit into
ReadAlongs:mainfrom
the8thbit:fix/title-offline-html-filename-234
Open

the8thbit wants to merge 1 commit into
ReadAlongs:mainfrom
the8thbit:fix/title-offline-html-filename-234

Conversation

@the8thbit

Copy link
Copy Markdown
Contributor

PR Goal?

Use a slugified, explicitly configured title as the offline HTML filename. Missing, empty, default, or punctuation-only titles retain the output basename. Readalong and audio asset filenames keep their existing names.

Fixes?

Fixes #234.

Tests added?

Six integration cases cover explicit and accented titles, the default title, an empty title, punctuation-only text, and no configured title. The existing HTML CLI test now checks the title-based filename.

How to test?

pytest tests/test_align_cli.py -q

The full CLI file passes all 18 tests, including the six new cases. Applicable formatting, lint, and type-check hooks pass; the new title cases were also independently rerun.

Version change?

Feature; no version files changed.

@semanticdiff-com

semanticdiff-com Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  readalongs/align.py  54% smaller
  tests/test_align_cli.py  9% smaller
  docs/cli-guide.md Unsupported file format

@joanise

joanise commented Oct 24, 2026

Copy link
Copy Markdown
Member

This issue highlights a slight incongruity in the Studio's use of "Header" vs "Title". The title is actually the HTML page title and that ends up in the browser tab, which is often not that visible, while the Header is what is clearly shown to the reader of the read-along just above the readalong. The CLI guide should probably say something about this subtlety.

In Studio-Web, the HTML title is not separately modifiable, it's always set the the Header instead, so there the filename coming from header==title is unambiguously correct.

In the Studio CLI, there is a philosophical question: should the filename be based on the "Title" or on the "Header"? I'll have to think about this before I decide whether to approve this PR as is or change it to use the header. If you have preference as to which one would make more sense to you, I'll consider it before I decide.

@the8thbit
the8thbit force-pushed the fix/title-offline-html-filename-234 branch from 581fcbc to 9c92eb8 Compare October 24, 2026 03:38

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI: when the user sets the title, create the offline HTML filename from the slugified title

2 participants