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

Unstable book is a serious contribution speed bump #42454

Closed
nagisa opened this issue Jun 5, 2017 · 8 comments
Closed

Unstable book is a serious contribution speed bump #42454

nagisa opened this issue Jun 5, 2017 · 8 comments
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@nagisa
Copy link
Member

nagisa commented Jun 5, 2017

Every time I make a PR, I always get hit by the unstable book tidy check. It always takes me at least 3 roundtrips until I get it right. I hate it (the book) very much at this point.

IMO the process is unnecessarily complicated. Especially so, given that the fix usually ends up being just a link to the tracking issue – information already available to the compiler in the attribute.

I propose that the book would not require adding a link like that for every single feature and instead the pages with links to a tracking issue were generated automatically, during the generation of the book.

I do not the benefits provided by the book warrant making the contribution process so much more complicated.

@Mark-Simulacrum
Copy link
Member

I actually think the underlying problem here is different: there is little to no point in having an unstable book if we don't utilize it to document these features. While these features are somewhat in flux due to their nature of instability, we should still document them. As such, I don't think we should auto-generate the book, though we should consider making it easier to get the initial template up for the PR author to add to as they're implementing the feature. I worry that if we auto-generate book pages then we'll end up always doing that, making the book almost useless -- something that I at least want to avoid. I've already expected to find documentation in the unstable book and been foiled more than once when trying to use an unstable feature.

cc @chriskrycho @rust-lang/docs

@Mark-Simulacrum Mark-Simulacrum added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools labels Jun 5, 2017
@nagisa
Copy link
Member Author

nagisa commented Jun 5, 2017

@Mark-Simulacrum does it matter that much for library features though? Library functions already get their documentation in the… documentation. There’s no benefit whatsoever in copying the library documentation into a book of some sort.

@Mark-Simulacrum
Copy link
Member

I'm not sure if we need unstable book documentation for library features, in fact I think we don't want that. I was more thinking of language features; if we currently require unstable book documentation for library features then I think we shouldn't do that (there's no point, as you've said) but should for language features. Things like catch expressions are (to my knowledge) documented effectively nowhere (except maybe in an RFC, where users don't have easy access); while I agree that the first place people land for library features is in the documentation for the standard library.

@frewsxcv
Copy link
Member

frewsxcv commented Jun 5, 2017

There’s no benefit whatsoever in copying the library documentation into a book of some sort.

In my opinion, ideally, it'd be cool if each of the library features mentioned in the unstable book had links to all of the unstable APIs in the std docs since for one feature, there could be many unstable APIs.

@est31
Copy link
Member

est31 commented Jun 5, 2017

Re library features, I whole heartedly agree that their addition to the unstable should be automated during build time. See #41288

As for the lang features that only have stubs, we can simply autogenerate the stub, also at build time. Then no actual change of the unstable book is required.

@steveklabnik
Copy link
Member

It always takes me at least 3 roundtrips until I get it right.

Which parts do you struggle with? From my perspective, it should be "copy over an existing one and change some numbers", so knowing what the actual trouble is here should be useful.

There’s no benefit whatsoever in copying the library documentation into a book of some sort.

One of the purposes of the Unstable Book is to show an overview of everything that exists and is unstable, so having something there is important, but I agree that duplicating it isn't particularly worthwhile. I mean, it'd be okay for browsing, but isn't a big deal, IMO.

In my opinion, ideally, it'd be cool if each of the library features mentioned in the unstable book had links to all of the unstable APIs in the std docs since for one feature, there could be many unstable APIs.

Yes, this is more useful.

@nagisa
Copy link
Member Author

nagisa commented Jun 6, 2017

Which parts do you struggle with? From my perspective, it should be "copy over an existing one and change some numbers", so knowing what the actual trouble is here should be useful.

For me it usually goes like this:

  • Forget it exists altogether (who bothers running the full test suite (including tidy) anyway? For tiny additions?);
  • Be “smart” and do something that’s not necessarily copy-paste;
  • Do the copy-paste.

@est31
Copy link
Member

est31 commented Jun 12, 2017

I've opened #42612 to autogenerate stubs for unstable features.

bors added a commit that referenced this issue Jun 14, 2017
Autogenerate stubs and SUMMARY.md in the unstable book

Removes a speed bump in compiler development by autogenerating stubs for features in the unstable book. See #42454 for discussion.

The PR contains three commits, separated in order to make review easy:

* The first commit converts the tidy tool from a binary crate to a crate that contains both a library and a binary. In the second commit, we'll use the tidy library
* The second and main commit introduces autogeneration of SUMMARY.md and feature stub files
* The third commit turns off the tidy lint that checks for features without a stub, and removes the stub files. A separate commit due to the large number of files touched

Members of the doc team who wish to document some features can either do this (where `$rustsrc` is the root of the rust repo git checkout):

1. cd to `$rustsrc/src/tools/unstable-book-gen` and then do `cargo run $rustsrc/src $rustsrc/src/doc/unstable-book` to put the stubs into the unstable book
2. cd to `$rustsrc` and run `git ls-files --others --exclude-standard` to list the newly added stubs
3. choose a file to edit, then `git add` it and `git commit`
4. afterwards, remove all changes by the tool by doing `git --reset hard` and `git clean -f`

Or they can do this:

1. remove the comment marker in `src/tools/tidy/src/unstable_book.rs` line 122
2. run `./x.py test src/tools/tidy` to list the unstable features which only have stubs
3. revert the change in 1
3. document one of the chosen unstable features

The changes done by this PR also allow for further development:

* tidy obtains information about tracking issues. We can now forbid differing tracking issues between differing `#![unstable]` annotations. I haven't done this but plan to in a future PR
* we now have a general framework for generating stuff for the unstable book at build time. Further changes can autogenerate a list of the API a given library feature exposes.

r? @nagisa

Fixes #42454
bors added a commit that referenced this issue Jun 14, 2017
Autogenerate stubs and SUMMARY.md in the unstable book

Removes a speed bump in compiler development by autogenerating stubs for features in the unstable book. See #42454 for discussion.

The PR contains three commits, separated in order to make review easy:

* The first commit converts the tidy tool from a binary crate to a crate that contains both a library and a binary. In the second commit, we'll use the tidy library
* The second and main commit introduces autogeneration of SUMMARY.md and feature stub files
* The third commit turns off the tidy lint that checks for features without a stub, and removes the stub files. A separate commit due to the large number of files touched

Members of the doc team who wish to document some features can either do this (where `$rustsrc` is the root of the rust repo git checkout):

1. cd to `$rustsrc/src/tools/unstable-book-gen` and then do `cargo run $rustsrc/src $rustsrc/src/doc/unstable-book` to put the stubs into the unstable book
2. cd to `$rustsrc` and run `git ls-files --others --exclude-standard` to list the newly added stubs
3. choose a file to edit, then `git add` it and `git commit`
4. afterwards, remove all changes by the tool by doing `git --reset hard` and `git clean -f`

Or they can do this:

1. remove the comment marker in `src/tools/tidy/src/unstable_book.rs` line 122
2. run `./x.py test src/tools/tidy` to list the unstable features which only have stubs
3. revert the change in 1
3. document one of the chosen unstable features

The changes done by this PR also allow for further development:

* tidy obtains information about tracking issues. We can now forbid differing tracking issues between differing `#![unstable]` annotations. I haven't done this but plan to in a future PR
* we now have a general framework for generating stuff for the unstable book at build time. Further changes can autogenerate a list of the API a given library feature exposes.

The old way to simply click through the documentation after it has been uploaded to rust-lang.org works as well.

r? @nagisa

Fixes #42454
bors added a commit that referenced this issue Jun 16, 2017
Autogenerate stubs and SUMMARY.md in the unstable book

Removes a speed bump in compiler development by autogenerating stubs for features in the unstable book. See #42454 for discussion.

The PR contains three commits, separated in order to make review easy:

* The first commit converts the tidy tool from a binary crate to a crate that contains both a library and a binary. In the second commit, we'll use the tidy library
* The second and main commit introduces autogeneration of SUMMARY.md and feature stub files
* The third commit turns off the tidy lint that checks for features without a stub, and removes the stub files. A separate commit due to the large number of files touched

Members of the doc team who wish to document some features can either do this (where `$rustsrc` is the root of the rust repo git checkout):

1. cd to `$rustsrc/src/tools/unstable-book-gen` and then do `cargo run $rustsrc/src $rustsrc/src/doc/unstable-book` to put the stubs into the unstable book
2. cd to `$rustsrc` and run `git ls-files --others --exclude-standard` to list the newly added stubs
3. choose a file to edit, then `git add` it and `git commit`
4. afterwards, remove all changes by the tool by doing `git --reset hard` and `git clean -f`

Or they can do this:

1. remove the comment marker in `src/tools/tidy/src/unstable_book.rs` line 122
2. run `./x.py test src/tools/tidy` to list the unstable features which only have stubs
3. revert the change in 1
3. document one of the chosen unstable features

The changes done by this PR also allow for further development:

* tidy obtains information about tracking issues. We can now forbid differing tracking issues between differing `#![unstable]` annotations. I haven't done this but plan to in a future PR
* we now have a general framework for generating stuff for the unstable book at build time. Further changes can autogenerate a list of the API a given library feature exposes.

The old way to simply click through the documentation after it has been uploaded to rust-lang.org works as well.

r? @nagisa

Fixes #42454
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

5 participants