-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docs: switch to
sphinx-book-theme
from pydata_sphinx_theme
The main reason for the switch is to have access to theme-specific elements like margin notes. Another major change compared to `pydata_sphinx_theme` is the absence of a top-level header, which has us move the contents overview into the sidebar. This has the advantage that the user immediately has a bird's eye glance of the documentation contents. Until the documentation becomes larger, this approach is preferable. Several changes are made to the sidebar: 1. Override the default `icon-links.html` component to include an AiiDA icon that links to the AiiDA website. 2. Override the `sbt-sidebar-nav.thml` component to adapt the default maxdepth. 3. A logo is added for dark mode. Some other additions and tweaks: 1. Added badged to the landing page instead of the release version. 2. Adapt the sidebar `toctree` to include captions and point directly to some subsections. 3. The Python API now has a `toctree` element with a clear name, and the `maxdepth` is adapted to make it more readable. 4. Several panels on the landing page are removed, since the corresponding top-level sections are no longer part of the `toctree`. This also makes the remaining panels to the `Get started` and tutorial sections more prominent. Finally, the `intersphinx_mapping` to the `aiida-core` docs is fixed, along with several broken references, mostly in the Hubbard docstring. The `pydantic` and `typing` related intersphinx warnings are ignored using `nitpick_ignore_regex`, since pydantic doesn't use `sphinx` and there seem to be issues with referencing `typing` classes.
- Loading branch information
Showing
19 changed files
with
167 additions
and
235 deletions.
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
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
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
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,40 @@ | ||
{%- macro icon_link_nav_item(url, icon, name, type, attributes='') -%} | ||
{%- if url | length > 2 %} | ||
<li class="nav-item"> | ||
{%- set attributesDefault = { "href": url, "title": name, "class": "nav-link", "rel": "noopener", "target": "_blank", "data-bs-toggle": "tooltip", "data-bs-placement": "bottom"} %} | ||
{%- if attributes %}{% for key, val in attributes.items() %} | ||
{% set _ = attributesDefault.update(attributes) %} | ||
{% endfor %}{% endif -%} | ||
{% set attributeString = [] %} | ||
{% for key, val in attributesDefault.items() %} | ||
{%- set _ = attributeString.append('%s="%s"' % (key, val)) %} | ||
{% endfor %} | ||
{% set attributeString = attributeString | join(" ") -%} | ||
<a {{ attributeString }}> | ||
{%- if type == "fontawesome" -%} | ||
<span><i class="{{ icon }} fa-lg" aria-hidden="true"></i></span> | ||
<span class="sr-only">{{ name }}</span> | ||
{%- elif type == "local" -%} | ||
<img src="{{ pathto(icon, 1) }}" class="icon-link-image" alt="{{ name }}"/> | ||
{%- elif type == "url" -%} | ||
<img src="{{ icon }}" class="icon-link-image" alt="{{ name }}"/> | ||
{%- else %} | ||
<span>Incorrectly configured icon link. Type must be `fontawesome`, `url` or `local`.</span> | ||
{%- endif -%} | ||
</a> | ||
</li> | ||
{%- endif -%} | ||
{%- endmacro -%} | ||
{%- if theme_icon_links -%} | ||
<ul class="navbar-icon-links navbar-nav" | ||
aria-label="{{ theme_icon_links_label }}"> | ||
<li class="nav-item"> | ||
<a href="https://aiida.net/"> | ||
<img src="{{ pathto('_static/logo_aiida.svg', 1) }}" alt="AiiDA" class="aiida-logo"> | ||
</a> | ||
</li> | ||
{%- for icon_link in theme_icon_links -%} | ||
{{ icon_link_nav_item(icon_link["url"], icon_link["icon"], icon_link["name"], icon_link.get("type", "fontawesome"), icon_link.get("attributes", {})) -}} | ||
{%- endfor %} | ||
</ul> | ||
{%- 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<nav class="bd-links" id="bd-docs-nav" aria-label="Main"> | ||
<div class="bd-toc-item navbar-nav active"> | ||
{% if theme_home_page_in_toc == True %} | ||
{#- This mimicks the pydata theme list style so we can append an extra item at the top #} | ||
<ul class="nav bd-sidenav bd-sidenav__home-link"> | ||
<li class="toctree-l1{% if pagename == root_doc %} current active{% endif %}"> | ||
<a class="reference internal" href="{{ pathto(root_doc) }}"> | ||
{{ root_title }} | ||
</a> | ||
</li> | ||
</ul> | ||
{% endif -%} | ||
|
||
{# Ref: https://github.com/pydata/pydata-sphinx-theme/blob/ebf7f704879a1cdc6016d6111062103353ac7677/src/pydata_sphinx_theme/__init__.py#L302 #} | ||
{{- generate_toctree_html( | ||
startdepth=0, | ||
kind="sidebar", | ||
maxdepth=2, | ||
collapse=False, | ||
includehidden=True, | ||
titles_only=True, | ||
show_nav_level=theme_show_navbar_depth) }} | ||
</div> | ||
</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 was deleted.
Oops, something went wrong.
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,6 +1,6 @@ | ||
(howto-workflows)= | ||
|
||
# How-to run workflows | ||
# Workflows | ||
|
||
```{toctree} | ||
:maxdepth: 1 | ||
|
Oops, something went wrong.