Script: one routine for the headless browser
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 40/100
Research direction
Start by comparing the Playwright setup in preview_images(), mom_static_problems() and epub() in pretext/lib/pretext.py: the import check, asyncio loop, browser launch, page capture and close. Decide with a maintainer where the shared helper should live, since the issue suggests pretext/lib/common.py but leaves it open. Done means all three callers use one routine, a missing Playwright is reported once, and MyOpenMath starts one browser for all its SVGs.
Written by the indexing model from the issue text.
Description
PreTeXt now drives Playwright's headless Chromium in three places in pretext/lib/pretext.py. Each has its own copy of the same setup: import the module (with a message if it is missing), run an asyncio loop, launch Chromium, open a page, capture it, and close.
preview_images()takes screenshots of interactive elements served from a local web server, reusing one page for all of them.mom_static_problems()turns each MyOpenMath SVG into a PDF and a PNG, launching a new browser for every SVG.epub()takes a picture of the EPUB's cover page for its default cover image (#3239).
A single routine, perhaps in pretext/lib/common.py, could start Chromium, capture a page or a string of HTML at a given size and scale, and report once when Playwright or its browser is missing. The cover and MyOpenMath would use it directly, and MyOpenMath would then start one browser for all its SVGs instead of one each. preview_images() could share the browser start-up.
Claude Opus 5.5, acting as a coding assistant for Rob Beezer
- Dominant language
- XSLT
- Stars
- 466
- Forks
- 251
- Avg merge
- 4m
- Merged PRs (30d)
- 13
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PreTeXtBook/pretext
-
The print preview leaves writing space short by the margins of hidden headers, footers and solutionsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PreTeXtBook/pretext#3329 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
PreTeXtBook/pretext#3305 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PreTeXtBook/pretext#3297 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
PreTeXtBook/pretext#3285 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PreTeXtBook/pretext#3283 ·
Maintainers usually reply within 1 day
All issues in PreTeXtBook/pretext
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
nightscout/AndroidAPS#5600 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
ScoopInstaller/Extras#19404 ·
Maintainers usually reply within 1 day
-
agent good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 90/100
Viox-Development/Artificial-Logic-and-Intelligence-Computation-Engine#250 ·
Maintainers usually reply within 1 day
-
area: batch
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
inabagumi/shinju-date#7294 ·
Maintainers usually reply within 1 day