Skip to content

Improve apidoc with pydoctor tool #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Nov 6, 2022
Merged

Conversation

tisonkun
Copy link
Member

@tisonkun tisonkun commented Nov 4, 2022

Using the numpy doc style. This format is also compatible with pdoc by specifying --docformat=numpy.

To preview locally:

pip3 install pydoctor
pydoctor --make-html --html-viewsource-base=https://github.com/apache/pulsar-client-python/tree/main --docformat=numpy --theme=readthedocs --html-output=apidoc pulsar
cd apidoc
python3 -m http.server

Browse on localhost:8000.

cc @BewareMyPower @merlimat @shibd

@tisonkun
Copy link
Member Author

tisonkun commented Nov 4, 2022

Screen.Recording.2022-11-04.at.23.02.29.-.Compressed.with.FlexClip.mp4

@tisonkun
Copy link
Member Author

tisonkun commented Nov 4, 2022

The major motivation is that the style of pdoc is out of materialized and I suspect it provides worse reading experience.

An alternative is to replace pdoc with pdoc3:

pip3 install pdoc3
pdoc --html -o $(pwd)/apidoc --config "lunr_search={}" pulsar

image

But still, we should update several syntax errors. BTW, pdoc3 is a malicious fork of pdoc and IMO Apache basically discourages malicious fork and I'd try to avoid use it as possible.

Signed-off-by: tison <[email protected]>
Copy link
Contributor

@merlimat merlimat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 👍

@merlimat merlimat added this to the 3.0.0 milestone Nov 4, 2022
@merlimat merlimat added the documentation Improvements or additions to documentation label Nov 4, 2022
Signed-off-by: tison <[email protected]>
Copy link
Contributor

@BewareMyPower BewareMyPower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a instruction for how to generate the preview into README?

Signed-off-by: tison <[email protected]>
Signed-off-by: tison <[email protected]>
@tisonkun
Copy link
Member Author

tisonkun commented Nov 5, 2022

@BewareMyPower Thanks for your comments. Updated.

@BewareMyPower BewareMyPower merged commit 75a57b4 into apache:main Nov 6, 2022
@tisonkun tisonkun deleted the pydoctor branch November 6, 2022 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants