PreTeXtBook / pretext-cli

Command line interface for quickly creating, authoring, and building PreTeXt documents.
https://pretextbook.org
GNU General Public License v3.0
18 stars 18 forks source link

interactive previews re-captured on Windows(?) #718

Open StevenClontz opened 6 months ago

StevenClontz commented 6 months ago

Working with https://github.com/tjmagnus/polyomino it was demonsrated that when Terri rebuilds her print target on her own (Windows) machine, the previews for each interactive are being regenerated every time. This is not the intended behavior, where on a Codespace the images are built once then not built again.

oscarlevin commented 5 months ago

The generate logic is working as intended, but the interactives are not being generated. When I try to generate interactive previews on my windows machine, I get a timeout after 30000ms. Since not all assets were generated, the generate step failed and as such pretext tries to generate them again on the next build.

So, what to do? I'm not sure where the timeout is coming from, perhaps that can be adjusted. Or maybe the right thing to do is to try to save successful assets to the hash table earlier so that we record the ones that work, and on subsequent runs they are not reattempted. It does seem like when it is a subset of assets that need to be generated, that slows things down a LOT: each preview is generated separately, which avoids the timeout, but all the infrastructure for starting the headless browser is done for each xml:id. In fact, in another issue with this, the only reasonable solution I can think of is to not limit by xml:id when multiple assets are requested. Any ideas, @StevenClontz?

@tjmagnus, if you want to get this working while the fix is still in process, you can run pretext generate -q -t print -x ch-intro, which will generate only the previews for the intro chapter (that has xml:id="ch-intro").

tjmagnus commented 5 months ago

I think I'll wait on the fix and continue to focus on the HTML version for now. Thank you for looking into this.

Terri Teresa D. Magnus, Ph.D. Professor of Mathematics Director of the Mathematics Program Department of Mathematics and Computer Science

Rivier University 420 S. Main St. Nashua NH 03060

(603) 897-8462


From: Oscar Levin @.> Sent: Wednesday, May 29, 2024 9:09 PM To: PreTeXtBook/pretext-cli @.> Cc: Magnus, Teresa D @.>; Mention @.> Subject: [EXT]: Re: [PreTeXtBook/pretext-cli] interactive previews re-captured on Windows(?) (Issue #718)

EXTERNAL EMAIL

The generate logic is working as intended, but the interactives are not being generated. When I try to generate interactive previews on my windows machine, I get a timeout after 30000ms. Since not all assets were generated, the generate step failed and as such pretext tries to generate them again on the next build.

So, what to do? I'm not sure where the timeout is coming from, perhaps that can be adjusted. Or maybe the right thing to do is to try to save successful assets to the hash table earlier so that we record the ones that work, and on subsequent runs they are not reattempted. It does seem like when it is a subset of assets that need to be generated, that slows things down a LOT: each preview is generated separately, which avoids the timeout, but all the infrastructure for starting the headless browser is done for each xml:id. In fact, in another issue with this, the only reasonable solution I can think of is to not limit by xml:id when multiple assets are requested. Any ideas, @StevenClontzhttps://github.com/StevenClontz?

@tjmagnushttps://github.com/tjmagnus, if you want to get this working while the fix is still in process, you can run pretext generate -q -t print -x ch-intro, which will generate only the previews for the intro chapter (that has xml:id="ch-intro").

— Reply to this email directly, view it on GitHubhttps://github.com/PreTeXtBook/pretext-cli/issues/718#issuecomment-2138492131, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A5CXXJPHHZCHK7EJSTERFRLZEZ33DAVCNFSM6AAAAABGXA4CYKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZYGQ4TEMJTGE. You are receiving this because you were mentioned.Message ID: @.***>