Skip to content

Commit

Permalink
Minor improvements to documentation. (#2846)
Browse files Browse the repository at this point in the history
  • Loading branch information
UebelAndre authored Sep 10, 2024
1 parent 9ad0b00 commit 42f327f
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 21 deletions.
2 changes: 1 addition & 1 deletion docs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PAGES = dict([
],
),
page(
name = "defs",
name = "rust",
symbols = [
"rust_binary",
"rust_library",
Expand Down
5 changes: 4 additions & 1 deletion docs/book.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[book]
authors = ["UebelAndre"]
authors = ["UebelAndre", "illicitonion", "scentini"]
language = "en"
multilingual = false
src = "src"
title = "rules_rust"

[output.html]
git-repository-url = "https://github.com/bazelbuild/rules_rust"
5 changes: 4 additions & 1 deletion docs/rust_analyzer.vm
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ to ensure a `rust-project.json` file is created and up to date when the editor i
{
"label": "Generate rust-project.json",
"command": "bazel",
"args": ["run", "@rules_rust//tools/rust_analyzer:gen_rust_project"],
"args": [
"run",
"//tools/rust_analyzer:gen_rust_project"
],
"options": {
"cwd": "${workspaceFolder}"
},
Expand Down
2 changes: 1 addition & 1 deletion docs/rust_wasm_bindgen.vm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Bazel rules for generating wasm modules for Javascript using [wasm-bindgen][wb].
To begin using the `wasm-bindgen` rules, users can load the necessary dependencies
in their workspace by adding the following to their `WORKSPACE.bazel` file.

```starlark
```python
load("@rules_rust//wasm_bindgen:repositories.bzl", "rust_wasm_bindgen_dependencies", "rust_wasm_bindgen_register_toolchains")

rust_wasm_bindgen_dependencies()
Expand Down
2 changes: 1 addition & 1 deletion docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
---

- [Rules](./rules.md)
- [defs](./defs.md)
- [rust](./rust.md)
- [rustdoc](./rust_doc.md)
- [clippy](./rust_clippy.md)
- [rustfmt](./rust_fmt.md)
Expand Down
4 changes: 1 addition & 3 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# [Rules Rust](https://github.com/bazelbuild/rules_rust)

## Overview
# Rules Rust

This repository provides rules for building [Rust][rust] projects with [Bazel][bazel].

Expand Down
24 changes: 14 additions & 10 deletions docs/src/rules.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
# Rules

- [defs](defs.md): standard rust rules for building and testing libraries and binaries.
- [rust_doc](rust_doc.md): rules for generating and testing rust documentation.
- [rust_clippy](rust_clippy.md): rules for running [clippy](https://github.com/rust-lang/rust-clippy#readme).
- [rust_fmt](rust_fmt.md): rules for running [rustfmt](https://github.com/rust-lang/rustfmt#readme).
- [rust_proto](rust_proto.md): rules for generating [protobuf](https://developers.google.com/protocol-buffers) and [gRPC](https://grpc.io) stubs.
- [rust_bindgen](rust_bindgen.md): rules for generating C++ bindings.
- [rust_wasm_bindgen](rust_wasm_bindgen.md): rules for generating [WebAssembly](https://www.rust-lang.org/what/wasm) bindings.
- [rustdoc](rust_doc.md): rules for generating and testing rust documentation.
- [clippy](rust_clippy.md): rules for running [clippy](https://github.com/rust-lang/rust-clippy#readme).
- [rustfmt](rust_fmt.md): rules for running [rustfmt](https://github.com/rust-lang/rustfmt#readme).
- [cargo](cargo.md): Rules dedicated to Cargo compatibility. ie: [`build.rs` scripts](https://doc.rust-lang.org/cargo/reference/build-scripts.html).
- [crate_universe (bzlmod)](crate_universe_bzlmod.md): Rules for generating Bazel targets for external crate dependencies when using bzlmod.
- [crate_universe (WORKSPACE)](crate_universe.md): Rules for generating Bazel targets for external crate dependencies when using WORKSPACE files.

You can also browse the [full API in one page](flatten.md).
- [crate_universe](external_crates.md): Rules for generating Bazel targets for external crate dependencies.

## Experimental rules

- [rust_analyzer](rust_analyzer.md): rules for generating `rust-project.json` files for [rust-analyzer](https://rust-analyzer.github.io/)

## 3rd party rules

- [rust_bindgen](rust_bindgen.md): rules for generating C++ bindings.
- [rust_proto](rust_proto.md): rules for generating [protobuf](https://developers.google.com/protocol-buffers) and [gRPC](https://grpc.io) stubs.
- [rust_wasm_bindgen](rust_wasm_bindgen.md): rules for generating [WebAssembly](https://www.rust-lang.org/what/wasm) bindings.

## Full API

You can also browse the [full API in one page](flatten.md).
2 changes: 1 addition & 1 deletion docs/src/defs.md → docs/src/rust.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- Generated with Stardoc: http://skydoc.bazel.build -->
# Defs
# Rust

* [rust_binary](#rust_binary)
* [rust_library](#rust_library)
Expand Down
5 changes: 4 additions & 1 deletion docs/src/rust_analyzer.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ to ensure a `rust-project.json` file is created and up to date when the editor i
{
"label": "Generate rust-project.json",
"command": "bazel",
"args": ["run", "@rules_rust//tools/rust_analyzer:gen_rust_project"],
"args": [
"run",
"//tools/rust_analyzer:gen_rust_project"
],
"options": {
"cwd": "${workspaceFolder}"
},
Expand Down
2 changes: 1 addition & 1 deletion docs/src/rust_wasm_bindgen.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Bazel rules for generating wasm modules for Javascript using [wasm-bindgen][wb].
To begin using the `wasm-bindgen` rules, users can load the necessary dependencies
in their workspace by adding the following to their `WORKSPACE.bazel` file.

```starlark
```python
load("@rules_rust//wasm_bindgen:repositories.bzl", "rust_wasm_bindgen_dependencies", "rust_wasm_bindgen_register_toolchains")

rust_wasm_bindgen_dependencies()
Expand Down

0 comments on commit 42f327f

Please sign in to comment.