Skip to content

Commit 2b06fa4

Browse files
committed
Initial try for API docs generated by Sphinx
1 parent 324bb81 commit 2b06fa4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+12041
-24
lines changed

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,8 @@ format:
102102

103103
# Downloads the required native artifacts for the specified version
104104
download-native-artifacts:
105-
python3 scripts/download_artifacts.py $(C2PA_VERSION)
105+
python3 scripts/download_artifacts.py $(C2PA_VERSION)
106+
107+
# Build API documentation with Sphinx
108+
docs:
109+
python3 scripts/generate_api_docs.py

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,35 @@ See the [`examples` directory](https://github.com/contentauth/c2pa-python/tree/m
3636
- `examples/sign.py` shows how to sign and verify an asset with a C2PA manifest.
3737
- `examples/training.py` demonstrates how to add a "Do Not Train" assertion to an asset and verify it.
3838

39+
## API reference documentation
40+
41+
You can generate API docs with one command. How to use:
42+
43+
Install dev deps:
44+
```
45+
cd c2pa-python
46+
python3 -m pip install -r requirements-dev.txt
47+
```
48+
49+
Build docs:
50+
51+
```
52+
make -C docs
53+
```
54+
55+
Output:
56+
57+
```
58+
Open docs/build/html/index.html
59+
```
60+
61+
This uses `sphinx-autoapi` to parse `src/c2pa` directly, avoiding imports of native libs.
62+
- Entry script: `scripts/generate_api_docs.py`
63+
- Config: `docs/conf.py`; index: `docs/index.rst`
64+
65+
Sphinx config is in `docs/conf.py`, an `index.rst`, added `scripts/generate_api_docs.py`, updated `requirements-dev.txt` with `Sphinx/AutoAPI/Myst/Furo`, and added a docs Makefile target.
66+
67+
3968
## Contributing
4069

4170
Contributions are welcome! For more information, see [Contributing to the project](https://github.com/contentauth/c2pa-python/blob/main/docs/project-contributions.md).

docs/_build/html/.buildinfo

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Sphinx build info version 1
2+
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
3+
config: 53282eb9822e647a3645ce7cee2700e3
4+
tags: 645f666f9bcd5a90fca523b33c5a78b7
226 KB
Binary file not shown.
176 KB
Binary file not shown.
4.02 KB
Binary file not shown.
776 KB
Binary file not shown.
3.1 KB
Binary file not shown.
17.4 KB
Binary file not shown.
18.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)