Skip to content

Commit 4eb94e0

Browse files
authored
Add example usage of pydoctor in the build customization page (#12259)
This adds a complete example of using [pydoctor](https://github.com/twisted/pydoctor). The generated docs will include links to the source code and the standard library types when relevant. <!-- readthedocs-preview docs start --> --- :books: Documentation previews :books: - User's documentation (`docs`): https://docs--12259.org.readthedocs.build/12259/ <!-- readthedocs-preview docs end --> <!-- readthedocs-preview dev start --> - Developer's documentation (`dev`): https://dev--12259.org.readthedocs.build/12259/ <!-- readthedocs-preview dev end -->
1 parent d985873 commit 4eb94e0

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

docs/user/build-customization.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,32 @@ Here is an example configuration file:
631631
html:
632632
- asciidoctor -D $READTHEDOCS_OUTPUT/html index.asciidoc
633633
634+
Using pydoctor
635+
~~~~~~~~~~~~~~
636+
637+
`Pydoctor <https://github.com/twisted/pydoctor>`_ is an easy-to-use standalone API documentation tool for Python.
638+
Here is an example configuration file:
639+
640+
.. code-block:: yaml
641+
:caption: .readthedocs.yaml
642+
643+
version: 2
644+
build:
645+
os: "ubuntu-22.04"
646+
jobs:
647+
install:
648+
- pip install pydoctor
649+
build:
650+
html:
651+
- |
652+
pydoctor \
653+
--project-version=${READTHEDOCS_GIT_IDENTIFIER} \
654+
--project-url=${READTHEDOCS_GIT_CLONE_URL%*.git} \
655+
--html-viewsource-base=${READTHEDOCS_GIT_CLONE_URL%*.git}/tree/${READTHEDOCS_GIT_COMMIT_HASH} \
656+
--html-base-url=${READTHEDOCS_CANONICAL_URL} \
657+
--html-output $READTHEDOCS_OUTPUT/html/ \
658+
./src/my_project
659+
634660
Generate text format with Sphinx
635661
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
636662

0 commit comments

Comments
 (0)