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

document a folder with several .py files #79

Closed
EliosMolina opened this issue Nov 15, 2015 · 8 comments

Comments

Projects
None yet
4 participants
@EliosMolina
Copy link

commented Nov 15, 2015

I have a folder with several .py scripts (no init.py file). I get a nice web documentation using:

$ PYTHONPATH=$dir pdoc --http --only-pypath

But I don't know how to save it into html files. Is there anyway to do it?

Thanks.

@gvvka0327

This comment has been minimized.

Copy link

commented Nov 18, 2015

pdoc generates html files and is saving them under /tmp/pdoc-2.7 folder... thatz what happened on my end...
do you have any idea if I want to only generate html files for the folder and not publish on HTTP server

@mikecharles

This comment has been minimized.

Copy link

commented Nov 18, 2015

If you run pdoc --help you'll see there's a --html-dir option for just that. Is that what you mean?

@gvvka0327

This comment has been minimized.

Copy link

commented Nov 18, 2015

I tried that like,

export PYTHONPATH=$dir
pdoc --html --only-pypath --html-dir=./api_folder

did'nt work... I want to generate html files for the folder and put it in --html-dir specified..

@mikecharles

This comment has been minimized.

Copy link

commented Nov 18, 2015

I think your options are:

Make $dir a package

touch $dir/__init__.py
PYTHONPATH=$dir/.. pdoc --html-dir=./api_folder --html --only-pypath $dir

Note that PYTHONPATH is set to the directory above $dir

Loop over Python scripts

for file in $dir/*.py ; do
    PYTHONPATH=$dir pdoc --html-dir ./test_api --html --only-pypath $file
done
@gvvka0327

This comment has been minimized.

Copy link

commented Nov 18, 2015

Getting error,

NameError: name 'all' is not defined

do we need to specify all in init.py file..

-Vijay

On Wed, Nov 18, 2015 at 1:53 PM, Mike Charles notifications@github.com
wrote:

I think your options are:
Make $dir a package

touch $dir/init.py
PYTHONPATH=$dir/.. pdoc --html-dir=./api_folder --html --only-pypath $dir

Note that PYTHONPATH is set to the directory above $dir
Loop over Python scripts

for file in $dir/*.py ; do
PYTHONPATH=$dir pdoc --html-dir ./test_api --html --only-pypath $file
done


Reply to this email directly or view it on GitHub
#79 (comment).

@mikecharles

This comment has been minimized.

Copy link

commented Nov 18, 2015

Which method did you try?

@gvvka0327

This comment has been minimized.

Copy link

commented Nov 20, 2015

PYTHONPATH=$dir/.. pdoc --html-dir=./api_folder --html --only-pypath $dir
ReTried this approach and it worked... thank you.

@mikecharles

This comment has been minimized.

Copy link

commented Nov 20, 2015

Glad it worked!

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.