File tree Expand file tree Collapse file tree 2 files changed +50
-1
lines changed Expand file tree Collapse file tree 2 files changed +50
-1
lines changed Original file line number Diff line number Diff line change 11# sphinx-rust
22
3- Sphinx plugin for documentation of Rust projects
3+ Sphinx plugin for documentation of Rust projects.
4+
5+ See [ docs/] ( docs/ ) for more information.
Original file line number Diff line number Diff line change @@ -3,6 +3,53 @@ Sphinx Rust
33
44Auto-document Rust code with Sphinx!
55
6+ .. warning :: This project is in early development and is not yet ready for production use.
7+
8+ This package is intended to bring API documentation for rust crates to Sphinx:
9+
10+ - Auto-analysis of Rust crates
11+ - Auto-documentation of Rust crates: the documentation is generated to closely mirror the format of https://docs.rs
12+ - Integrates with sphinx cross-referencing system and inter-sphinx indexing
13+ - Supports writing docstrings for any valid Sphinx parser (reStructuredText, MyST markdown, etc.)
14+
15+ Installation
16+ ------------
17+
18+ .. code-block :: bash
19+
20+ pip install sphinx-rust
21+
22+ Usage
23+ -----
24+
25+ Add `sphinx_rust ` to your `conf.py `, and specifiy the paths to the Rust crates you want to document:
26+
27+ .. code-block :: python
28+
29+ extensions = [
30+ " sphinx_rust" ,
31+ ]
32+ rust_crates = [
33+ " ../path/to/crate" ,
34+ ...
35+ ]
36+ ...
37+
38+ That's it!
39+
40+ Now you can use the `rust ` cross-referencing roles to link to items in your Rust crates:
41+
42+ .. code-block :: restructuredtext
43+
44+ - :rust:module:`analyzer::analyze`
45+ - :rust:struct:`analyze::struct_::Struct`
46+ - :rust:enum:`analyze::type_::TypeSegment`
47+
48+ - :rust:module: `analyzer::analyze `
49+ - :rust:struct: `analyzer::analyze::struct_::Struct `
50+ - :rust:enum: `analyzer::analyze::type_::TypeSegment `
51+
652.. toctree ::
53+ :caption: API Examples
754
855 api/index
You can’t perform that action at this time.
0 commit comments