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

Fix docs for docsrs attribute #1466

Merged
merged 1 commit into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion book/src/tutorial/generate_docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ This is mostly useful for clarifying feature requirements through the docs.
To build the docs with the `docsrs` attribute, you can use the following command:

```sh
RUSTDOCFLAGS='--cfg docsrs' cargo +nightly doc --all-features
RUSTFLAGS='--cfg docsrs' RUSTDOCFLAGS='--cfg docsrs' cargo +nightly doc --all-features
```

Congratulations, we are done.
Expand Down
3 changes: 3 additions & 0 deletions book/src/tutorial/high_level_rust_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ Add the following lines to the file:
```toml
[package.metadata.docs.rs]
all-features = true
# For build.rs scripts
rustc-args = ["--cfg", "docsrs"]
# For rustdoc
rustdoc-args = ["--cfg", "docsrs"]
```
This automatically activates the `docsrs` attribute if you chose to publish the bindings and docs.rs tries to build the documentation.
Expand Down