From 357d1fa83bced4fd3b8d2fe85d273051b4a3b339 Mon Sep 17 00:00:00 2001
From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com>
Date: Fri, 10 Mar 2023 16:47:47 +0100
Subject: [PATCH] Update docs theme from main branch
---
docs/source/_static/custom.css | 15 +++++++-
docs/source/_templates/sidebar-title.html | 3 ++
docs/source/conf.py | 47 +++++++++++------------
docs/source/index.rst | 6 ++-
docs/source/int_customise.rst | 2 +-
docs/source/int_introduction.rst | 12 +++---
docs/source/int_started.rst | 9 +++++
docs/source/requirements.txt | 5 ++-
8 files changed, 61 insertions(+), 38 deletions(-)
create mode 100644 docs/source/_templates/sidebar-title.html
diff --git a/docs/source/_static/custom.css b/docs/source/_static/custom.css
index 4afdc4fc..5db9bebd 100644
--- a/docs/source/_static/custom.css
+++ b/docs/source/_static/custom.css
@@ -1,3 +1,14 @@
-body article section {
- margin-top: 1.8em;
+span.guilabel {
+ font-weight: 400;
+}
+
+.nw-sidebar-title {
+ height: unset;
+ max-height: unset;
+ flex-direction: column;
+ justify-content: center;
+ gap: .25rem;
+ font-size: 1.25rem;
+ font-weight: normal;
+ text-align: center;
}
diff --git a/docs/source/_templates/sidebar-title.html b/docs/source/_templates/sidebar-title.html
new file mode 100644
index 00000000..a9f2a58a
--- /dev/null
+++ b/docs/source/_templates/sidebar-title.html
@@ -0,0 +1,3 @@
+{% if docstitle %}
+
+{% endif %}
diff --git a/docs/source/conf.py b/docs/source/conf.py
index c2851227..03e1d9d7 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -1,7 +1,7 @@
-#
-# Configuration file for the Sphinx documentation builder.
-# Documentation: http://www.sphinx-doc.org/en/master/config
-#
+"""
+Configuration file for the Sphinx documentation builder.
+Documentation: http://www.sphinx-doc.org/en/master/config
+"""
# -- Imports -----------------------------------------------------------------
@@ -12,7 +12,7 @@ import datetime
# -- Project Information -----------------------------------------------------
project = "novelWriter"
-copyright = f"{datetime.date.today().year}, Veronica Berglyd Olsen"
+copyright = f"{datetime.date.today().year}"
author = "Veronica Berglyd Olsen"
initFile = os.path.join(
@@ -34,7 +34,7 @@ version = release.split("-")[0]
os.environ["TZ"] = "Europe/Oslo"
time.tzset()
-needs_sphinx = "4.0"
+needs_sphinx = "5.0"
extensions = []
templates_path = ["_templates"]
source_suffix = ".rst"
@@ -45,23 +45,27 @@ exclude_patterns = []
# -- Options for HTML Output -------------------------------------------------
-html_theme = "furo"
+html_theme = "sphinx_book_theme"
+html_title = f"Version {release}"
html_static_path = ["_static"]
html_css_files = ["custom.css"]
html_theme_options = {
- "light_logo": "novelwriter-light.png",
- "dark_logo": "novelwriter-dark.png",
+ "logo": {
+ "image_light": "_static/novelwriter-light.png",
+ "image_dark": "_static/novelwriter-dark.png",
+ },
+ "show_toc_level": 2,
+ "show_navbar_depth": 1,
+ "repository_url": "https://github.com/vkbo/novelwriter",
"navigation_with_keys": True,
- "dark_css_variables": {
- "admonition-font-size": "92%",
- },
- "light_css_variables": {
- "admonition-font-size": "92%",
- },
+ "use_repository_button": True,
+ "use_issues_button": True,
+ "pygment_light_style": "tango",
+ "pygment_dark_style": "dracula",
+}
+html_sidebars = {
+ "**": ["navbar-logo", "sidebar-title", "sbt-sidebar-nav"],
}
-html_title = f"Documentation Version {release}
"
-pygments_style = "tango"
-pygments_dark_style = "native"
# -- Options for HTMLHelp Output ---------------------------------------------
@@ -111,12 +115,5 @@ texinfo_documents = [(
# Bibliographic Dublin Core info.
epub_title = project
-# The unique identifier of the text. This can be a ISBN number
-# or the project homepage.
-# epub_identifier = ""
-
-# A unique identification for the text.
-# epub_uid = ""
-
# A list of files that should not be packed into the epub file.
epub_exclude_files = ["search.html"]
diff --git a/docs/source/index.rst b/docs/source/index.rst
index dfc2877c..c9ba0aa9 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -3,8 +3,9 @@ Documentation for novelWriter
#############################
.. image:: images/novelwriter_logo.png
+ :class: dark-light
:align: right
- :width: 48
+ :width: 64
| **For Release:** |release|
| **Last Updated:** |today|
@@ -17,6 +18,7 @@ editor that allows for easy organisation of text and notes, using human readable
storage for robustness.
.. figure:: images/screenshot_multi.png
+ :class: dark-light
:align: center
:width: 500
@@ -31,7 +33,7 @@ as well. novelWriter can also be run directly from the Python source, or install
the pip tool. See :ref:`a_started` for more details.
.. note::
- Version 1.3 introduced a few changes that will require you to make some minor modifications to
+ Release 1.5 introduced a few changes that will require you to make some minor modifications to
some of the headings in your project. It should be fairly quick and straightforward. Please see
the :ref:`a_prjfmt_1_3` section for more details.
diff --git a/docs/source/int_customise.rst b/docs/source/int_customise.rst
index 07b130b4..e2b6cc18 100644
--- a/docs/source/int_customise.rst
+++ b/docs/source/int_customise.rst
@@ -16,7 +16,7 @@ your own syntax themes, and install additional dictionaries.
Spell Check Dictionaries
========================
-novelWriter uses Enchant_ as the spell checking tool. Depending on you operating system, it may or
+novelWriter uses Enchant_ as the spell checking tool. Depending on your operating system, it may or
may not load installed spell check dictionaries.
Linux
diff --git a/docs/source/int_introduction.rst b/docs/source/int_introduction.rst
index 5eeffb7b..9b3bc4cf 100644
--- a/docs/source/int_introduction.rst
+++ b/docs/source/int_introduction.rst
@@ -68,12 +68,12 @@ Below are some key features of novelWriter.
Screenshots
===========
-**novelWriter with default theme:**
+.. figure:: images/screenshot_default.png
+ :class: dark-light
-.. image:: images/screenshot_default.png
- :width: 800
+ novelWriter with default theme
-**novelWriter with dark theme:**
+.. figure:: images/screenshot_dark.png
+ :class: dark-light
-.. image:: images/screenshot_dark.png
- :width: 800
+ novelWriter with dark theme
diff --git a/docs/source/int_started.rst b/docs/source/int_started.rst
index 3b7007f8..dab20afd 100644
--- a/docs/source/int_started.rst
+++ b/docs/source/int_started.rst
@@ -89,6 +89,15 @@ Then run the update and install commands as for Ubuntu:
You may need to use the Ubuntu 20.04 (focal) packages for Debian 11 or earlier. The newer Ubuntu
packages use a different compression algorithm that may not be supported.
+.. tip::
+
+ If you get an error message like ``gpg: failed to create temporary file`` when importing the key
+ from the Ubuntu keyserver, try creating the folder it fails on, and import the key again:
+
+ .. code-block:: bash
+
+ sudo mkdir /root/.gnupg/
+
AppImage Releases
-----------------
diff --git a/docs/source/requirements.txt b/docs/source/requirements.txt
index 1896078f..19fc1423 100644
--- a/docs/source/requirements.txt
+++ b/docs/source/requirements.txt
@@ -1,4 +1,5 @@
-furo
-sphinx>=4.0
+sphinx-book-theme
+sphinx>=5.0
+sphinx-favicon
pygments>=2.7
docutils>=0.17.1