Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Module prefix in navigation bar #277

Unanswered
gautierronan asked this question in Q&A
Discussion options

Hello! I would like to add the module name in front of function names in the navigation bar, similar to what the numpy API reference does (see e.g. the navigation of numpy.linalg.eig). So instead of having only eig in the navigation bar, they have numpy.linalg.eig.

My particular documentation based on mkdocs-material + mkdocstrings-python is here, see for instance our function dq.plot.wigner. I have already hacked around to add the dq.plot prefix in front of wigner in the article title, but I'm not able to add it to the navigation bar (nor to the search bar actually). Any way I could achieve this? Thanks.

You must be logged in to vote

Replies: 1 comment 6 replies

Comment options

We always use short names in the navigation bar, as there's not a lot of width available, but I'm open to a feature request asking for a configuration option 🙂

You must be logged in to vote
6 replies
Comment options

You'd add a new show_nav_full_path option in the config.pymodule (next to the other similar boolean options). Then you'd use this option in the templates where relevant (inheading` filters typically). Finally you'd document this new option in the headings configuration page, probably (options are ordered alphabetically) 🙂

Comment options

About the search bar, I'm not sure what you mean, could you elaborate?

Comment options

I would like to full path to appear in the search bar too.

Taking the example of my library, I have two separate functions with the same name but in different modules: dq.wigner, and dq.plot.wigner. When searching for "wigner", both appear under the same name and there's no way to differentiate.

See the screenshot below, with the last two pages:

Screenshot 2025年05月14日 at 15 22 01
Comment options

Note that even numpy has such duplicate namings in different modules, for instance:

Or:

which would all appear under the name "real" when searching with mkdocs.

Comment options

We don't have control over the search bar (which comes from the MkDocs theme in use), but you could display the full object paths in the headings, and the search bar would pick them up. You're looking at the show_object_full_path: true option 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /