-
-
Notifications
You must be signed in to change notification settings - Fork 781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redraw and cleanup python function layout figure #573
Conversation
The previous version contained some png embeds. I made the figure using pure SVG and added an indicator for the function body. Used generic fonts: "monospace" for code and "sans-serif" for the text. Colors match the ones used for the code on the page.
Removed some of the Inkscape junk from the SVG and removed the comment about generating the figure automatically.
Fantastic work, @leouieda! I cleaned up your SVG figure even further (from 9K to 1K) and pushed it to your branch. For your reference, here is the command that I used to get a cleaner version:
then I did some manual cleanup (removed duplicate markers, unnecessary tspans, empty <text> block, wrong css (font-size 16) ... a few other things) and then repeated the cleaning procedure (just in case):
|
@maxim-belkin thanks for sharing the cleaning commands! I'll keep those in my toolbox for next time. The changes to |
OK, agreed! BTW, most of the time I also type |
Thanks again, @leouieda! |
Thanks @maxim-belkin, glad to help! Yeah, svn is still muscle memory after all these years. |
Pull Request: #573 * Redraw python-function.svg in Inkscape * Add an indicator for the function body * Use generic fonts: "monospace" for code and "sans-serif" for text * Use colors that match the ones used for the code on the page. * 06-func.md: Remove a comment about the procedure to generate the figure automatically. * clean up (and slim down) produced SVG even further with ``` svgcleaner --indent 2 --ungroup-defs no --coordinates-precision 1 --properties-precision 1 --paths-coordinates-precision 1 <input.svg> <output.svg> ``` and ``` svgcleaner --indent 2 --ungroup-defs no --multipass --coordinates-precision 1 --properties-precision 1 --paths-coordinates-precision 1 <input.svg> <output.svg> ```
Doing some work on #494
Redrew the
python-function.svg
in Inkscape to replace the automatically generated one. Seemed like overkill to me and used png embeds and SVG that wouldn't render in Inkscape. I added a marker for the function body which is mentioned in the text but isn't shown in the figure. I also matched the colors used on the website.This is what the new figure looks like:
Compared to what the original looked like on my machine:
I did my best to clean up the SVG a bit but I'm not entirely sure what I can delete and messing with the indentation was messing up the figure so I gave up.