-
Notifications
You must be signed in to change notification settings - Fork 53
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
Regenerate images in documentation #179
Comments
Would it be possible to have the images be generated from the docs? as you can have hidden code at the end of each example to save it to a I would happy to help with original task and to help work on a more automated version (although I know that is a little over the top for the orignal issue). |
This is a very interesting idea! I would have to see the results before committing to having it in the crate, but I really like the idea of this being automated. One of the tricky things about this would be that some of the examples do need the titlebar included in the screenshot. I suppose for now we could simply leave those examples to be manually updated and automate the rest. Would you be willing to do some exploratory work on this? It's possible that we might not end up merging it if the solution is too difficult to maintain, but I would be interested in trying it out to see what happens. Mentoring Instructions
Let me know if you have any questions about any of this! This is just off the top of my head, so I may have missed some things or made some mistakes. These instructions should get you most of the way there. 😄 Sounds like a fun thing to work on! 🎉 |
This crate has changed a lot in the last 3 years. The images in the documentation probably aren't super accurate anymore. If you haven't seen the documentation yet, it contains images to help people understand what the example code produces. Take the
set_pen_color
method for example:After the changes in #173, this image now looks like the following:
It's a subtle change, but you can see that the pen thickness is about half of what it used to be, and the lines now have circular ends instead of rectangular ends. (The thickness change is actually because the
set_pen_size
calls in the documentation examples weren't updated after #173...oops! Feel free to double the pen thickness as part of your changes. The images probably look better that way!)If any of the images are significantly different or have changed in undesirable ways, we should probably fix the example instead of just updating the image. Feel free to leave a comment and we can discuss what to do.
Mentoring Instructions
The image for the documentation shown above is in
docs/assets/images/docs/colored_circle.png
.The image URL is hard-coded to a permanent link in the documentation comment:
turtle/src/turtle.rs
Line 732 in bf64b83
(Notice that the path I just told you is in this code.)
You won't be able to update that link until after the PR is merged, but I would still really appreciate some help updating the images.
Here's what you need to do to help:
examples/circle.rs
in your editorexamples/circle.rs
set_pen_color
method shown above, you would start by opening your local copy of theturtle.rs
fileturtle.rs
open, find theset_pen_color
method and copy and paste the lines of example code in the comment above the method///
and you should get some valid Rust codecargo run --features unstable --example circle
set_title
would need to include the titlebar)As I mentioned, you won't be able to update the URLs to their permanent links until after the PR to update the images has been merged. Please feel free to come back and help out with that in a follow-up PR! Instructions for doing this can be found in the issue where we originally made all the links into permanent links.
Checklist
docs/assets/images/docs/changed_title.png
docs/assets/images/docs/orange_background.png
docs/assets/images/docs/circle.png
docs/assets/images/docs/circle_offset_center.png
docs/assets/images/docs/circle.png
docs/assets/images/docs/small_drawing.png
docs/assets/images/docs/squares.svg
?sanitize=true
at the enddocs/assets/images/docs/color_mixing.png
docs/assets/images/docs/pen_thickness.png
docs/assets/images/docs/colored_circle.png
docs/assets/images/docs/red_circle.png
docs/assets/images/docs/clear_before_click.png
docs/assets/images/docs/clear_after_click.png
The text was updated successfully, but these errors were encountered: