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

Use shortened submodule names by default #374

Closed
jacksund opened this issue Apr 8, 2022 · 2 comments · Fixed by #379
Closed

Use shortened submodule names by default #374

jacksund opened this issue Apr 8, 2022 · 2 comments · Fixed by #379

Comments

@jacksund
Copy link
Contributor

jacksund commented Apr 8, 2022

Problem Description

For packages that have long or verbose import names, the html sidebar can become difficult to read for lower-level modules.

A live example of this is with some documentation in my own package (see here, the "Submodules" list in the sidebar is difficult to read).

Proposal

Regardless of the length for full import path, the submodule list can be clear with just a terminal ending. I suggest pdoc uses the submodule name in the sidebar, rather than the full import path.

As arbitrary example, and sidebar link such as ...

example.path.to.my.submodule1

... would be changed to ...

submodule1

Alternatives

But for those that still want the full path visible, an option to incorporate this might be worth considering. Alternatively, the Submodule heading in the html could also list a subheader with the full import path such as...

<div>

    <h2>Submodules</h3>
    <h4>path.to.parent.module</h4>
    
     <!-- then iterate through submodule list per usual -->
     <p>submodule1</p>
     <p>submodule2</p>

</div>

Additional context

I know my import paths can be shortened (e.g. changing base_data_types to base), but I keep them verbose to help with my users -- which have typically never coded or used python before. So this feature change would be super helpful to my project!

@mhils
Copy link
Member

mhils commented Apr 8, 2022

I think your rationale makes a ton of sense, thanks for the suggestion. :) Do you want to send a PR?

@jacksund
Copy link
Contributor Author

jacksund commented Apr 8, 2022

Sure, I can take a stab at it. I'm wrapping up for the day, but will open a pull-request for this tomorrow. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants