Skip to content

Commit 30b515e

Browse files
authored
Merge pull request #77 from Point72/tkp/b
Add breathe integration
2 parents a7acb63 + 6f2c767 commit 30b515e

File tree

19 files changed

+2304
-47
lines changed

19 files changed

+2304
-47
lines changed

.github/workflows/build.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ jobs:
3939
with:
4040
version: ${{ matrix.python-version }}
4141

42+
- name: Install Rust
43+
uses: dtolnay/rust-toolchain@stable
44+
45+
- name: Install doxygen
46+
run: sudo apt-get install -y doxygen
47+
48+
- name: Clean up problematic directories
49+
run: rm -rf docs/jupyter_execute
50+
4251
- name: Install dependencies
4352
run: make develop
4453

.github/workflows/docs.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ jobs:
1010
docs:
1111
runs-on: ubuntu-latest
1212
steps:
13+
- uses: actions/checkout@v6
14+
15+
- name: Install Rust
16+
uses: dtolnay/rust-toolchain@stable
17+
18+
- name: Install doxygen
19+
run: sudo apt-get install -y doxygen
20+
1321
- uses: actions-ext/yardang@main
1422
with:
1523
token: ${{ secrets.GITHUB_TOKEN }}

docs/src/api.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# API Reference
2+
3+
## Python API
4+
5+
### yardang.build
6+
7+
```{eval-rst}
8+
.. automodule:: yardang.build
9+
:members:
10+
:undoc-members:
11+
:show-inheritance:
12+
```
13+
14+
### yardang.cli
15+
16+
```{eval-rst}
17+
.. automodule:: yardang.cli
18+
:members:
19+
:undoc-members:
20+
:show-inheritance:
21+
```
22+
23+
### yardang.utils
24+
25+
```{eval-rst}
26+
.. automodule:: yardang.utils
27+
:members:
28+
:undoc-members:
29+
:show-inheritance:
30+
```
31+
32+
## C++ Example
33+
34+
This is an example of documenting C++ code using breathe integration.
35+
36+
### Document Everything
37+
38+
Use `doxygenindex` to document all symbols from Doxygen XML:
39+
40+
```doxygenindex
41+
```
42+
43+
```{toctree}
44+
:hidden:
45+
:maxdepth: 2
46+
47+
/examples/cpp/docs/api
48+
```
49+
50+
### Document Individual Classes
51+
52+
Or document specific classes with `doxygenclass`:
53+
54+
```doxygenclass calc::Calculator
55+
:members:
56+
```
57+
58+
```doxygenclass calc::ScientificCalculator
59+
:members:
60+
```
61+
62+
## Rust Example
63+
64+
This is an example of documenting Rust code using sphinx-rust integration.
65+
66+
### Document a Crate
67+
68+
Use `rust:crate` to document an entire Rust crate:
69+
70+
```{eval-rst}
71+
.. rust:crate:: calculator
72+
73+
```
74+
75+
```{toctree}
76+
:hidden:
77+
:maxdepth: 2
78+
79+
/api/crates/calculator/index
80+
```
81+
82+
### Document Individual Items
83+
84+
Or document specific structs, enums, and functions:
85+
86+
```{eval-rst}
87+
.. rust:struct:: calculator::Calculator
88+
89+
```
90+
91+
```{eval-rst}
92+
.. rust:struct:: calculator::ScientificCalculator
93+
94+
```
95+
96+
```{eval-rst}
97+
.. rust:enum:: calculator::Operation
98+
99+
```
100+
101+
```{eval-rst}
102+
.. rust:enum:: calculator::CalculatorError
103+
104+
```
105+

0 commit comments

Comments
 (0)