Generate docs for stable and develop

vite-ws-ssl-compatible
Georg Krause 2022-03-02 14:00:44 +01:00 zatwierdzone przez Georg Krause
rodzic 6587390750
commit bf85f41c72
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 2970D504B2183D22
4 zmienionych plików z 43 dodań i 6 usunięć

16
docs/_templates/layout.html vendored 100644
Wyświetl plik

@ -0,0 +1,16 @@
{% extends "!layout.html" %}
{% block document %}
{% if current_version.name == "develop" %}
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>This documentation only applies for the development version of
Funkwhale! <a href="{{ vpathto('stable') }}">Visit the docs for the latest
release.</a></p>
</div>
{% endif %}
{{ super() }}
{% endblock %}

19
docs/_templates/versions.html vendored 100644
Wyświetl plik

@ -0,0 +1,19 @@
{%- if current_version %}
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
<span class="rst-current-version" data-toggle="rst-current-version">
<span class="fa fa-book"> Other Versions</span>
{{ current_version.name }}
<span class="fa fa-caret-down"></span>
</span>
<div class="rst-other-versions">
{%- if versions.branches %}
<dl>
<dt>Versions</dt>
{%- for item in versions.branches %}
<dd><a href="{{ item.url }}">{{ item.name }}</a></dd>
{%- endfor %}
</dl>
{%- endif %}
</div>
</div>
{%- endif %}

Wyświetl plik

@ -1,6 +1,6 @@
#!/bin/bash -eux
# Building sphinx and swagger docs
python -m sphinx . $BUILD_PATH
poetry run sphinx-multiversion . $BUILD_PATH
TARGET_PATH="$BUILD_PATH/swagger" ./build_swagger.sh
python ./get-releases-json.py > $BUILD_PATH/releases.json
python ./get-releases-json.py --latest > $BUILD_PATH/latest.txt

Wyświetl plik

@ -20,7 +20,7 @@
import os
import sys
import datetime
from shutil import copyfile
import subprocess
sys.path.insert(0, os.path.abspath("../api"))
sys.path.insert(0, os.path.abspath("../api/config"))
@ -51,6 +51,7 @@ extensions = [
"sphinx.ext.autodoc",
"myst_parser",
"sphinx_panels",
"sphinx_multiversion",
]
autodoc_mock_imports = [
"celery",
@ -83,10 +84,7 @@ author = "The Funkwhale Collective"
# built documents.
#
# The short X.Y version.
version = funkwhale_api.__version__
if "-dev" in version:
version = "develop"
# The full version, including alpha/beta/rc tags.
version = subprocess.check_output(["git", "describe", "--tags"]).strip().decode("utf-8")
release = version
# The language for content autogenerated by Sphinx. Refer to documentation
@ -267,3 +265,7 @@ def copy_legacy_redirects(app, docname):
def setup(app):
app.connect("build-finished", copy_legacy_redirects)
smv_tag_whitelist = None
smv_branch_whitelist = r"(stable|develop)$"