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

Import mdBook-based docs and sync #4453

Merged
merged 22 commits into from
Aug 31, 2017
Merged

Import mdBook-based docs and sync #4453

merged 22 commits into from
Aug 31, 2017

Conversation

behnam
Copy link
Contributor

@behnam behnam commented Aug 31, 2017

Since we decided to keep the mdBook-based docs in-repo, I have imported the existing converted docs from https://github.com/istankovic/cargo-book under /src/doc/book/ here, and have synced the current docs and the mdBook-based ones manually, file-by-file.

I have created a MIGRATION_MAP file, which shows the relationship between old docs and new ones. The first column is the old file, the second column is the canonical location in mdBook, and the rest of columns are globs of other files in mdBook containing content from the old file.

The first and second column of MIGRATION_MAP shall later be used to create redirect rules from doc.crates.io/ to doc.rust-lang.org/cargo/.

I will also add a README file to remind everyone to keep these files in sync during the migration.

There are also two or three small wording fixes here, which I'll note inline.

This is a retry of #4220.

First step for #4040.

@rust-highfive
Copy link

r? @matklad

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

@behnam
Copy link
Contributor Author

behnam commented Aug 31, 2017

@@ -108,7 +108,7 @@ migration.
## The `publish` field (optional)

The `publish` field can be used to prevent a package from being published to a
package repository (like *crates.io*) by mistake.
package registry (like *crates.io*) by mistake.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Small wording fix.

@@ -520,7 +519,7 @@ If your project is an executable, name the main source file `src/main.rs`. If it
is a library, name the main source file `src/lib.rs`.

Cargo will also treat any files located in `src/bin/*.rs` as executables. If your
executable consist of more than just one source file, you might also use a directory
executable consists of more than just one source file, you might also use a directory
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Small wording fix.

@@ -398,7 +404,7 @@ documentation for more details.

To test your project on Travis CI, here is a sample `.travis.yml` file:

```
```yaml
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Small styling fix.

<pre><code class="language-shell">$ cargo build
<span style="font-weight: bold"
class="s1"> Compiling</span> hello_world v0.1.0 (file:///path/to/project/hello_world)</code></pre>
```shell
Copy link
Contributor Author

@behnam behnam Aug 31, 2017

Choose a reason for hiding this comment

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

This and similar changes (replacing code block with triple-backticks) are to be able to keep the content in sync. We are loosing some styling in the shell snippets, but it's fine, since we will loos them eventually anyway.

@behnam
Copy link
Contributor Author

behnam commented Aug 31, 2017

I should mention that, I have checked all pairs of files manually (using vim -d) and sync'ed them.

@alexcrichton
Copy link
Member

Awesome thanks so much for this!

So in terms of deployment, are you thinking it looks like:

  1. Land this PR, it won't change doc.crates.io
  2. Update rust-lang/rust to produce documentation for doc.rust-lang.org/cargo
  3. Add a redirect from doc.crates.io to doc.rust-lang.org
  4. Update this repository to stop updating doc.crates.io

or maybe something different?

@steveklabnik
Copy link
Member

@alexcrichton regarding deployment, @carols10cents actually wanted one more step. It should look like this:

  • Land this PR, it won't change doc.crates.io
  • Point doc.rust-lang.org/cargo -> doc.crates.io
  • Update rust-lang/rust to produce documentation for doc.rust-lang.org/cargo
  • Add a redirect from doc.crates.io to doc.rust-lang.org
  • Update this repository to stop updating doc.crates.io

The reason is, that way we can print the URL "doc.rust-lang.org/cargo" in the book, and even if this process isn't quite done yet, it will be live.

@carols10cents
Copy link
Member

Point doc.rust-lang.org/cargo -> doc.crates.io

@steveklabnik I did that part already, and it made it into beta; https://doc.rust-lang.org/beta/cargo redirects to doc.crates.io.

@steveklabnik
Copy link
Member

Oh! Then nevermind 👍

@behnam
Copy link
Contributor Author

behnam commented Aug 31, 2017

Yes, @alexcrichton. Basically what you said. I just want to groom the mdBook docs a bit more before linking from rust repo. I kept those non-sync changes for a different PR.

Here's my list:

  1. Land this PR, it won't change doc.crates.io
  2. Update mdBook to add a landing/cover page, and some text to getting-started page.
  3. Update rust-lang/rust to produce documentation for doc.rust-lang.org/cargo (will get mdBook to nightly)
  4. Add a redirect from doc.crates.io to doc.rust-lang.org and delete the old files. (This shall wait until mdBook makes it to stable doc.rust-lang.org.)

@alexcrichton
Copy link
Member

That all sounds great to me!

One last thing before merging, do you think we should go ahead an integrate CI? It'd be nice to have a builder that does the mdbook build to ensure that doesn't regress. Also, maybe temporarily we could publish the book under doc.crates.io/new and just not link to it anywhere? (just for us to poke around in)

@behnam
Copy link
Contributor Author

behnam commented Aug 31, 2017

By the way, I've put up a preview of the latest version (including this PR and the future grooming PR) here: http://code.behnam.es/rust-cargo/src/doc/book/book/

@behnam
Copy link
Contributor Author

behnam commented Aug 31, 2017

One last thing before merging, do you think we should go ahead an integrate CI? It'd be nice to have a builder that does the mdbook build to ensure that doesn't regress. Also, maybe temporarily we could publish the book under doc.crates.io/new and just not link to it anywhere? (just for us to poke around in)

Yeah, makes sense. But let's do so in a separate PR, as this one is already big and these steps may take a bit longer, while I have some work on top of this PR already.

Also, doc.crates.io/new or doc.crates.io/book?

@alexcrichton
Copy link
Member

@bors: r+

Ok then, let's land this.

I'm fine with either /new or /book

@bors
Copy link
Contributor

bors commented Aug 31, 2017

📌 Commit bd5ecd4 has been approved by alexcrichton

@istankovic
Copy link

@behnam Thanks so much for taking the time to do this!

@bors
Copy link
Contributor

bors commented Aug 31, 2017

⌛ Testing commit bd5ecd4 with merge 97452de...

bors added a commit that referenced this pull request Aug 31, 2017
Import mdBook-based docs and sync

Since we decided to keep the mdBook-based docs in-repo, I have imported the existing converted docs from <https://github.com/istankovic/cargo-book> under `/src/doc/book/` here, and have synced the current docs and the mdBook-based ones manually, file-by-file.

I have created a `MIGRATION_MAP` file, which shows the relationship between old docs and new ones. The first column is the old file, the second column is the canonical location in mdBook, and the rest of columns are globs of other files in mdBook containing content from the old file.

The first and second column of `MIGRATION_MAP` shall later be used to create redirect rules from `doc.crates.io/` to `doc.rust-lang.org/cargo/`.

I will also add a README file to remind everyone to keep these files in sync during the migration.

There are also two or three small wording fixes here, which I'll note inline.

This is a retry of <#4220>.

First step for <#4040>.
@bors
Copy link
Contributor

bors commented Aug 31, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 97452de to master...

@bors bors merged commit bd5ecd4 into rust-lang:master Aug 31, 2017
@behnam behnam deleted the book branch August 31, 2017 21:58
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.
@ehuss ehuss added this to the 1.22.0 milestone Feb 6, 2022
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.

9 participants