| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Sorry, something went wrong.
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead. |
Sorry, something went wrong.
|
Thanks for this, but what process have you used? I've been thinking about replacing (or perhaps augmenting) this PNG file with something that's more easily modifiable, such as an SVG. |
Sorry, something went wrong.
|
I edited it in GIMP. Not the most convenient workflow, indeed. If you prefer, I could look into recreating the flowchart as SVG in Inkscape or Dia. It won't look exactly the same, of course, but I'm sure I can get it reasonably close. |
Sorry, something went wrong.
That would be great. I think it needs to be a bit "nicer", style-wise, than the current iteration, which looks pretty old-fashioned and out of step with the overall documentation that surrounds it. If you think that's too much work, I'll understand! |
Sorry, something went wrong.
I'm not much of a graphic designer, so I can't really execute on this without further guidance. Do you have an example of an image in the style you would like? For now, I have replaced the PNG with an SVG in the same style. I'll experiment a bit with font size and background to make sure it's readable. |
Sorry, something went wrong.
|
I'm working on embedding the SVG in the page HTML properly, so that the font is the same as the surrounding page text. |
Sorry, something went wrong.
|
Quick work, it's coming along nicely. Things that occurred to me:
|
Sorry, something went wrong.
How about "lastResort handler"? My thinking is that for someone unfamiliar with the logging module, it is immediately obvious that "lastResort" is the name of an actual Python object, and a quick ctrl+f on the same page will bring the user to an explanation of what it is. Whereas "handler of last resort" is less obvious what it is, at least to me. |
Sorry, something went wrong.
|
One problem: The sphinx :class: invert-in-dark-mode command does not work with raw html. I've added a bit of CSS to the SVG which makes it aware of the browser's dark mode setting, but I haven't been able to figure out a way to make it respond to the theme selector drop down. I.e. if someone with their browser set to dark mode selects light mode from the theme selector, the diagram will look bad. Same for light mode browser + dark mode theme selector. An alternative is to load the SVG with .. image:: instead of .. raw:: html, but then the text in the diagram won't be copyable or accessible to screen readers. |
Sorry, something went wrong.
Maybe leave that for a later refinement? Accessibility is probably more important than a light/dark mismatch. To react to the theme selector would probably need a bit of javaScript. |
Sorry, something went wrong.
|
Then I think this is ready. |
Sorry, something went wrong.
|
Thank you very much for this! |
Sorry, something went wrong.
…handler. (pythonGH-121036) (cherry picked from commit 237baf4) Co-authored-by: Alexander Bessman <bessman@users.noreply.github.com>
…handler. (pythonGH-121036) (cherry picked from commit 237baf4) Co-authored-by: Alexander Bessman <bessman@users.noreply.github.com>
|
GH-121105 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
|
GH-121106 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
|
@bessman I made some changes to the SVG to tweak elements positions and styles. I want to export the changed version to PNG, but the PNG I export from Inkscape has a transparent background. What tool did you end up using to create the SVG and PNG (including precise versions, and on which OS)? I modified the SVG by hand as I couldn't find a suitable tool that would make minimal changes to the SVG you created. |
Sorry, something went wrong.
|
There's still a pending issue of syncing with the theme selector, but I think that will require changes in the pydoc theme to e.g. add a class to the body element indicating the mode in use. |
Sorry, something went wrong.
I made it in Dia (v0.97+git from Ubuntu 20.04). Perhaps the .dia file should also be added to the repo? To create the PNG, I used Dia's export feature. However, after some experimentation I've found a way to do the conversion with imagemagick (6.9.10-23 Q16 x86_64 20190101) which achieves better compression: convert logging_flow.svg -background none -define png:compression-filter=1 -define png:compression-level=9 -define png:compression-strategy=0 logging_flow.png |
Sorry, something went wrong.
|
Thanks for the info.
I've not used Dia, is the .dia file text? We don't generally add non-standard formats to the repo. If Dia can import SVG, I suppose we might not need it? BTW I think I've now addressed the theme selector issue in #121254. Feel free to try it out. It's merged in the main branch, but not yet backported to 3.12/3.13. |
Sorry, something went wrong.
It's gzip'd XML. |
Sorry, something went wrong.
|
Sadly, I've noticed that following my changes (mostly to remove inline styles from the elements in favour of CSS), Dia won't import the SVG correctly any more. See this screenshot: |
Sorry, something went wrong.
|
Well, in case it's helpful, here is the .dia file: logging_flow.xml.gz I had to change the suffix to .xml.gz for github to accept it. |
Sorry, something went wrong.
|
Thanks very much. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
📚 Documentation preview 📚: https://cpython-previews--121036.org.readthedocs.build/