Skip to content

Improve apidoc with pydoctor tool - #28

Merged
BewareMyPower merged 12 commits into
apache:mainfrom
tisonkun:pydoctor
Nov 6, 2022
Merged

BewareMyPower merged 12 commits into
apache:mainfrom
tisonkun:pydoctor

Conversation

@tisonkun

@tisonkun tisonkun commented Nov 4, 2022 •

Copy link
Copy Markdown
Member

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

tisonkun commented Nov 4, 2022

Copy link
Copy Markdown
Member Author
Screen.Recording.2022-11-04.at.23.02.29.-.Compressed.with.FlexClip.mp4

@tisonkun

tisonkun commented Nov 4, 2022 •

Copy link
Copy Markdown
Member Author

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]>

@merlimat merlimat left a comment

Copy link
Copy Markdown
Contributor

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]>

@BewareMyPower BewareMyPower left a comment

Copy link
Copy Markdown
Contributor

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

tisonkun commented Nov 5, 2022

Copy link
Copy Markdown
Member Author

@BewareMyPower Thanks for your comments. Updated.

Comment thread README.md Resolved
@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