Commit Graph

210 Commits

Author SHA1 Message Date
Guillaume Gomez bbbefa3edc Allow doc alias attributes to use both list and value 2021-03-10 10:17:37 +01:00
Guillaume Gomez 2a5ecb2927
Rollup merge of #82690 - jyn514:remove-pass-docs, r=Manishearth
Update rustdoc documentation

- Remove most of the information about passes. Passes are deprecated.
- Add `--document-private-items`; it was missing before.
- Update `--output-format json`; it was very outdated.
- Note that `--input-format` is deprecated.
- Move deprecated options to the very end.

Closes https://github.com/rust-lang/rust/issues/82675.

r? `@Manishearth`
2021-03-04 21:56:33 +01:00
Joshua Nelson dbdaa12486 Update rustdoc documentation
- Remove most of the information about passes. Passes are deprecated.
- Add `--document-private-items`; it was missing before.
- Update `--output-format json`; it was very outdated.
- Note that `--input-format` is deprecated.
- Move deprecated options to the very end.
- Move `passes.html` to the end of the table of contents. Ideally it
  would be removed altogether, but that causes mdbook not to generate the
  docs.
2021-03-04 14:07:34 -05:00
Yuki Okushi f898aa3f5b
Rollup merge of #80527 - jyn514:rustdoc-lints, r=GuillaumeGomez
Make rustdoc lints a tool lint instead of built-in

