pdoc3 programmatic-usage example
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 146
- PR merge metrics
- No merged PRs in 30d
Description
I am not a fluent Python programmer.
I mostly use standalone .py scripts, which sometimes call functions from other .py scripts.
But they are not structured into modules, projects or whatever.
I wonder if I still could use pdoc3 to generate .html doc files for some selected .py scripts in this context.
Do you have an example of how to use pdoc3 as a library for this purpose?
I have an script which works perfectly when using original pdoc package, but couldn't make it run with pdoc3.
Expected Behavior
Make pdoc3 produce html documentation for a bunch of .py files, the same way original pdoc package does.
Actual Behavior
My simple pdoc-based script fails. I need to adapt it.
I looked the programmatic-usage info in pdoc3 documentation but I find it over-complicated compared to the original pdoc programmatic usage example.
Can't understand all these Context(), link_inheritance(), html(), text() ... please tell me how to use them to adapt the following script to pdoc3:
Steps to Reproduce
- pip install pdoc3
- run this script:
# create_pdoc.py
import pdoc
from pathlib import Path
myscripts = ["./myscript.py", "./path2/myscript.py", "./myscript3.py"]
pdoc.pdoc(*myscripts, output_directory=Path("./_mypdoc3"))
- Result
c:\Python38\python create_pdoc.py
Traceback (most recent call last):
File "create_pdoc.py", line 4, in <module>
pdoc.pdoc(*myscripts, output_directory=Path("./_mypdoc3"))
AttributeError: module 'pdoc' has no attribute 'pdoc'
- Changed last line from
pdoc.pdoc(...)topdoc(...), and got this result:
Traceback (most recent call last):
File "create_pdoc.py", line 4, in <module>
pdoc(*myscripts, output_directory=Path("./_mypdoc3"))
TypeError: 'module' object is not callable
Additional info
- pdoc version:
pdoc.exe 0.10.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the pdoc3 programmatic-usage documentation and compare it with the original pdoc library example linked in the issue. Document a working pdoc3 equivalent for create_pdoc.py that handles the listed scripts and produces HTML output, then verify it against the reported pdoc 0.10.0 behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100