Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upimprove failure modes for failed imports #91
Comments
This comment has been minimized.
This comment has been minimized.
|
It's hard to say without knowing the structure of If you'd like to force the issue, you might try passing |
This comment has been minimized.
This comment has been minimized.
|
I tried with Actually sorting is a package and not a module, so I don't understand why the produced html's title says "module" after "sorting". Anyway, the idea is that I would like to automate the creation of the documentation recursively, so that I don't have to do it manually for every package or module or subpackage or submodule. I think that if this feature is not present, it would be really nice to add it. Based on the Python's project, i.e. by specifying a |
This comment has been minimized.
This comment has been minimized.
|
@Dossan That is what happens. Look at the source code: https://github.com/BurntSushi/pdoc/blob/master/pdoc/__init__.py#L598-L614 It's hard for me to help you further because I don't have a reproducible example. If I had that, I might be able to tell you exactly what's wrong. |
This comment has been minimized.
This comment has been minimized.
|
@BurntSushi Ok, so this is my project structure: I am inside a folder (which is also a package) called
As I said in the question, I am using the following command from the terminal (I repeat inside
or
(both produce the same thing) Again, what's produced is a folder inside Thanks for any help! |
This comment has been minimized.
This comment has been minimized.
|
It's working fine for me here.
Note that The next step is to probably show code in your Python files. |
This comment has been minimized.
This comment has been minimized.
|
@BurntSushi I have just done a commit and push to the github repo here: You find |
This comment has been minimized.
This comment has been minimized.
|
I was able to reproduce your issue. TL;DR - The exact circumstances that cause The problem, as I identified it, was that (for example) (pdoc) [andrew@Serval algorithms] cat sys-path
#!/usr/bin/env python
import sys
print(sys.path)Executing this in your (pdoc) [andrew@Serval algorithms] ./sys-path
['/tmp/ands/algorithms', '/tmp/pdoc', '/home/andrew/src/python/virts/pdoc/lib/python35.zip', '/home/andrew/src/python/virts/pdoc/lib/python3.5', '/home/andrew/src/python/virts/pdoc/lib/python3.5/plat-linux', '/home/andrew/src/python/virts/pdoc/lib/python3.5/lib-dynload', '/usr/lib64/python3.5', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-linux', '/home/andrew/src/python/virts/pdoc/lib/python3.5/site-packages']I then copied (pdoc) [andrew@Serval algorithms] cp ./sys-path ~/src/python/virts/pdoc/bin/
(pdoc) [andrew@Serval algorithms] /home/andrew/src/python/virts/pdoc/bin/sys-path
['/home/andrew/src/python/virts/pdoc/bin', '/tmp/pdoc', '/home/andrew/src/python/virts/pdoc/lib/python35.zip', '/home/andrew/src/python/virts/pdoc/lib/python3.5', '/home/andrew/src/python/virts/pdoc/lib/python3.5/plat-linux', '/home/andrew/src/python/virts/pdoc/lib/python3.5/lib-dynload', '/usr/lib64/python3.5', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-linux', '/home/andrew/src/python/virts/pdoc/lib/python3.5/site-packages']Note the changed Setting (pdoc) [andrew@Serval algorithms] pdoc --overwrite --html --html-dir docs sorting
(pdoc) [andrew@Serval algorithms] tree docs/
docs/
└── sorting
└── index.html
1 directory, 1 file
(pdoc) [andrew@Serval algorithms] PYTHONPATH=. pdoc --overwrite --html --html-dir docs sorting
(pdoc) [andrew@Serval algorithms] tree docs
docs
└── sorting
├── bubblesort.m.html
├── heapsort.m.html
├── index.html
├── insertionsort.m.html
├── mergesort.m.html
├── quicksort.m.html
├── selectionsort.m.html
└── util.m.html
1 directory, 8 filesI note that these issues are trivially avoided if you use an idiomatic Python project structure. In this case, that would mean having a The major failing of As such, I've modified your issue title to address the bad failure mode. Thanks! |

nbro commentedFeb 3, 2016
I am trying to generate all at once the docs for a project, which contains some packages and subpackages, with modules, and so on. For example, I have a package called
sorting, and I would like to generate recursively docs for it and for its modules or subpackages.Currently I tried:
But it produces an empty file, apparently only for the package itself
sorting. Any ideas on how to produce recursively the docs for a whole project? I have seen other issues, but not sure if they are talking about the same thing. Of course I could create a script to do it for me, but ifpdocalready provides it, it would be nice.