Opened 7 months ago
Last modified 7 weeks ago
#35380 new Cleanup/optimization
Have the images for tutorial and admin docs programatically generated.
Reported by: | Sarah Boyce | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Simon Willison | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
Noticed in the process of reviewing this PR that there was an image in the documentation that required an update.
I think most of the images are "slightly" out of date due to in part to the accessibility push which has done some CSS contrast updates.
We already have the ability to generate screenshots during our Selenium tests, so it might be a nice idea to have our documentation screenshots generated in a similar way.
All the screenshots in the docs would need generation upon the trigger of a command (i.e. manually via a Makefile or similar).
Change History (16)
comment:1 by , 7 months ago
Component: | Uncategorized → Documentation |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 7 months ago
(despite already having the screenshot generation by code)
Unless I am missing something, these screenshots are not generated automatically and in order to update the image, I had to:
- look at the image (and the docs around it) and figure out what I would need to do to recreate this image
- make a project using steps documented here
- do steps to recreate the image - code/migrate/shell etc
- take a screenshot
I'm not sure if that answers the question. There are other approached to make this easier like having a project already setup with test data with some instructions.
asking for a PR that touches the admin to re-generate these screenshots
I think we can ask that people do this. I would expect we update the contributor docs with how to update the images whether that's a script or a project they can use or something something.
If we would automatically generate these images, when/where would this regeneration go? As part of a release when building and checking release notes? As part of the same PR that changes something in the admin? As a follow up PR?
Ideally part of the same PR that change something in the admin but we should also check it as part of a release when building and checking release notes 👍
comment:3 by , 7 months ago
Thank you Sarah, I agree with your rationale! we could perhaps consider a custom Sphinx extension to build the images if certain conditions are met?
comment:4 by , 7 months ago
I think it would be enough to double check if the the screenshots need updating once for each major release (probably at alpha stage). Certainly if there are obvious UI changes that affect the screenshots they could be updated as part of each change, but I wouldn't require it for each CSS tweak. It's unlikely beginners are going to be using the development version of Django for the tutorial anyway. I don't think this problem merits spending a lot of time on building automation. Outdated screenshots hasn't been a big issue over the years.
comment:5 by , 6 months ago
Has patch: | set |
---|---|
Patch needs improvement: | set |
Setting has_patch to start the conversation on the topic, but the PR definitely needs improvement.
comment:10 by , 5 months ago
Description: | modified (diff) |
---|---|
Summary: | Have the images from docs/ref/contrib/admin/_images/ automatically generated. → Have the images for tutorial and admin docs programatically generated. |
comment:11 by , 5 months ago
Description: | modified (diff) |
---|
comment:16 by , 7 weeks ago
Cc: | added |
---|
After DjangoCon US 2024
, Simon shared a PoC to automatically take screenshots of admin pages for a Django project: https://github.com/simonw/django-screenshots/
We should evaluate the project to automatically generate screenshots for the Django docs, though it would add a gew new dependencies (playwright
and shot-scraper
after a quick inspection).
Accepting because I agree that outdated images in docs are confusing. I have some questions though:
Do you think that the effort to put the machinery in place (despite already having the screenshot generation by code) is worth the effort vs asking for a PR that touches the admin to re-generate these screenshots? (I'm honestly not sure!)
If we would automatically generate these images, when/where would this regeneration go? As part of a release when building and checking release notes? As part of the same PR that changes something in the admin? As a follow up PR?