Skip to content

Instantly share code, notes, and snippets.

@SmallEndian
Last active February 20, 2024 18:54
Show Gist options
  • Select an option

  • Save SmallEndian/05e11181b687e0aba1cfe23475b4dc04 to your computer and use it in GitHub Desktop.

Select an option

Save SmallEndian/05e11181b687e0aba1cfe23475b4dc04 to your computer and use it in GitHub Desktop.
Change rustdoc's default theme

While all rust documentation has some pretty nice themes, it's a bother to have to select the proper theme for evey single repo, and sometimes this choice does not affect other modules.

Simply add this to your ENV.

# .zshrc
export RUSTDOCFLAGS="--default-theme=ayu"

There's a better way to do this, it's to modify the Cargo doc. So that's a toml file that is held in the user directory.

$USER/cargo/config.toml

[build]
rustdocflags=["--default-theme=ayu"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment