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

Docs refresh #2688

Merged
merged 34 commits into from
May 18, 2016
Merged

Docs refresh #2688

merged 34 commits into from
May 18, 2016

Conversation

carols10cents
Copy link
Member

@carols10cents carols10cents commented May 13, 2016

Hi! Sooooo I've been thinking about the cargo docs lately and today I decided to try some of the things I've been thinking about.

There are some smaller changes in here, typos and clarifications and stuff, that I'm totally willing to break out into a separate PR(s) if yinz want.

My goals for the larger changes were:

  • Make one obvious place to go for info on every which way to specify a dependency. I've found myself clicking around the different doc pages a lot to find the semver syntax, the different keys that can go with a git location, the path override syntax, etc. So I made one top-level "Specifying Dependencies" page and moved relevant info from the guide, the manifest page, and the crates.io page.
  • Make The Guide a bit more focused. There were a few topics in there that didn't really fit in the story arc of trying to get someone up and running with cargo-- it veered off into some more advanced topics that I've moved to places I think they fit better.
  • Make the crates.io page only about publishing, not using and publishing. The info about adding dependencies got folded into either the guide or the new specifying dependencies page, so this should close Merge "how to use crates.io" into the Guide #1035.

I'm also thinking about having someone new to rust/cargo try following the guide, but wanted to get a first pass from experienced people :)

Steve and commas, sittin in a tree!

Fixes rust-lang/crates.io#334.
I only see `Fresh` if I use `cargo run -v`, but this example uses `cargo
run`. Someone following along might not see either of these if they just
built in the previous step, though, so clarify that you'll only see that
if you have made changes.
This doesn't feel like it fits very well at this point, since our
example program doesn't take args and beginners to cargo probably don't
have a reason to want to pass flags on to rustc at this point. Also it
doesn't even say rustc, just "which flags go where"... where would they
go?!?!
Copypasta, or forgotten name change
I'm guessing the path dependency section got added in between. Also
linked to the Travis CI rust docs and removed the hyphen since Travis CI
seems to spell it without.
Connects to rust-lang#1035. Using crates from crates.io is a
common thing that many people will want to know how to do right away and
deserves to be part of the main guide.
I think information about specifying dependencies deserves to have its
own page since this info is commonly needed and there are a LOT of
different ways to specify dependencies.

Previously this information was spread across multiple pages, now
there's one place to go if you're looking for any of these ways, rather
than checking the multiple pages this info was spread across before.
Try to make this flow a bit more and have sections based on what
situation you might find yourself in.
@rust-highfive
Copy link

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@steveklabnik
Copy link
Member

❤️ 😍

let’s publish it! Publishing a crate is when a specific version is uploaded to
crates.io.
Once you've got a library that you'd like to share with the world, it's time to
publish it on [crates.io][crates-io]! Publishing a crate is when a specific
Copy link
Member

Choose a reason for hiding this comment

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

you don't need to repeat the link text if you're using the same text,

[crates.io]

by itself will work just as well

Copy link
Member

Choose a reason for hiding this comment

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

you don't need to repeat the link text if you're using the same text,

It's different text, no?

Copy link
Member

Choose a reason for hiding this comment

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

Nevermind, you addressed it below.

Copy link
Member

Choose a reason for hiding this comment

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

I actually didn't notice the difference this time, but did below.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh cool! I didn't know you could do this :)

@steveklabnik
Copy link
Member

Awesome! Thanks so much for this. I like the high-level ideas, and I left a bunch of nits.

Since they're official rust crates.
@carols10cents
Copy link
Member Author

Thank you so much for the comments @steveklabnik!!!! I think I've addressed them all :) <3 <3 <3

<span style="font-weight: bold"
class="s1"> Running</span> `target/debug/hello_world`
Hello, world!</code></pre>

To pass some arguments to your program, use `cargo run first_arg second_arg`.
If flags are being passed, use a “--” separator to tell Cargo which flags go where, like `cargo run -- --foo -b bar`.
Copy link
Member

Choose a reason for hiding this comment

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

Is this bit of information present elsewhere? It's removed here and never added...

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I'm not really sure where would be a good place to move it though, any ideas? It does appear in the help for cargo run:

All of the trailing arguments are passed to the binary to run. If you're passing
arguments to both Cargo and the binary, the ones after `--` go to the binary,
the ones before go to Cargo.

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps it can be moved to the example with the regex crate? Hardcoded 2014-01-01 looks a bit old school, instead the date can be read from the command line.

On the other hand, I am not sure that this is that valuable info...

@carols10cents
Copy link
Member Author

Ok, I think feedback is dying down-- I think this is ready to go in if yinz do :) <3

@steveklabnik
Copy link
Member

👍

native = { path = "native/i686" }

[target.'cfg(target_pointer_width = "64")'.dependencies]
native = { path = "native/i686" }
Copy link
Member

Choose a reason for hiding this comment

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

This may have actually been a typo in the first version, but the "i686" here is intended to be "x86_64"

Copy link
Member Author

@carols10cents carols10cents May 17, 2016

Choose a reason for hiding this comment

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

Yup, I moved it from here, I'm happy to fix it though!

@alexcrichton
Copy link
Member

Awesome, thanks so much @carols10cents! Some extra thoughts:

  • Perhaps we could show a TOML example of a [dev-dependencies] section in standalone form? Just to make something easily copy/pastable.
  • Do you think [build-dependencies] should be mentioned on the specifying-dependencies page as well? They're explained on the build-script page, but could perhaps stand to be mentioned twice.

@carols10cents
Copy link
Member Author

Thanks @alexcrichton!!

Perhaps we could show a TOML example of a [dev-dependencies] section in standalone form? Just to make something easily copy/pastable.

That sounds good!

Do you think [build-dependencies] should be mentioned on the specifying-dependencies page as well? They're explained on the build-script page, but could perhaps stand to be mentioned twice.

TIL that build-dependencies are a thing!! I definitely think they should be mentioned on the specifying-dependencies page; I'll have that done in a minute :)

I'm also going to sneak in two commits with small changes to the guide based on feedback from a new rust developer :)

@alexcrichton
Copy link
Member

@bors: r+ 58a1804

Thanks @carols10cents!

bors added a commit that referenced this pull request May 18, 2016
Docs refresh

Hi! Sooooo I've been thinking about the cargo docs lately and today I decided to try some of the things I've been thinking about.

There are some smaller changes in here, typos and clarifications and stuff, that I'm totally willing to break out into a separate PR(s) if yinz want.

My goals for the larger changes were:

- **Make one obvious place to go for info on every which way to specify a dependency.** I've found myself clicking around the different doc pages a lot to find the semver syntax, the different keys that can go with a git location, the `path` override syntax, etc. So I made one top-level "Specifying Dependencies" page and moved relevant info from the guide, the manifest page, and the crates.io page.
- **Make The Guide a bit more focused.** There were a few topics in there that didn't really fit in the story arc of trying to get someone up and running with cargo-- it veered off into some more advanced topics that I've moved to places I think they fit better.
- **Make the crates.io page only about publishing, not using and publishing.** The info about adding dependencies got folded into either the guide or the new specifying dependencies page, so this should close #1035.

I'm also thinking about having someone new to rust/cargo try following the guide, but wanted to get a first pass from experienced people :)
@bors
Copy link
Contributor

bors commented May 18, 2016

⌛ Testing commit 58a1804 with merge 33e1797...

@bors
Copy link
Contributor

bors commented May 18, 2016

@bors bors merged commit 58a1804 into rust-lang:master May 18, 2016
@carols10cents carols10cents deleted the docs-refresh branch May 18, 2016 14:59
wking added a commit to wking/cargo that referenced this pull request Jan 8, 2018
This wording was originally from 58a1804 (At the end, point to docs
that might be interesting next, 2016-05-17, rust-lang#2688), which added it to
the end of the guide (where telling readers what they know makes some
sense).  It was moved to a "Cargo in Depth" section with 01aa9e3
([src/doc/book] Move a paragraph to cargo-in-depth.md, 2017-08-31,
rust-lang#4453), where it makes a bit less sense.  When that section became the
reference index in 3f2d93e ([doc/book] Create dir for book sections,
2017-08-31, rust-lang#4455) the context assumed by the paragraph was completely
missing.

This commit removes the paragraph, which doesn't reduce the usefulness
of the reference index.  And the removal avoids confusing readers who
start with the reference docs and may now have the assumed overview.
bors added a commit that referenced this pull request Jan 8, 2018
…lexcrichton

doc/reference/index: Remove "Now that you have an overview" paragraph

This wording was originally from 58a1804 (#2688), which added it to the end of the guide (where telling readers what they know makes some sense).  It was moved to a "Cargo in Depth" section with 01aa9e3 (#4453), where it makes a bit less sense.  When that section became the reference index in 3f2d93e (#4455) the context assumed by the paragraph was completely missing.

This commit removes the paragraph, which doesn't reduce the usefulness of the reference index.  And the removal avoids confusing readers who start with the reference docs and may now have the assumed overview.
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.

Merge "how to use crates.io" into the Guide
7 participants