Skip to content

Commit 21e9e57

Browse files
committed
add README.md
1 parent e70a7fc commit 21e9e57

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<img src="./logo.png" width="125" height="125" align="right" />
2+
3+
# rustpython-doc
4+
5+
This `rustpython-doc` package contains all `__doc__` database in forms of `docs.inc.rs`.
6+
7+
## How to update `__doc__` in RustPython
8+
9+
Adding a remake in front of `[pyclass]` of `[pyfunction]` will simply make the documentation to themselves, however, we do not manually add docs anymore.
10+
11+
> But we don't manually add docs anymore. We have an auto-generated document db.
12+
>
13+
> The db is generated by scripts/generate_docs.py and applied to each object and functions by rustpython-doc::Database (search for crate::doc::Database::shared() in source code)
14+
>
15+
> *- Originally posted by @youknowone in [RustPython#4205 (comment)](https://github.com/RustPython/RustPython/pull/4205)*
16+
17+
Therefore you must update `docs.in.rs`, if it is unnecessary to different from cpython's `__doc__`
18+
19+
## How to update `docs.in.rs`
20+
21+
To update `__doc__` for newer python version:
22+
23+
```
24+
$ python generate_docs.py {RustPython PATH} ./docs.inc.rs
25+
```
26+
This will iterate all stdlib modules to inspect their `__doc__`, updating your local `docs.in.rs` file. Since RustPython is only able to access the database in this online package, the changes must be merged into this branch.
27+
28+
After that, update cargo:
29+
```
30+
$ cargo update
31+
```
32+
## Why the `__doc__` is not changed?
33+
34+
### Check if it is related to the unclosed issue
35+
There is still some issue with `generate_docs.py`
36+
- https://github.com/RustPython/RustPython/issues/3973
37+
38+
39+
40+
### Check if the old remark documentation are not removed yet
41+
42+
RustPython prioritizes the user define documentation first. Check if old remarks remaining in the source code, and remove them.

logo.png

18.3 KB
Loading

0 commit comments

Comments
 (0)