- Rename `broken_intra_doc_links` to `rustdoc::broken_intra_doc_links` (and similar for other rustdoc lints; I don't expect any others to be used frequently, though).
- Ensure that the old lint names still work and give deprecation errors
- Register lints even when running doctests
- Move lint machinery into a separate file
- Add `declare_rustdoc_lint!` macro

Unblocks https://github.com/rust-lang/rust/pull/80300, https://github.com/rust-lang/rust/pull/79816, https://github.com/rust-lang/rust/pull/80965. Makes the strangeness in https://github.com/rust-lang/rust/pull/77364 more apparent to the end user (note that `missing_docs` is *not* moved to rustdoc in this PR). Closes https://github.com/rust-lang/rust/issues/78786.

## Current status

This is blocked on #82620 (see https://github.com/rust-lang/rust/pull/80527#issuecomment-787401519)
2021-03-04 20:01:01 +09:00
Yuki Okushi a9339ed531
Rollup merge of #80874 - jyn514:intra-doc-docs, r=Manishearth
Update intra-doc link documentation to match the implementation

r? `@Manishearth`
cc `@camelid` `@m-ou-se`

Relevant PRs:
- https://github.com/rust-lang/rust/pull/74489
- https://github.com/rust-lang/rust/pull/80181
- https://github.com/rust-lang/rust/pull/76078
- https://github.com/rust-lang/rust/pull/77519
- https://github.com/rust-lang/rust/pull/73101

Relevant issues:
- https://github.com/rust-lang/rust/issues/78800
- https://github.com/rust-lang/rust/issues/77200
- https://github.com/rust-lang/rust/issues/77199 / https://github.com/rust-lang/rust/issues/54191/

I haven't documented things that I consider 'just bugs', like https://github.com/rust-lang/rust/issues/77732, but I have documented features that aren't implemented, like https://github.com/rust-lang/rust/issues/78800.
2021-03-02 21:23:13 +09:00
Joshua Nelson 0517ea7cdc Address review comments
- Move MISSING_CRATE_LEVEL_DOCS to rustdoc directly
- Update documentation

This also takes the opportunity to make the `no-crate-level-doc-lint`
test more specific.
2021-03-01 19:29:15 -05:00
Joshua Nelson c2694f15d0 Fix compile failure due to 2015 module system being weird 2021-02-22 23:19:40 -05:00
Dylan DPC 1c2a949736
Rollup merge of #79423 - camelid:smart-punct, r=jyn514
Enable smart punctuation

Closes #76690.
2021-02-23 02:51:42 +01:00
Joshua Nelson 86e2fcbf31 Don't include quite so much detail about the implementation 2021-02-18 20:53:22 -05:00
Dylan DPC d9bc16cf36
Rollup merge of #82261 - ojeda:rustdoc-argfile, r=jyn514
rustdoc: Support argument files

Factors out the `rustc_driver` logic that handles argument files so that rustdoc supports them as well, e.g.:

    rustdoc `@argfile`

This is needed to be able to generate docs for projects that already use argument files when compiling them, e.g. projects that pass a huge number of `--cfg` arguments.

The feature was stabilized for `rustc` in #66172.
2021-02-19 02:49:12 +01:00
Miguel Ojeda 755b3fc722 rustdoc: Support argument files
Factors out the `rustc_driver` logic that handles argument files
so that rustdoc supports them as well, e.g.:

    rustdoc @argfile

This is needed to be able to generate docs for projects that
already use argument files when compiling them, e.g. projects
that pass a huge number of `--cfg` arguments.

The feature was stabilized for `rustc` in #66172.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2021-02-19 02:32:45 +01:00
Camelid e4b83fcad4 Document smart punctuation 2021-02-07 20:19:16 -08:00
Jonas Schievink e143159e75
Rollup merge of #81766 - jyn514:task-lists, r=GuillaumeGomez
Enable 'task list' markdown extension

Closes https://github.com/rust-lang/rust/issues/71183.
2021-02-06 17:01:50 +01:00
Joshua Nelson 9653b601b2 Enable 'task list' markdown extension
- Add documentation about task lists
2021-02-06 00:08:21 -05:00
Eric Huss dc7746f334 Elaborate on rustdoc example reason for being ignored. 2021-02-04 09:01:50 -08:00
Eric Huss bb22eaf39e tidy: Run tidy style against markdown files. 2021-02-04 09:01:50 -08:00
Eric Huss 1c0a52d304 rustdoc: Document CommonMark extensions. 2021-01-25 11:03:15 -08:00
Joshua Nelson 44c72f65d6
Fix relative links
Co-authored-by: Camelid <camelidcamel@gmail.com>
2021-01-10 23:10:05 -05:00
Joshua Nelson 21717f0c17
Fix typo
Co-authored-by: Camelid <camelidcamel@gmail.com>
2021-01-10 16:31:37 -05:00
Joshua Nelson db0b416656 Address review comments
- Improve wording
- Use relative links
- Use a proper list instead of a wall of text
- Improve examples
2021-01-10 16:00:18 -05:00
Joshua Nelson d5392d1962 Document differences from markdown 2021-01-10 10:20:36 -05:00
Joshua Nelson 02717911fd Update intra-doc link documentation to match the implementation 2021-01-10 09:30:28 -05:00
Mara Bos 7800c70fab
Rollup merge of #80410 - MarcoIeni:patch-1, r=jonas-schievink
rustdoc book: fix example

`lib.rs` file is created only if `--lib` flag is specified
2020-12-28 19:09:29 +00:00
Mara Bos bae6475443
Rollup merge of #80393 - ehuss:doc-git-link, r=jyn514
Add links to the source for the rustc and rustdoc books.

This adds a little icon in the upper-right corner of the books so that readers can find the source if they want to make changes or file issues. This is already included in several of the other books.
2020-12-28 19:09:22 +00:00
Marco Ieni f57152f640
rustdoc book: fix example 2020-12-27 14:10:00 +01:00
Eric Huss 142764f79e Add links to the source for the rustc and rustdoc books. 2020-12-26 13:22:33 -08:00
Ian Jackson 63f3876b85
fix typo in src/doc/rustdoc/src/command-line-arguments.md
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2020-12-03 10:22:57 +00:00
Ian Jackson c21b275d35 rustdoc: document --default-theme option in command line doc
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2020-12-03 00:50:37 +00:00
bors a601302ff0 Auto merge of #75778 - AndyGauge:75521-rustdoc-book-improvements, r=jyn514
75521 rustdoc book improvements

Added some guidelines about documenting with rustdoc
Fixes #75521
2020-11-06 19:01:10 +00:00
Guillaume Gomez 9d114506c6 Rename lint to non_autolinks 2020-11-05 10:22:08 +01:00
Guillaume Gomez fce2be0ea7 Update URLs used in the lint example 2020-11-05 10:22:08 +01:00
Guillaume Gomez 60caf51b0d Rename automatic_links to url_improvements 2020-11-05 10:22:08 +01:00
Guillaume Gomez 7f839b2ece Improve automatic_links globally 2020-11-05 10:22:08 +01:00
Guillaume Gomez f467b8d77c Extend automatic_links lint to take into account URLs without link syntax 2020-11-05 10:22:08 +01:00
Guillaume Gomez a54f043733 Add documentation for automatic_links lint 2020-11-05 10:22:08 +01:00
Andrew Gauger 881820aa06 Added Rustdoc book sections for linting and embedding more examples
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-11-04 17:47:50 -08:00
Guillaume Gomez f553c226c1
Fix typo "compiltest" 2020-10-28 15:51:26 +01:00
Camelid d725da129e Clean up and improve some docs
* compiler docs
  * Don't format list as part of a code block
  * Clean up some other formatting
* rustdoc book
  * Update CommonMark spec version to latest (0.28 -> 0.29)
  * Clean up some various wording and formatting
2020-10-21 18:01:04 -07:00
Camelid 330ce948f7
Link to GitHub issue re macro resolution
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-10-09 16:03:00 -07:00
Camelid b9c299effd Update rustdoc intra-doc link docs
* Describe generic parameters feature
* Make general improvements to the docs
2020-10-08 22:24:38 -07:00
bors 8ae3b50976 Auto merge of #77119 - GuillaumeGomez:unclosed-html-tag-lint, r=jyn514
Unclosed html tag lint

Part of #67799.

I think `@ollie27` will be interested (`@Manishearth` too since they opened the issue ;) ).

r? `@jyn514`
2020-10-07 09:56:51 +00:00
Yuki Okushi 97ee62cee4
Rollup merge of #76855 - jyn514:platform-specific, r=ollie27
Revamp rustdoc docs about documentation using `cfg`

- Move `cfg(doc)` out of `unstable-features`. It's not unstable.
- Remove outdated reference to `everybody_loops`.
- Improve wording in various places
- Give an example of code this allows (and does not allow)
- Link to `cfg(doc)` in `doc(cfg)` documentation. Since one is stable
and the other is not, don't combine them.
- Cleanup wording for `doc(cfg)`
- Incorporate changes from #76849
- Mention that `doc(cfg)` is also for features

Addresses https://github.com/rust-lang/rust/pull/76849#issuecomment-694516199.
Obsoletes https://github.com/rust-lang/rust/pull/76849 (I made sure to fix the weird dashes too).
r? @steveklabnik
2020-10-06 16:25:55 +09:00
Joshua Nelson dc5a000d79 Revamp rustdoc docs about documentation using `cfg`
- Move `cfg(doc)` out of `unstable-features`. It's not unstable.
- Remove outdated reference to `everybody_loops`.
- Improve wording in various places
- Give an example of code this allows (and does not allow)
- Link to `cfg(doc)` in `doc(cfg)` documentation. Since one is stable
and the other is not, don't combine them.
- Cleanup wording for `doc(cfg)`
- Incorporate changes from #76849
- Mention that `doc(cfg)` is also for features
2020-10-05 19:06:38 -04:00
Guillaume Gomez f9a65afb27 Make invalid_html_tags lint only run on nightly and being allowed by default 2020-10-03 14:16:24 +02:00
Guillaume Gomez 5fcbf4668e Add doc for invalid_html_tag lint 2020-10-03 14:16:24 +02:00
Jonas Schievink c7c2418227
Rollup merge of #76811 - GuillaumeGomez:doc-alias-name-restriction, r=oli-obk,ollie27
Doc alias name restriction

Fixes #76705.
2020-10-02 20:27:03 +02:00
Guillaume Gomez 4427b2d52c Update doc alias documentation 2020-10-02 19:26:59 +02:00
Joshua Nelson 80ffaed809 Add documentation for `private_intra_doc_links` 2020-09-27 10:44:41 -04:00
bors 78a089487b Auto merge of #74430 - Manishearth:stabilize-intra-doc, r=Manishearth
Stabilize intra-doc links

Fixes https://github.com/rust-lang/rust/issues/43466

Thanks to the great work of `@jyn514` in getting the [cross-crate reexport issue](https://github.com/rust-lang/rust/issues/65983) in intra-rustdoc links fixed, I think we're now in a position to stabilize this feature.

The tracking issue currently has two unresolved issues:

 - <s>behavior around doc(hidden): This is fixed in https://github.com/rust-lang/rust/pull/73365, which is just waiting for CI and should land tomorrow. It's also a pretty niche bug so while I expect it to land soon I don't think we need to block stabilization on it anyway.</s>
 - Non-identifier primitive types like slices: This was not a part of the original RFC anyway, and is a pretty niche use case

The feature itself, sans https://github.com/rust-lang/rust/issues/65983, has been shipped on nightly for three years now, with people using it on docs.rs. https://github.com/rust-lang/rust/issues/65983 itself is not an overwhelmingly central bit of functionality; the reason we elected to block stabilization on it was that back in 2017 it was not possible to fix the issue without some major refactorings of resolve, and we did not want to stabilize something that had such a potentially unfixable bug.

Given that we've fixed it, I see no reason to delay stabilization on this long awaited feature. It's possible that the latest patches have problems, however we _have_ done crater runs of some of the crucial parts. Furthermore, that's what the release trains are for, we will have a solid three months to let it ride the trains before it actually hits the stable compiler.

r? `@rust-lang/rustdoc`
2020-09-24 03:42:53 +00:00
Manish Goregaokar 6928041c0a
Update src/doc/rustdoc/src/linking-to-items-by-name.md
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-09-17 20:21:09 -07:00