Skip to content

WeBWorK: group WeBWorK representations into a folder#2898

Open
Alex-Jordan wants to merge 3 commits into
PreTeXtBook:masterfrom
Alex-Jordan:ww-reps-folder
Open

WeBWorK: group WeBWorK representations into a folder#2898
Alex-Jordan wants to merge 3 commits into
PreTeXtBook:masterfrom
Alex-Jordan:ww-reps-folder

Conversation

@Alex-Jordan

Copy link
Copy Markdown
Contributor

Previously, the generated/webwork/ folder had a few subfolders (pg, images) and one giant representations file. Now there are representations files for each exercise, and that folder is full of them. The presence of the pg and images folders is drowned out by so many individual representation files.

So this change makes a representations folder and puts all of the representations in there. The folder tree structure is now:

generated
    webwork
        images
            [image files]
        pg
            [pg files]
        representations
            [rep files]

@Alex-Jordan

Copy link
Copy Markdown
Contributor Author

I see that all of the representation files for the sample chapter and showcase article are committed to the repo. How would you like that handled with this PR? As a separate commit? I'm not sure what makes it easiest for you to do before/after testing that nothing really changed with those things.

@Alex-Jordan

Copy link
Copy Markdown
Contributor Author

For the three examples that have webwork exercises, I moved their repo representations files into the new folders this PR would create. That's on a separate commit, and I'm unsure if you'd prefer that they be merged.

@rbeezer

rbeezer commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

At first blush, I see some other changes that need to be made. For example a message A "webwork-representations.xml" in that directory indicates old-format files that need replacing. is now incorrect since "that directory" is now the new one and not the old one.

I've not checked, but will image files be found correctly? I can't tell if some paths would need to change.

@Alex-Jordan

Copy link
Copy Markdown
Contributor Author

OK, that message is reworded.

Yes, files are found correctly, since all of the looking for them passes through a publisher variable that is also adjusted here. I've successfully built HTML and PDF with this change, and with all old files in generated cleared out first.

@rbeezer

rbeezer commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

OK, this looks good. But it will create a headache for the CLI, methinks, and @oscarlevin.

  • Assets will need a regeneration. I was trying not to put authors onto a treadmill with repeated instances of this, as we bundled up some changes all at once already.
  • The CLI looks for the one grand file as a hint for re-generation, I think. Maybe that logic gets more complicated, looking now for some files at the top-level.

@oscarlevin is already hopping with other changes! What is the outlook, Oscar - should this be scheduled, or sooner is better? @Alex-Jordan - no other changes of this magnitude contemplated?

@Alex-Jordan

Alex-Jordan commented Jun 7, 2026 via email

Copy link
Copy Markdown
Contributor Author

@oscarlevin

oscarlevin commented Jun 7, 2026 via email

Copy link
Copy Markdown
Member

@oscarlevin

oscarlevin commented Jun 7, 2026 via email

Copy link
Copy Markdown
Member

@Alex-Jordan

Alex-Jordan commented Jun 7, 2026 via email

Copy link
Copy Markdown
Contributor Author

@rbeezer

rbeezer commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

Well, I've been away, so missed Oscar's window it seems.

And this is really only if @Alex-Jordan wants it (which is fine). I like structure. ;-)

But we need to do it soon, before @oscarlevin embarks on any kind of caching to differentiate the all-or-none dichotomy. If it sits for new week, then it needs to sit for two, and so should be marked off as a draft.

@oscarlevin

oscarlevin commented Jun 8, 2026 via email

Copy link
Copy Markdown
Member

@Alex-Jordan

Copy link
Copy Markdown
Contributor Author

OK. Now suppose an individual reps file is not inside generated/webwork/representatons/.

  1. It checks if the file is in the parent generated/webwork/ folder. Instructs user to move the file or rebuild reps.
  2. Failing that, it checks if there is a webwork-representations.xml file in the parent generated/webwork/ folder. Informs the user this is an old format, an instructs user to rebuild reps.
  3. Failing that, a very generic error message is given to rebuild representations.

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.

3 participants