-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Hiding parts of examples #73
Comments
I could add this but I am a little worried it might conflict with some code snippets. For example, if you want to show some python example and have line comments in it, the comments will not be shown. An easy way to solve this might be to enable this only for rust code. |
Yeah, that seems like a reasonable compromise, if this is a feature you're willing to support. |
Thought to myself: |
Oh that's interesting... |
Actually, that idea is really great. I don't have time to type it all out right now, but this would solve a big problem we have with this feature... |
Would that be the show/hide full examples problem? Or something else entirely? :) |
Yeah, the fact that people don't always see the context. It causes lots of issues in the stdlib with try!, specifically... |
Yes, I have seen the debates 😉 I will try to hack something nice together, unless someone else beats me to it. |
This should now work. For the moment only in Rust code, but this could be generalized in the future with a little work. I have also added an expand / collapse button, to show / hide the lines. I haven't done a lot of testing so there could be some rough edges. |
Rustdoc has a feature that allows you to hide parts of examples:
This will hide the closing }, but allow the example to compile. This is really useful for hiding parts of examples which confuse the point, yet allow them to still compile.
The text was updated successfully, but these errors were encountered: