Skip to content
This repository was archived by the owner on Apr 22, 2024. It is now read-only.

Commit d21cab3

Browse files
committed
Add dropdown button into navbar.html
Add dropdown button into navbar.html and create make versions to make all python-openflow releases
1 parent 848b698 commit d21cab3

4 files changed

Lines changed: 33 additions & 0 deletions

File tree

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Added
1212
Changed
1313
=======
1414
- Raise ValueError if not using bytes (e.g. string) in BinaryData.
15+
- Changed docs to show a dropdown button with all python-openflow releases.
1516

1617
Deprecated
1718
==========

docs/Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ SPHINXOPTS =
66
SPHINXBUILD = sphinx-build
77
PAPER =
88
BUILDDIR = _build
9+
VERSIONS = master,bethania
10+
MAIN_REF = bethania
911

1012
# User-friendly check for sphinx-build
1113
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
@@ -53,6 +55,17 @@ help:
5355
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
5456
@echo " coverage to run coverage check of the documentation (if enabled)"
5557
@echo " dummy to check syntax errors of document sources"
58+
@echo " versions to make all docs HTML files"
59+
60+
.PHONY: versions
61+
versions:
62+
rm python-openflow -rf && mkdir python-openflow
63+
for version in `echo $(VERSIONS) | sed 's/,/ /g'`; do \
64+
git checkout $$version \
65+
&& make SPHINXOPTS="-A versions=\"$(VERSIONS)\" -A current_version=\"$$version\"" \
66+
&& mv _build/dirhtml python-openflow/$$version; \
67+
done
68+
cp python-openflow/$(MAIN_REF)/* python-openflow/ -R
5669

5770
.PHONY: clean
5871
clean:

docs/_static/css/kytos.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616
background: #68286a;
1717
}
1818

19+
.navbar-kytos #dropdown-versions {
20+
background-color: #322c5d;
21+
border-color: #4D4778;
22+
margin-top: 3%;
23+
margin-left: 4%;
24+
}
25+
1926
.navbar-kytos .navbar-brand {
2027
-webkit-transition: all .3s;
2128
-moz-transition: all .3s;

docs/_templates/navbar.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@
1818
</div>
1919

2020
<div class="collapse navbar-collapse nav-collapse">
21+
{% if versions %}
22+
<div class="dropdown pull-right">
23+
<button id="dropdown-versions" class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown"> {{ current_version }}
24+
<span class="caret"></span></button>
25+
<ul class="dropdown-menu">
26+
{%- for version in versions.split(',') %}
27+
<li><a href="/python-openflow/{{version}}">{{ version }}</a></li>
28+
{%- endfor %}
29+
</ul>
30+
</div>
31+
{% endif %}
32+
2133
{% block navbarsearch %}
2234
{% include "navbarsearchbox.html" %}
2335
{% endblock %}

0 commit comments

Comments
 (0)