Skip to content
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

select modules to include in index #56

Closed
hyukim17 opened this issue Jul 14, 2015 · 9 comments

Comments

Projects
None yet
4 participants
@hyukim17
Copy link

commented Jul 14, 2015

The default html server index, in Python module list, includes all available Python modules. Is there a way to restrict which modules show up here?

@BurntSushi

This comment has been minimized.

Copy link
Contributor

commented Jul 14, 2015

Yes. Pass the --only-pypath option to pdoc and set your PYTHONPATH environment variable to point to the packages you want documented.

@hyukim17

This comment has been minimized.

Copy link
Author

commented Jul 14, 2015

Got it. I am creating a temporary environment, overwriting PYTHONPATH, and running pdoc within that environment.

@hyukim17 hyukim17 closed this Jul 14, 2015

@hyukim17

This comment has been minimized.

Copy link
Author

commented Jul 14, 2015

Is there a way to exclude certain modules?

@hyukim17 hyukim17 reopened this Jul 14, 2015

@BurntSushi

This comment has been minimized.

Copy link
Contributor

commented Jul 14, 2015

Yes. Don't put them in your PYTHONPATH.

@hyukim17

This comment has been minimized.

Copy link
Author

commented Jul 14, 2015

What I mean is, what if a folder contains multiple modules?

@BurntSushi

This comment has been minimized.

Copy link
Contributor

commented Jul 14, 2015

Ah. There is no specific command line flag to hide modules. The standard mode of operating is to have an entry in PYTHONPATH for each module you want to document. This implies that there is a single module in each of those directories. This works well in practice as a convention because it corresponds precisely to an idiomatic Python package (which usually contains at most one direct sub-directory with an __init__.py file).

@hyukim17

This comment has been minimized.

Copy link
Author

commented Jul 14, 2015

ok, understood, I guess it makes more sense for me to clean up my directory structure

@hyukim17 hyukim17 closed this Jul 14, 2015

@gvvka0327

This comment has been minimized.

Copy link

commented Nov 6, 2015

I tried the suggest to put the modules I want to show up, in PYTHONPATH; no output on the html page

-bash-4.1$ echo $PYTHONPATH
/users/test/system-test/lib

pdoc --http --http-host= --only-pypath

@r2ad

This comment has been minimized.

Copy link

commented Nov 8, 2018

This worked well for me:

#!/bin/bash
PYTHONPATH=`pwd`
export PYTHONPATH
pdoc --http --only-pypath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.