Skip to content

Commit 67803a9

Browse files
committed
update README and logo
1 parent 59e3ae7 commit 67803a9

File tree

3 files changed

+50
-48
lines changed

3 files changed

+50
-48
lines changed

README.md

+18-48
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,32 @@
1-
# nb-autodoc
2-
3-
![Python Version](https://img.shields.io/badge/Python-3.7%2B-%233eca5f)
4-
5-
### Module 处理标准
6-
7-
1. 成员寻找和顺序
8-
9-
所有子模块都会在内部 import (`config.skip_import_modules`),严格依照 `__dict__` 或者有 stub 时调用 stub 的 definitions 进行解析
10-
11-
2. definition 和 external
12-
13-
definition 规定在本模块的定义成员。external 规定来自外部模块的成员,只有 from...import 中解析到对应模块名才会认为是 external
14-
15-
动态创建的函数或类都可以由 definition finder 配合 inspect 解决
1+
<div align="center">
162

17-
3. stub 和 real
3+
<img src="logo/logo.png" width=200, height=200 alt="nb-autodoc"></img>
184

19-
stub 会以 CO_FUTURE_ANNOTATIONS flag compile 并执行。
20-
21-
当存在 stub 和 real 时,real 仅用于获取 docstring(可能是 c extension)
22-
23-
当 real 不是 sourcefile (etc. c extension) 并且没有 stub 时,不做处理
24-
25-
当 stub 是独立的,没有实际模块时,也会进行输出(相当于把 real docstring 设为空)
26-
27-
以上信息由 Module 解析提供,Module 仅向外部提供可访问的 definition 和 external
28-
29-
4. docstring 绑定则不可变,annotation 重复出现则覆盖
30-
31-
### Class 处理标准
5+
# nb-autodoc
326

33-
待定,估计有一些 type parameter 和成员类型的问题。
7+
![python version](https://img.shields.io/badge/python-3.8+-%233eca5d)
8+
![pypi version](https://img.shields.io/pypi/v/nb-autodoc)
349

35-
### autodoc problem
10+
[简体中文](README.md)
11+
·
12+
[English](README_en.md)
3613

37-
考虑这样一个情况:
14+
</div>
3815

39-
```
40-
./
41-
main.py
42-
internal/
43-
__init__.py
44-
external/
45-
__init__.py
46-
```
16+
## 简介
4717

48-
internal 有个 Foo 类,包括成员 ab,需要在 external 控制 Foo 和其成员要怎么做?
18+
nb-autodoc 是一个从 Python 源码的 [类型注解](https://docs.python.org/3/library/typing.html)[Docstring](https://peps.python.org/pep-0257/) 自动生成 API 文档的工具。
4919

20+
本工具从包里查找所有的模块并导入,解析各模块的抽象语法树、运行时类型,链接内部对象,解析函数签名和 docstring 语法树,最终生成完整、可靠、带有链接的 API 文档。
5021

51-
解决方案:根据 ast from...import 进行链式解析。
22+
## 主要特性
5223

53-
### Literal annotation
24+
- 基于 AST 的类型分析系统
5425

55-
1. 验证是否 new style,由于 new style 处理过于复杂(FunctionType 嵌套和转换问题),对其只进行 refname 替换
26+
- stub (.pyi) 支持
5627

57-
2. 不是 new style 则进行 evaluate
28+
- TYPE_CHECKING 支持
5829

59-
### others
30+
- Re-export 支持,从 AST 解析导入引用
6031

61-
问题:
62-
1. 来自其他模块的对象在本模块输出,链接问题
32+
- Overload 重载函数支持

README_en.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<div align="center">
2+
3+
<img src="logo/logo.png" width=200, height=200 alt="nb-autodoc"></img>
4+
5+
# nb-autodoc
6+
7+
![python version](https://img.shields.io/badge/python-3.8+-%233eca5d)
8+
![pypi version](https://img.shields.io/pypi/v/nb-autodoc)
9+
10+
[简体中文](README.md)
11+
·
12+
[English](README_en.md)
13+
14+
</div>
15+
16+
## Overview
17+
18+
nb-autodoc is a tool designed to automatically generate API documentation from Python source code with [Type hints]((https://docs.python.org/3/library/typing.html)) and [Docstring](https://peps.python.org/pep-0257/).
19+
20+
This tool finds and imports all modules from the package, analyzes the AST and runtime of each module, links internal objects, resolves function signatures and docstring syntax trees, and finally generates complete, reliable and linked API documentation.
21+
22+
## Feature
23+
24+
- type annotation analysis system based on AST
25+
26+
- stub (.pyi) support
27+
28+
- TYPE_CHECKING support
29+
30+
- Re-export support, resolve import reference from AST
31+
32+
- Overload function support

logo/logo.png

16.7 KB
Loading

0 commit comments

Comments
 (0)