-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
"The Rust Programming Language," Take II #19897
Conversation
f4baf41
to
1c12032
Compare
Oh, and post make-fu, I need to actually update the source text with various fixes that have landed. I'll do that right before the merge. |
(and change the links on the homepage, etc) |
|
||
In slightly more abstract terms, | ||
|
||
```{ignore,notrust} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why isn't this block marked as rust
? It is technically valid (if var
expression
, and code
are valid identifiers)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a question that's not relevant to the pull request, so let's not discuss it more here.
the answer is because i didn't do it that way ;) PR accepted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is it not part of the PR, It is code review? does this PR exist solely to be accepted without modification?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of this content is imported from the existing guides. So the text isn't what's under review here.
Please make a new issue or a PR to discuss the content.
Just double checking: this PR changes none of the actual content? (I guess we/you need to be careful to incorporate any changes that happen between now and when it finally merges.) |
Yes, the intention is that it changes none of the content. We will need to be careful. and that's what I meant with #19897 (comment) . The text here is a little bit old, but as soon as we're happy with the rest of it, I'll update it and hold off on merging PRs till this is in. |
I'm so excited about this, @steveklabnik! I think after this is merged, my |
@brson what do you think we need to do to land this? |
"src/rust-book/src/serve.rs", # imported | ||
"src/rust-book/src/subcommand.rs", # imported | ||
"src/rust-book/src/term.rs", # imported | ||
"src/rust-book/src/test.rs", # imported |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not make these exceptions and fix the licensing of the files. Besides one patch that I would claim is non-copyrightable @aturon is the only author and he won't mind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're all covered by Apache, so I guess this involves copying this at the top of each file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put this at the top of each file:
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
It is adding the MIT license as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Can we put rustbook under the directory 'src/rustbook' to match the name of the crate? |
src/rust-book/LICENSE-APACHE doesn't need to come along I think. |
@brson prefer that name too, only kept it with the dash because https://github.com/aturon/rust-book spelled it that way. |
Could "trpl" be renamed to something else with more meaningful? Maybe just |
rustdoc guide-unsafe guide-strings reference | ||
DOCS := index intro tutorial complement-bugreport \ | ||
complement-lang-faq complement-design-faq complement-project-faq \ | ||
rustdoc reference |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The DOCS variable is used both to generate these docs but also to test them. I don't see in this patch a mechanism that keeps the book tested.
I might suggest adding a variable TEST_DOCS=$DOCS $(wildcard $src/doc/trpl/*)
and using TEST_DOCS
in test.mk
to drive the doc testing (though istm that rustbook might want to learn to --test
itself someday).
This rule needs to be updated to tell the installer not to install rustbook https://github.com/rust-lang/rust/blob/master/mk/prepare.mk#L73 |
ea5d31c
to
3238e6e
Compare
This is now conceptually good to go, I think. The last issue is removing the dependency on regexes, but that's internal to the rustbook code. I'd be interested in getting feedback on the makefile stuff, and then i can squash, fix regexes, import current guides and such, and then we should be good to go |
|
||
trpl: $(RUSTBOOK) | ||
cd src/doc/trpl; $(S)/$(RUSTBOOK) build; cd ../../..; | ||
cp -r src/doc/trpl/_book doc/book |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still does not look like it will support an out-of-tree build: 'src/doc/trpl' will not contain the source for rustbook in that case. These comments are still relevant. If that is implemented then the three additions to the .gitignore file are unnecessary. Out of tree build can be tested like
mkdir build && cd build && ../configure && make docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, sorry, my instincts are still 'it doesn't matter where you build,' out of tree always feels wasteful. I guess I just haven't spent enough time building things.=
This latest revision includes a directory 'src/rustbook/target' that should not be checked in. |
@@ -311,6 +311,7 @@ tidy: | |||
| grep '^$(S)src/doc' -v \ | |||
| grep '^$(S)src/compiler-rt' -v \ | |||
| grep '^$(S)src/libbacktrace' -v \ | |||
| grep '^$(S)src/rustbook' -v \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this line should be added (we should check this directory for binaries)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I think this is still relevant)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
There appears to be an extra space in the path rustbook is trying to open "{space}tmp/trpl..." |
This is getting close to being good to go. Left to do:
Anything else? |
I've rebased this branch on the current master here: alexcrichton@6a5b558 In that commit I've also integrated tests into the default build (not via Some other agenda items I saw:
Can't wait for this to land! |
Ah yes. I'm going to eat breakfast, and then I'll tackle that. |
Okay! This should be good to go, I think. I'd imagine we'd want to sqaush some of this, yeah? |
* [Compiler Plugins](src/plugins.md) | ||
* [Conclusion](src/conclusion.md) | ||
|
||
vim src/doc/trpl/src/installing-rust.md src/doc/trpl/src/hello-world.md src/doc/trpl/src/hello-cargo.md src/doc/trpl/src/variable-bindings.md src/doc/trpl/src/if.md src/doc/trpl/src/functions.md src/doc/trpl/src/comments.md src/doc/trpl/src/compound-data-types.md src/doc/trpl/src/match.md src/doc/trpl/src/looping.md src/doc/trpl/src/strings.md src/doc/trpl/src/arrays-vectors-and-slices.md src/doc/trpl/src/standard-input.md src/doc/trpl/src/guessing-game.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
odd line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol i suck at vim
16a6ebd
to
bd5739e
Compare
This pulls all of our long-form documentation into a single document, nicknamed "the book" and formally titled "The Rust Programming Language." A few things motivated this change: * People knew of The Guide, but not the individual Guides. This merges them together, helping discoverability. * You can get all of Rust's longform documentation in one place, which is nice. * We now have rustbook in-tree, which can generate this kind of documentation. While its style is basic, the general idea is much better: a table of contents on the left-hand side. * Rather than a almost 10,000-line guide.md, there are now smaller files per section.
An updated version of rust-lang#19461 This version vendors steveklabnik/rustbook@731f7bf and builds it when building the docs. This is almost great, except my `make`-foo is poor, so I have my own personal paths in `mk/docs.mk`. How should I best get around that? /cc @brson
Merged in #20760 |
Can't wait to see this on doc.rust-lang.org, really nice work here @steveklabnik! |
😍 🎊 |
Woaaah! Congrats! |
|
||
## Advanced | ||
|
||
In a similar fashion to "Intermediate," this setion is full of individual, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be 'section'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally! Please open an issue or PR about this. Thanks :)
Here's my PR for the changes discussed in #19823. I decided to leave `_these_` types of italics the way there were because it differentiates the use of italics for emphasis from `*key term*` italics. Otherwise, bolded terms have been changed to italics, and single and double quotes have been changed appropriately, depending on their context (my judgement may not be the best, though). r? @steveklabnik (congratulations on #19897 being finalized and merged, by the way!)
An updated version of #19461
This version vendors steveklabnik/rustbook@731f7bf and builds it when building the docs. This is almost great, except my
make
-foo is poor, so I have my own personal paths inmk/docs.mk
. How should I best get around that?/cc @brson