-
Notifications
You must be signed in to change notification settings - Fork 383
Fixing code examples, statement about working tests on code examples #51
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
Conversation
Hmm, I wonder how worthwhile this is - it found one bug (which is nice), but I feel like every example which gets changed has got more cluttered and less easily understandable and that doesn't feel like a great trade-off to me. |
Rustdoc lets you hide setup code by prefixing it with |
I see two ways going forward:
Perhaps we can even do both and have the script build the |
See also #6 and #44. It would be nice to publish this to a standalone website one day. Having a separate Also, since rustbook is built on top of rustdoc, I think it'll strip |
The idea is to have playground links. I'm not sure if this requires a canonical location per example or if the code gets embedded as link data. |
Okay, I see what you're aiming for with the playground. As prior art, the official Rust book has playground links -- e.g. see the section on lifetimes. It looks like they use the Unless there are further issues with their approach, I'm keen to just copy what they do. |
Agreed. I'll look into that. Perhaps I should pare down this PR to the one fix I found then. |
Ping |
See next comment. |
mdbook has a built-in doctest feature as well, which would make this PR redundant. |
Thanks for the heads-up, indeed, that looks like it would make it redundant when we convert this into a ref.: #6 |
Seems good to me, @marcoieni any additions? |
Hey @llogiq is there any reason you're closing this? There are still changes to be merged from your PR that are not the concerning the doctests or Travis, I already edited your branch to remove the parts and changed the title. |
This doctests all code examples. There is some fallout to either ignore examples (if I deemed them too far from runnable) or change them to work, or at least compile.
I also added a.travis.yml
so we can use CI to check PRs.fixes #49