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

Add breadcrumb navigation #680

Open
pradyunsg opened this issue Jul 15, 2023 Discussed in #139 · 3 comments · May be fixed by #843
Open

Add breadcrumb navigation #680

pradyunsg opened this issue Jul 15, 2023 Discussed in #139 · 3 comments · May be fixed by #843
Labels
enhancement New feature or request

Comments

@pradyunsg
Copy link
Owner

Discussed in #139

@pradyunsg pradyunsg added the enhancement New feature or request label Jul 15, 2023
@nineteendo nineteendo linked a pull request Oct 4, 2024 that will close this issue
@bgmeulem
Copy link

bgmeulem commented Oct 15, 2024

I'm starting out with sphinx and custom theming, so I don't feel comfortable filing a PR yet, but this can be achieved with custom templates using something like below.

{% set parent_module = obj.id.split('.')[:-1] | join('.') | escape %}

.. breadcrumb:

{% if parent_module %}
Back to :mod:`{{ parent_module }}`
{% endif %}

.. title:

{{ obj.short_name }}
{{ "=" * obj.short_name | length }}

@pmichaud
Copy link

I'm starting out with sphinx and custom theming, so I don't feel comfortable filing a PR yet, but this can be achieved with custom templates using something like below.

{% set parent_module = obj.id.split('.')[:-1] | join('.') | escape %}

.. breadcrumb:

{% if parent_module %}
Back to :mod:`{{ parent_module }}`
{% endif %}

.. title:

{{ obj.short_name }}
{{ "=" * obj.short_name | length }}

I'm also new to Sphinx and to theming -- where would the above go to make it work...?

Pm

@bgmeulem
Copy link

Hiya

these would go in the Jinja templates. Which templates that are used depend on your extensions. i use sphinx-autoapi as I like it a lot more than autosummary. You can set up your documentation to use custom templates in your conf.py file, but the exact setup again depends on whether you use e.g. sphinx-autoapi or autosummary...
I followed this post to set up my sphinx-autoapi generated documentation with furo: https://bylr.info/articles/2022/05/10/api-doc-with-sphinx-autoapi/#basic-macro-setup

This has nothing to do with furo though, and I see there is an open PR that may achieve the same thing entirely. Maybe it's also worth simply waiting for the PR to be merged.

Cheers
Bjorge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants