Skip to content

Commit

Permalink
Merged fixes for warning
Browse files Browse the repository at this point in the history
- Removed unused files
- Removed include to deleted files
  • Loading branch information
WAEliasmith committed Aug 25, 2020
2 parents cae7eb7 + d523718 commit afad76c
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 30 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ env:
- SCRIPT="test"
- TEST_ARGS=""
- BRANCH_NAME="${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}"
- PIP_USE_FEATURE="2020-resolver"

jobs:
include:
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Release History

- Swapped position of "search" and "version" boxes (so search is at the top
and version is at the bottom). (`#58`_)
- Added notification when viewing the development version of docs. (`#62`_)

**Fixed**

Expand All @@ -40,6 +41,7 @@ Release History

.. _#58: https://github.com/nengo/nengo-sphinx-theme/pull/58
.. _#59: https://github.com/nengo/nengo-sphinx-theme/pull/59
.. _#62: https://github.com/nengo/nengo-sphinx-theme/pull/62

1.2.2 (April 14, 2020)
======================
Expand Down
4 changes: 4 additions & 0 deletions nengo_sphinx_theme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ def sort_versions(releases):
releases.sort(key=parse_version, reverse=True)
return releases

def to_root(pagename):
return "../" * pagename.count("/")

if app.builder.format == "html":
app.builder.templates.environment.filters["sort_versions"] = sort_versions
app.builder.templates.environment.filters["to_root"] = to_root

app.connect("builder-inited", add_jinja_filters)
15 changes: 12 additions & 3 deletions nengo_sphinx_theme/theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,18 @@
<div class="container">
<div class="row">
<div class="col-10 offset-1 pb-5 documentation-source" role="main">
{% if building_version == "latest" %}
{%- include "unstable_warning.html" %}
{% endif %}
{% if building_version == "latest" and releases %}
{% set stable = releases | sort_versions | first %}
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>
This documentation is for a development version.
<a href="{{ pagename | to_root }}{{ stable }}/{{ pagename }}.html">
Click here for the latest stable release ({{ stable }}).
</a>
</p>
</div>
{% endif %}
{% block body %} {% endblock %}
</div>
</div>
Expand Down
23 changes: 13 additions & 10 deletions nengo_sphinx_theme/theme/navbar.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{% set projects = [
("Nengo Core", "https://www.nengo.ai/nengo/"),
("Nengo GUI", "https://github.com/nengo/nengo-gui/"),
("Nengo DL", "https://www.nengo.ai/nengo-dl/"),
("Nengo core", "https://www.nengo.ai/nengo/"),
("NengoGUI", "https://github.com/nengo/nengo-gui/"),
("NengoDL", "https://www.nengo.ai/nengo-dl/"),
("divider", None),
("Nengo SPA", "https://www.nengo.ai/nengo-spa/"),
("Nengo Extras", "https://www.nengo.ai/nengo-extras/"),
("NengoSPA", "https://www.nengo.ai/nengo-spa/"),
("NengoExtras", "https://www.nengo.ai/nengo-extras/"),
("Nengolib", "https://arvoelke.github.io/nengolib-docs/"),
("divider", None),
("Nengo FPGA", "https://www.nengo.ai/nengo-fpga/"),
("Nengo Loihi", "https://www.nengo.ai/nengo-loihi/"),
("Nengo OpenCL", "https://github.com/nengo/nengo-ocl"),
("Nengo SpiNNaker", "https://github.com/project-rig/nengo_spinnaker"),
("Nengo MPI", "https://github.com/nengo/nengo-mpi"),
("NengoFPGA", "https://www.nengo.ai/nengo-fpga/"),
("NengoLoihi", "https://www.nengo.ai/nengo-loihi/"),
("NengoOCL", "https://github.com/nengo-labs/nengo-ocl"),
("NengoSpiNNaker", "https://github.com/project-rig/nengo_spinnaker"),
("NengoMPI", "https://github.com/nengo-labs/nengo-mpi"),
("divider", None),
("KerasSpiking", "https://www.nengo.ai/keras-spiking"),
("PyTorchSpiking", "https://www.nengo.ai/pytorch-spiking"),
] %}

<header class="fixed-top header-top shadow-sm">
Expand Down
6 changes: 1 addition & 5 deletions nengo_sphinx_theme/theme/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ <h3 class="pt-5 px-5">
<div class="form-group">
<label class="text-gray">Version:</label>
<select class="custom-select" onchange="switchVersion(this);">
{% set prefix = pagename
| list
| select("equalto", "/")
| map("replace", "/", "../")
| join("") %}
{% set prefix = pagename | to_root %}
{% if building_version == "latest" %}
<option selected>latest</option>
{% else %}
Expand Down
11 changes: 0 additions & 11 deletions nengo_sphinx_theme/theme/unstable_warning.html

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
requires = ["setuptools", "wheel"]

[tool.black]
target-version = ['py35', 'py36', 'py37']
target-version = ['py35', 'py36', 'py37', 'py38']

0 comments on commit afad76c

Please sign in to comment.