Skip to content
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

Replace official "cheatsheet" with http://rustbyexample.com/ #14380

Closed
brson opened this issue May 23, 2014 · 9 comments
Closed

Replace official "cheatsheet" with http://rustbyexample.com/ #14380

brson opened this issue May 23, 2014 · 9 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@brson
Copy link
Contributor

brson commented May 23, 2014

http://rustbyexample.com/ is significantly better than our cheatsheet. Let's just endorse it by linking directly to it. That should encourage more contributions to rustbyexample to get it finished.

@brson
Copy link
Contributor Author

brson commented May 23, 2014

Hm, there are some downsides to this: we can't verify the examples are correct, and they are no longer tied to a specific version. This should probably be in the 'extern resources' section if we add it to make it clear it's not official docs.

@thehydroimpulse
Copy link
Contributor

I'm currently extending rustdoc for a refactored guide system and I'm implementing an extensible validator that rustbyexample could perhaps use rustdoc validate src/**/*.rs. However, this doesn't solve the issue of versions and being tied to the compiler's test suite.

@steveklabnik
Copy link
Member

I'm currently extending rustdoc for a refactored guide system

ooh neat. Talking about this anywhere? I'd be interested in seeing it.

@japaric
Copy link
Member

japaric commented May 23, 2014

@brson

we can't verify the examples are correct

I'm using cronie.daily + travis to check that the examples stay up to date with rust nigthly, and I receive an e-mail whenever an example breaks. (I have yet to fix the examples that got broken today because of the ~str removal).

Each example is compiled, executed and the output is updated along with the site, whenever I rebuild it. (So the site should be WYSIWYG)

and they are no longer tied to a specific version

RBE follows nigthly, rather than sticking to an snapshot version. But I don't think that's a problem, because that's what rust-lang.org recommends. After we hit 1.0, I plan to add "What's new in 1.x" sections containing examples of new features/libraries, while keeping the 1.0 content unchanged.

@thehydroimpulse

I'm currently using rustc --no-trans --test $(each *.rs) (plus some -A flags to reduce the noise) to check that the examples stay compilable. How would rustdoc validate compare to that? "validate" sounds like it would check some output remains constant, (I'm thinking of python doctests) (Note: I haven't touched rustdoc yet)

@thehydroimpulse
Copy link
Contributor

ooh neat. Talking about this anywhere? I'd be interested in seeing it.

@steveklabnik Here's the previous PR that I had opened: #14245 — that was with a Ruby static site generator. Now I have integrated some extra stuff into rustdoc to allow some more extensible docs (currated). This drops any previously required depenedencies such as Ruby and Bundler.

Somethings on the list:

  • Extensible validator
  • Layouts (Instead of hardcoding them into Rust files)
  • Frontmatter (Yaml-like metadata within markdown files to specify arbitrary settings: title, layout, categories, etc...)

This will allow a refactor on the current tutorial and guide sections allowing a much nicer experience. All the work is currently being done within my fork (I'll be squashing my commits pretty soon) and I'll be re-opening that PR once I'm done.

@japaric The validator I'm working on allows multiple different types of inputs all wrapped in the same CLI interface. For example, you could do rustdoc validate docs/**/*.md and it would extract the rust code from the markdown and test each one, outputting the results in a neat manner. It would also allow things like specifying that a specific code block should not be validated and so forth.

@huonw
Copy link
Member

huonw commented May 23, 2014

Isn't that validate command already there as --test?

@thehydroimpulse
Copy link
Contributor

@huonw It's an extension of that, yes.

@steveklabnik
Copy link
Member

We now link to Rust By Example, this should be closed.

@brson
Copy link
Contributor Author

brson commented Jun 23, 2014

We should delete the cheatsheet.

steveklabnik added a commit to steveklabnik/rust that referenced this issue Jun 23, 2014
Rust by Example is far better.

Fixes rust-lang#14380.
bors added a commit to rust-lang-ci/rust that referenced this issue Jun 5, 2023
internal: Coalesce adjacent Indels

Originally part of working on a structured snippet API (since sometimes the `$` bit of snippets would be broken off and would lead to it not being recognized), though since this is a pretty separate change, I thought it would make sense to put it into it's own PR.

The implementation is relatively straight forward and not overly optimized, though it's pretty low hanging fruit to optimize it when need be.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants