PreTeXtBook / pretext

PreTeXt: an authoring and publishing system for scholarly documents
https://pretextbook.org
Other
266 stars 208 forks source link

chunking webwork #1987

Open Alex-Jordan opened 1 year ago

Alex-Jordan commented 1 year ago

Something is off with chunking webwork pg output, and I can't crack the code to understand how to fix it. Here is the issue.

Say you have a book with a publisher file with common/chunking/@level="2" (the default) so that individual web pages are sections of the book. Within a section, there are some inline webwork exercises and an "exercises" section with more webwork exercises. If I run the routine to make the archive of pg files (~/pretext/pretext/pretext -p publication/publication.xml -c all -f webwork-sets -z src/main.ptx) then I end up with chunking at the chapter level. Specifically, I get a folder for chapter 1 with all .pg files from that chapter. And I get a set definition file that makes a giant exercise set with all exercises from chapter 1.

If I change the chunking level to 3, then I get what I would like with the PG folder: the chapter 1 folder has subfolders for each section. And the set definition files either cover a section's "exercises" or cover its inline exercises. But now my HTML build is chunking too deep.

For now I am toggling the chunk level as needed. But it should be able to stay at 2 and just work for HTML as well as PG.

rbeezer commented 1 year ago

Does your book have part?

Alex-Jordan commented 1 year ago

It has decorative parts.

rbeezer commented 1 year ago

I guess decorative parts are ignored for the chunking level? And something is off-by-one (duh) for WW problem sets.

Try structural parts and see what changes? What settings do you need to get what you want and do they make sense?

Setting the chunk level is odd, because each conversion may have different defaults (iirc). The publisher file rules, but if not set, each conversion takes over and provides its own defaults (in a semi-complicated choose)? Did I say, IIRC. Going offline shortly for the afternoon, most likely.

Alex-Jordan commented 1 year ago

I removed the chunk level from the publication file. It defaults to what it should be for HTML section pages, which is 2 in my case.

  1. Now when I run the WW archiving it behaves like chunk level 0. I get one giant folder of pg problems for the whole book. So already it looks like the default is bad. Proceeding, I set the chunk level via -x switch.
  2. I try again with -x chunk.level 2. I get chunking at the chapter level.
  3. I try again with -x chunk.level 2 and commenting out the parts. Now get chunking at the section level.

So do I have this right? The archiving stylesheet needs to set a default chunk level based on book/article and based on presence/absence of (possibly decorative?) parts. I think that it should match whatever default chunk level HTML is using. If so, should I just copy that? Does -common have a role with this?