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

doc: Adopt intra doc links #803

Merged
merged 16 commits into from
Oct 9, 2020
Merged

doc: Adopt intra doc links #803

merged 16 commits into from
Oct 9, 2020

Conversation

jan-auer
Copy link
Member

@jan-auer jan-auer commented Oct 9, 2020

This changes the docs build to nightly, which renders intra doc links. relay-wstring already made use of them before, but the had not been rendered on our deployed docs.

#skip-changelog

@jan-auer jan-auer requested review from flub and a team October 9, 2020 07:29
@jan-auer jan-auer self-assigned this Oct 9, 2020
@jan-auer
Copy link
Member Author

jan-auer commented Oct 9, 2020

I'm going to change all occurrences, and then merge this.

@jan-auer jan-auer mentioned this pull request Oct 9, 2020
@@ -407,6 +404,8 @@ pub trait GaugeMetric {
}

/// Emits a metric.
///
/// See [module-level documentation](metrics/index.html) for examples.
Copy link
Member

Choose a reason for hiding this comment

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

you can also refer to modules by intra-doc syntax

Copy link
Member Author

Choose a reason for hiding this comment

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

Strange, I tried this in the top-level Relay binary, but it didn't work there. Let me try again.

Copy link
Member Author

Choose a reason for hiding this comment

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

So, I got this to work in cases where the module is imported, but not for extern crates, for instance. Any advice on how to import that?

relay-wstring/src/lib.rs Outdated Show resolved Hide resolved
.github/workflows/deploy.yml Outdated Show resolved Hide resolved
@jan-auer jan-auer merged commit 0fed3cc into master Oct 9, 2020
@jan-auer jan-auer deleted the doc/intra-doc-links branch October 9, 2020 13:15
@@ -13,14 +13,19 @@ jobs:
name: Cargo Docs
runs-on: ubuntu-latest

env:
RUSTDOCFLAGS: -Dbroken_intra_doc_links
Copy link

Choose a reason for hiding this comment

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

To avoid killing the build cache, you could use cargo rustdoc -- -D broken_intra_doc_links. Since you only ever run cargo doc once, it might not matter though.

Copy link
Contributor

Choose a reason for hiding this comment

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

this does store the rust cache across runs with the swatinem/rust-cache@v1 action. How does the env vs the cmdline arg affect the cache?

Copy link

@jyn514 jyn514 Nov 4, 2020

Choose a reason for hiding this comment

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

RUSTDOCFLAGS is like RUSTFLAGS: whenever it changes, cargo assumes the whole build cache must be invalidated and effectively runs rm -rf target/doc. If you pass flags through rustdoc, it will only rebuild your crates, not your dependencies.

That said, I don't know how to make cargo rustdoc work with workspaces.

Copy link
Member Author

Choose a reason for hiding this comment

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

That and it doesn't offer --no-deps, at least from what I remember. That's why we went with RUSTDOCFLAGS. It works well, since we store the build cache only between docs builds, so the flags never change between builds and the cache is not pruned.

Comment on lines 57 to 65
//! [`relay-auth`]: ../relay_auth/index.html
//! [`relay-cabi`]: ../relay_cabi/index.html
//! [`relay-common`]: ../relay_common/index.html
//! [`relay-config`]: ../relay_config/index.html
//! [`relay-ffi`]: ../relay_ffi/index.html
//! [`relay-ffi-macros`]: ../relay_ffi_macros/index.html
//! [`relay-filter`]: ../relay_filter/index.html
//! [`relay-general`]: ../relay_general/index.html
//! [`relay-quotas`]: ../relay_quotas/index.html
Copy link

Choose a reason for hiding this comment

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

You likely couldn't convert these because relay doesn't depend on them directly. See rust-lang/rust#74481.

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.

4 participants