Skip to content

Commit

Permalink
Add warning to rustdocs when building from main branch (#493)
Browse files Browse the repository at this point in the history
# Objective

When viewing the API docs from valence.rs, there is no obvious
indication that they are for the `main` branch. This could lead to
confusion in the future.

# Solution

Add a warning to the docs, but only when building from
`website/build.sh`.

> **❗ NOTE:** This documentation is sourced from the `main` branch. If
you're looking for the most recent stable release, go
[here](https://docs.rs/valence/latest/valence/).
  • Loading branch information
rj00a authored Aug 24, 2023
1 parent 8e3c273 commit 925f0db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#![doc = include_str!("../README.md")] // Points to the main project README.
#![cfg_attr(
unstable_doc,
doc = "**❗ NOTE:** This documentation is sourced from the `main` branch. If you're looking for the most recent stable release, go [here](https://docs.rs/valence/latest/valence/).\n\n---\n"
)]
#![doc = include_str!("../README.md")]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/valence-rs/valence/main/assets/logo.svg",
html_favicon_url = "https://raw.githubusercontent.com/valence-rs/valence/main/assets/logo.svg"
Expand Down
2 changes: 1 addition & 1 deletion website/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ zola build
mdbook build

# build rustdoc
cargo doc --no-deps --workspace --all-features
RUSTDOCFLAGS='--cfg unstable_doc' cargo doc --no-deps --workspace --all-features
cp -r ../target/doc/* public/rustdoc

# copy logo assets
Expand Down

0 comments on commit 925f0db

Please sign in to comment.