Skip to content

Commit

Permalink
Version control hopefully
Browse files Browse the repository at this point in the history
  • Loading branch information
tinmarr committed Feb 2, 2022
1 parent d381dd1 commit de09dcb
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 19 deletions.
10 changes: 3 additions & 7 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,15 @@

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SPHINXBUILD ?= sphinx-multiversion
SOURCEDIR = source
BUILDDIR = ./build
BUILDDIR = .
LIVEBUILDDIR = ./build/_html

.PHONY: save

save:
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -t $(ver)
@rm -rf $(ver)
@cp -r ./build/html/ ./$(ver)/
@echo "Saved $(ver) version"
@$(SPHINXBUILD) "$(SOURCEDIR)" "$(BUILDDIR)"

live:
@sphinx-autobuild "$(SOURCEDIR)" "$(LIVEBUILDDIR)" $(SPHINXOPTS) $(O) --watch ../rubato
Expand Down
3 changes: 3 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ Babel==2.9.1
beautifulsoup4==4.10.0
certifi==2021.10.8
charset-normalizer==2.0.10
click==8.0.3
colorama==0.4.4
colorclass==2.2.2
dnspython==2.1.0
docopt==0.6.2
docutils==0.17.1
Expand Down Expand Up @@ -40,6 +42,7 @@ Sphinx==4.4.0
sphinx-autobuild==2021.3.14
sphinx-autodoc-typehints==1.16.0
sphinx-copybutton==0.4.0
sphinx-multiversion==0.2.4
sphinx-sitemap==2.2.0
sphinx_inline_tabs==2022.1.2b11
sphinxcontrib-applehelp==1.0.2
Expand Down
11 changes: 11 additions & 0 deletions docs/source/_templates/page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{% extends "!page.html" %} {% block content %} {% if current_version and latest_version and current_version != latest_version %}

<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>
{% if current_version.is_released %} You're reading an old version of this documentation. If you want up-to-date information, please have a look at
<a href="{{ vpathto(latest_version.name) }}">{{latest_version.name}}</a>. {% else %} You're reading the documentation for a development version. For the latest released version, please have a
look at <a href="{{ vpathto(latest_version.name) }}">{{latest_version.name}}</a>. {% endif %}
</p>
</div>
{% endif %} {{ super() }} {% endblock %}
16 changes: 16 additions & 0 deletions docs/source/_templates/versioning.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{% if versions %}
<div class="sidebar-tree">
<p class="caption" role="heading"><span class="caption-text">{{ _('Releases') }}</span></p>
<ul>
{%- for item in versions.releases %}
<li class="toctree-l1"><a class="reference internal" href="{{ item.url }}">{{ item.name }}</a></li>
{%- endfor %}
</ul>
<p class="caption" role="heading"><span class="caption-text">{{ _('In Development') }}</span></p>
<ul>
{%- for item in versions.in_development %}
<li class="toctree-l1"><a class="reference internal" href="{{ item.url }}">{{ item.name }}</a></li>
{%- endfor %}
</ul>
</div>
{% endif %}
27 changes: 15 additions & 12 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# -- Project information -----------------------------------------------------

project = "Rubato"
cpyright = "2022, Martin Chaperot, Tomer Sedan, Yamm Elnekave"
copyright = "2022, Martin Chaperot, Tomer Sedan, Yamm Elnekave" # pylint: disable=redefined-builtin
author = "Martin Chaperot, Tomer Sedan, Yamm Elnekave"

# The full version, including alpha/beta/rc tags
Expand All @@ -43,11 +43,23 @@
"sphinx_autodoc_typehints", # This need to be after napoleon
"sphinx.ext.todo",
"sphinx_sitemap",
"sphinx_multiversion",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

html_sidebars = {
"**": [
"sidebar/scroll-start.html",
"sidebar/brand.html",
"sidebar/search.html",
"sidebar/navigation.html",
"versioning.html",
"sidebar/scroll-end.html",
],
}

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
Expand Down Expand Up @@ -115,15 +127,6 @@
ogp_description_length = 300
ogp_image = "_static/logo_long.png"

rst_prolog = """
.. only:: dev
.. caution::
| You are currently looking at the dev version of the docs.
| Click `here <https://tinmarr.github.io/rubato/stable>`_ to return the stable version.
"""

rst_epilog = """
.. |default| replace:: :ref:`default config <defaults>`
"""
Expand Down Expand Up @@ -155,5 +158,5 @@
}
napoleon_attr_annotations = True

# TODOs
todo_include_todos = True
# Version Control
smv_branch_whitelist = r"^(main).*$"

0 comments on commit de09dcb

Please sign in to comment.