From 994bfbeb04ab1f3188bacd1d9d0b7dbb265e5ccf Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Wed, 2 Oct 2019 16:27:59 +0200 Subject: [PATCH] Use sphinx_rtd documentation theme, added logo and link to source on Gitlab --- .gitlab-ci.yml | 4 ++-- docs/Dockerfile | 2 +- docs/conf.py | 17 ++++++++++++++--- docs/logo.svg | 30 ++++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 docs/logo.svg diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ca343ca1b..70727fc15 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -71,7 +71,7 @@ review_docs: - cd docs - apt-get update - apt-get install -y graphviz - - pip install sphinx + - pip install sphinx sphinx_rtd_theme script: - ./build_docs.sh cache: @@ -203,7 +203,7 @@ pages: - cd docs - apt-get update - apt-get install -y graphviz - - pip install sphinx + - pip install sphinx sphinx_rtd_theme script: - ./build_docs.sh cache: diff --git a/docs/Dockerfile b/docs/Dockerfile index 76147bb6d..1de9a3ede 100644 --- a/docs/Dockerfile +++ b/docs/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.6 RUN apt-get update && apt-get install -y graphviz -RUN pip install sphinx livereload +RUN pip install sphinx livereload sphinx_rtd_theme WORKDIR /app/docs diff --git a/docs/conf.py b/docs/conf.py index bf1afa0a6..6b7466d64 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -89,13 +89,24 @@ todo_include_todos = False # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = "alabaster" +html_theme = "sphinx_rtd_theme" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # -# html_theme_options = {} +html_theme_options = { + 'gitlab_url': 'https://dev.funkwhale.audio/funkwhale/funkwhale' +} +html_context = { + 'display_gitlab': True, + 'gitlab_host': 'dev.funkwhale.audio', + 'gitlab_repo': 'funkwhale', + 'gitlab_user': 'funkwhale', + 'gitlab_version': 'master', + 'conf_py_path': '/docs/', +} +html_logo = 'logo.svg' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, @@ -166,7 +177,7 @@ redirect_files = [ ('importing-music.html', 'admin/importing-music.html'), ('architecture.html', 'developers/architecture.html'), ('troubleshooting.html', 'admin/troubleshooting.html'), - ('configuration.html', 'admin/configuration.html'), + ('configuration.html', 'admin/configuration.html'), ('upgrading/index.html', '../admin/upgrading.html'), ('upgrading/0.17.html', '../admin/0.17.html'), ('users/django.html', '../admin/django.html'), diff --git a/docs/logo.svg b/docs/logo.svg new file mode 100644 index 000000000..1487fcf74 --- /dev/null +++ b/docs/logo.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + +