-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
Index of documented modules #101
Comments
I think it's safe to just generate the index.html always, why not? Didn't think of that in #55. 👍 Besides the index file, why not list all top-level, disjunct packages/modules specified on a single command line also in the sidebar below the members list? Pass the modules as |
I'd be hesitant to turn this feature on by default. For my own use case, my docs automation would break if we made this the default. I'm sure others would experience similar problems. Also, if we make this feature opt-in, we can do nice things like enabling the module breadcrumbs that show up when users are running in That feature wouldn't make sense for users who aren't going to be using the root I'll open a WIP PR to show you what I've got so far and what I'm thinking. |
I'm hesitant adding command line flags for little used features. What do you need the index for and how often? Couldn't a simple shell script, iterating over the same packages specified on the command line, do the job? packages="package1 package2 package3"
for pkg in $packages; do echo "<a href='$pkg'>$pkg</a><br>" >> index.html; done What if the index were only created if the user specifies more than one package? |
I think, rather in factly, that a proper index is indeed in order, spanning hierarchically all the way to leaf modules. Created always. What users specify as |
--html
output as top-level index.html
Exactly! Maybe without leading dots and more uniformly indented. Maybe with children also not necessarily exactly in the right grid column but somewhere in the middle. |
👍
That's straightforward enough if we style the tree as a table instead of using flexbox. With those points, it looks more like this:
I'm having trouble picturing how this would look while keeping the uniform indentation. Can you show me an example of something similar to what you're expecting here? If conserving space is your main concern, instead of showing the docstring glimpse for each submodule like I have above, we could show the top level modules like normal, and then under the description for each, we could show a more compact submodule tree without the docstrings rendered. |
No, no, I meant uniform per nesting level, as in your last image already. 👍 Just the margin is maybe a bit large here. Do subsequent |
Yes. As I understad, it should be a whole new Let me give out a few options so we have something more concrete to talk about: A) This is if I reduce the margins a bit, but keep the styling like I had in my last example B) This is if I only indent the module docstring away from the module name C) This is with the default D) This is it as nested Are any of these closer to what you're picturing? |
Please excuse my slowness to respond. I get too little productive screen time these days. I like A, C, and D. I worry D only looks good in this example, with single-line descriptions. Surprisingly, I quite like C too. A or C, your call. 👍 |
@rjmill Have you been successfully dissuaded from contributing even what you already have? 😅 |
so... from #104 I could pick it up during the weekend... though I'm not clear as to which changes should be implemented from there |
IIRC, this basically, without a new CLI switch. Of the proposed layouts, I like C and it's in line with dl/dt/dd use elsewhere. |
Hi ! Longing for this feature too, it's not clear why #104 was closed ? From the discussion, it seems it was ready to merge ? I very quickly tried to fix merge conflicts (see https://github.com/olivierdalang/pdoc/tree/rjmill/implement-static-html-index). It seems to run without errors and to generate an index as expected, albeit only showing the top levels modules (not the submodules as in the examples above). @pwoolvett If you're still willing to pick that up, you could probably start from there ? |
The PR has been discussed in the issue here, then closed for inactivity, I guess. It would maybe make sense to incorporate @jkbecker's extra file idea from #301 (comment). |
I opened a ticket, but then found this here (exactly my problem) (#305) I'm fine with the current behaviour, except there is a missing link for multi project documentations. I would expect a base
That's all. I do not care, where this can be configured, maybe as config parameter like we use This can even make sense for single package documentations, where one wants to add some introduction page before entering the package itself. |
Hi, |
Maybe something like #104 (or a new template) could be shaped into use. I agree with @Kaiser1989's points above. I guess let's see a PR. Note, the current workaround for readme inclusion (for single packages) is via |
Any update on this? |
ping :) |
FWIW, this is a workaround that we have ended up using in CI:
"""
workaround for https://github.com/pdoc3/pdoc/issues/101#issuecomment-526957342
extracted from pdoc's cli.py
"""
import inspect
from pdoc import import_module, _render_template
modules = [
import_module(module, reload=True)
for module in ('PKG_A', 'PKG_B')
]
with open('html/index.html', 'w', encoding='utf-8') as index:
index.write(
_render_template(
'/html.mako',
modules=sorted((module.__name__, inspect.getdoc(module)) for module in modules)
)
) and in the workflow file:
|
Stitched the below function to get things going.
|
Expected Behavior
A way to include the
--http
mode's "Python module list"index.html
as the rootindex.html
of the--html
output.Actual Behavior
By default, there is no
index.html
at the top level of the HTML output. There doesn't seem to be a way to enable the "Python module list" in the static html output.Steps to Reproduce
pdoc --html [some modules]
./html/index.html
Additional info
I'm happy to open a PR for this if it seems like a reasonable request. I'm imagining it as a command line flag to run in addition to
--html
. When present, pdoc would generate an index.html with the "Python module list" the same as the one generated inWebDoc.do_GET()
when path is"/"
The text was updated successfully, but these errors were encountered: