-
Notifications
You must be signed in to change notification settings - Fork 320
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
ENH: adding sphinx sidebars functionality #248
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
cc552c0
adding sphinx sidebars functionality
choldgraf 7c2fe02
comments
choldgraf 92ec3ff
renames
choldgraf f9f915a
Merge branch 'master' into custom_sidebars
choldgraf 8019eca
rename template files
jorisvandenbossche 05e568c
fixup merge
jorisvandenbossche File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div class="sidebar-message"> | ||
This is a community-supported theme. | ||
If you'd like to contribute, | ||
<a href="https://github.com/pandas-dev/pydata-sphinx-theme">check out our GitHub repository</a> | ||
Your contributions are welcome! | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation"> | ||
|
||
<div class="bd-toc-item active"> | ||
{% set nav = get_nav_object(maxdepth=3, collapse=True) %} | ||
|
||
<ul class="nav bd-sidenav"> | ||
{% for main_nav_item in nav %} | ||
{% if main_nav_item.active %} | ||
{% for nav_item in main_nav_item.children %} | ||
{% if nav_item.children %} | ||
|
||
<li class="{% if nav_item.active%}active{% endif %}"> | ||
<a href="{{ nav_item.url }}">{{ nav_item.title }}</a> | ||
<ul> | ||
{% for nav_item in nav_item.children %} | ||
<li class="{% if nav_item.active%}active{% endif %}"> | ||
<a href="{{ nav_item.url }}">{{ nav_item.title }}</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</li> | ||
{% else %} | ||
<li class="{% if nav_item.active%}active{% endif %}"> | ||
<a href="{{ nav_item.url }}">{{ nav_item.title }}</a> | ||
</li> | ||
{% endif %} | ||
{% endfor %} | ||
{% endif %} | ||
{% endfor %} | ||
</ul> | ||
|
||
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{% if theme_search_bar_position == "sidebar" %} | ||
{%- include "search-field.html" %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +0,0 @@ | ||
|
||
|
||
{% if theme_search_bar_position == "sidebar" %} | ||
{%- include "search-field.html" %} | ||
{% endif %} | ||
|
||
<nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation"> | ||
|
||
<div class="bd-toc-item active"> | ||
{% set nav = get_nav_object(maxdepth=3, collapse=True) %} | ||
|
||
<ul class="nav bd-sidenav"> | ||
{% for main_nav_item in nav %} | ||
{% if main_nav_item.active %} | ||
{% for nav_item in main_nav_item.children %} | ||
{% if nav_item.children %} | ||
|
||
<li class="{% if nav_item.active%}active{% endif %}"> | ||
<a href="{{ nav_item.url }}">{{ nav_item.title }}</a> | ||
<ul> | ||
{% for nav_item in nav_item.children %} | ||
<li class="{% if nav_item.active%}active{% endif %}"> | ||
<a href="{{ nav_item.url }}">{{ nav_item.title }}</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</li> | ||
{% else %} | ||
<li class="{% if nav_item.active%}active{% endif %}"> | ||
<a href="{{ nav_item.url }}">{{ nav_item.title }}</a> | ||
</li> | ||
{% endif %} | ||
{% endfor %} | ||
{% endif %} | ||
{% endfor %} | ||
</ul> | ||
|
||
</nav> | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just wondering about this one: is there some documentation in sphinx that this is the recommended way to add custom templates as a package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm, well it's documented in a way that suggests you could add to it to increase the search scope for templates: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-templates_path
and it seems this is how Sphinx adds templates in its own codebase, e.g.: https://github.com/sphinx-doc/sphinx/blob/cc25bac26445688c50efb9b8d5f30571940e27bd/sphinx/ext/autosummary/generate.py#L644
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that's how they do it for the built-in extensions, that's certainly fine!