no documentation on how to get automatic screenshots in interactive element
See the various messages in this thread. Here is @rbeezer's workflow, but there were several others.
-
Install node.js/npm if you do not have it already.
-
"pageres" is the main tool here: https://github.com/sindresorhus/pageres-cli
Install (as root?) with: npm install --global pageres-cli
I could not get a global install to succeed, so have a user-level install to use. PhantomJS is a headless web browser, I ended up getting it via the Ubuntu package manager in the course of sorting out global v. user.
Then I needed to add the full path on the executable in the mbx.cfg configuration file.
-
You will be happier in the long run if all your "interactive" have author-specified @xml:id, since these can change and will also be used to name the screenshots.
-
Edit/add docinfo/html/baseurl/@href to be the URL of the directory your HTML files live in on the server. No trailing slash.
-
Rebuild HTML and upload to the server.
-
Use something like
/path/to/script/mbx -vv -c preview -f png -d . /path/to/my-book.xml
** I think the -f is ignored.
** pageres writes into the current directory. Should be handled, but you might want to set the default directory someplace in /tmp
** there is a 5-second delay to let each interactive load, not yet configurable
-
Copy *.png produced to your "images" directory (locally, not on server)
-
Build LaTeX to see new images in place.
@StevenClontz @rbeezer @oscarlevin Is some of this resolved by some of the changes with the pypetteer or pretext script/CLI improvements?
sorry I meant "playwright", I guess
Yes, I think it all should be working very well now. I will take a look at the CLI documentation to see if anything needs to be cleaned up. Until then, if you run pretext generate or more specifically pretext generate interactive then everything should just work.
This can be closed.