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

"The Rust Programming Language," Take II #19897

Closed
wants to merge 1 commit into from

Conversation

steveklabnik
Copy link
Member

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 in mk/docs.mk. How should I best get around that?

/cc @brson

@steveklabnik steveklabnik force-pushed the trpl branch 2 times, most recently from f4baf41 to 1c12032 Compare December 16, 2014 00:28
@steveklabnik
Copy link
Member Author

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.

@steveklabnik
Copy link
Member Author

(and change the links on the homepage, etc)


In slightly more abstract terms,

```{ignore,notrust}
Copy link
Contributor

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)

Copy link
Member Author

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.

Copy link
Contributor

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?

Copy link
Member Author

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.

@huonw
Copy link
Member

huonw commented Dec 16, 2014

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.)

@steveklabnik
Copy link
Member Author

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.

@aturon
Copy link
Member

aturon commented Dec 17, 2014

I'm so excited about this, @steveklabnik!

I think after this is merged, my rust-book repo should go into hibernation -- this should be the place to develop on rust-book.

@steveklabnik
Copy link
Member Author

@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
Copy link
Contributor

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.

Copy link
Member Author

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?

Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@brson
Copy link
Contributor

brson commented Dec 17, 2014

Can we put rustbook under the directory 'src/rustbook' to match the name of the crate?

@brson
Copy link
Contributor

brson commented Dec 17, 2014

src/rust-book/LICENSE-APACHE doesn't need to come along I think.

@steveklabnik
Copy link
Member Author

@brson prefer that name too, only kept it with the dash because https://github.com/aturon/rust-book spelled it that way.

@liigo
Copy link
Contributor

liigo commented Dec 17, 2014

Could "trpl" be renamed to something else with more meaningful? Maybe just
"book"?

rustdoc guide-unsafe guide-strings reference
DOCS := index intro tutorial complement-bugreport \
complement-lang-faq complement-design-faq complement-project-faq \
rustdoc reference
Copy link
Contributor

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).

@brson
Copy link
Contributor

brson commented Dec 18, 2014

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

@steveklabnik
Copy link
Member Author

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

/cc @aturon @alexcrichton @brson


trpl: $(RUSTBOOK)
cd src/doc/trpl; $(S)/$(RUSTBOOK) build; cd ../../..;
cp -r src/doc/trpl/_book doc/book
Copy link
Contributor

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

Copy link
Member Author

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.=

@brson
Copy link
Contributor

brson commented Dec 19, 2014

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 \
Copy link
Member

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)

Copy link
Member

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)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@brson
Copy link
Contributor

brson commented Jan 8, 2015

There appears to be an extra space in the path rustbook is trying to open "{space}tmp/trpl..."

@steveklabnik
Copy link
Member Author

This is getting close to being good to go. Left to do:

  1. write the makefile rule that calls rustbook test
  2. integrate make trpl and make trpl-test into make docs.

Anything else?

@alexcrichton
Copy link
Member

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 rustbook test though), and I've also integrated the docs into the regular build.

Some other agenda items I saw:

  • The main landing page needs to have many links updated
  • The guides need to be all brought back up to date as a bunch of changes have happened since they were moved.
  • A quick pass to make sure everything looks as expected.

Can't wait for this to land!

@steveklabnik
Copy link
Member Author

Ah yes. I'm going to eat breakfast, and then I'll tackle that.

@steveklabnik
Copy link
Member Author

Okay! This should be good to go, I think. I'd imagine we'd want to sqaush some of this, yeah?

@steveklabnik
Copy link
Member Author

2015-01-08-112123_1022x59_scrot

😢 it is done

* [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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

odd line?

Copy link
Member Author

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

@steveklabnik steveklabnik force-pushed the trpl branch 2 times, most recently from 16a6ebd to bd5739e Compare January 8, 2015 17:49
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.
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Jan 8, 2015
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
@alexcrichton
Copy link
Member

Merged in #20760

@alexcrichton
Copy link
Member

Can't wait to see this on doc.rust-lang.org, really nice work here @steveklabnik!

@steveklabnik
Copy link
Member Author

😍 🎊

@Gankra
Copy link
Contributor

Gankra commented Jan 8, 2015

Woaaah! Congrats!


## Advanced

In a similar fashion to "Intermediate," this setion is full of individual,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be 'section'

Copy link
Member Author

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 :)

bors added a commit that referenced this pull request Jan 10, 2015
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!)
@steveklabnik steveklabnik deleted the trpl branch October 25, 2017 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants