From 10404c478467b270b30e3390b94328a3f37ebca7 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 13 Aug 2023 19:00:52 +0400 Subject: [PATCH 1/4] Bump required sphinx version from 1.7 to 1.8 and use a new name for renamed function --- docs/source/conf.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index b94ddf0884..3f61be697d 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -24,7 +24,7 @@ sys.path.insert(0, project_root) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = '1.7' +needs_sphinx = '1.8' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom @@ -145,11 +145,9 @@ html_theme = 'sphinx_rtd_theme' # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] -#html_css_files = 'figures.css' use this once Sphinx 1.8 is released!!! - def setup(app): - app.add_stylesheet('figures.css') - app.add_stylesheet('luadoc.css') + app.add_css_file('figures.css') + app.add_css_file('luadoc.css') try: subprocess.call(['bash', project_root + '/docs/source/generate_luadoc.sh']) except Exception as e: From 26474843259c64e105fd0a523e52d77cf9bef22c Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 13 Aug 2023 19:01:25 +0400 Subject: [PATCH 2/4] Fix a warning about incorrect underscore --- docs/source/reference/modding/settings/water.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/reference/modding/settings/water.rst b/docs/source/reference/modding/settings/water.rst index 5057870353..fe407071f2 100644 --- a/docs/source/reference/modding/settings/water.rst +++ b/docs/source/reference/modding/settings/water.rst @@ -78,7 +78,7 @@ In interiors the lowest level is 2. This setting can be changed ingame with the "Reflection shader detail" dropdown under the Water tab of the Video panel in the Options menu. rain ripple detail ------------------ +------------------ :Type: integer :Range: 0, 1, 2 From 3e0101999f68fbab773f038557fa1a9b2703fc4b Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 13 Aug 2023 19:31:15 +0400 Subject: [PATCH 3/4] Bump year in documentation --- docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 3f61be697d..485c41c6c2 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -54,7 +54,7 @@ master_doc = 'index' # General information about the project. project = u'OpenMW' -copyright = u'2020, OpenMW Team' +copyright = u'2023, OpenMW Team' # The version info for the project you're documenting, acts as replacement for From 2c604e39a65cde9579e75f99a59b16b3e337da63 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 13 Aug 2023 18:59:47 +0400 Subject: [PATCH 4/4] Do not use an outdated parse_cmake module --- docs/source/conf.py | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 485c41c6c2..207c3f7c13 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -11,6 +11,7 @@ # # All configuration values have a default; values that are commented out # serve to show the default. +import re import os import sys import subprocess @@ -66,26 +67,15 @@ copyright = u'2023, OpenMW Team' release = version = "UNRELEASED" - -def get_openmw_version(haystack): - needle = 'OPENMW_VERSION_MAJOR' - line_counter = 0 - for hay in haystack: - if needle in str(hay): - break - line_counter += 1 - - version = '.'.join([haystack[line_counter][1][1].contents, - haystack[line_counter+1][1][1].contents, - haystack[line_counter+2][1][1].contents]) - return version - - try: - from parse_cmake import parsing cmake_raw = open(project_root+'/CMakeLists.txt', 'r').read() - cmake_data = parsing.parse(cmake_raw) - release = version = get_openmw_version(cmake_data) + majorVersionMatch = re.search('set\(OPENMW_VERSION_MAJOR (\d+)\)', cmake_raw) + minorVersionMatch = re.search('set\(OPENMW_VERSION_MINOR (\d+)\)', cmake_raw) + releaseVersionMatch = re.search('set\(OPENMW_VERSION_RELEASE (\d+)\)', cmake_raw) + if majorVersionMatch and minorVersionMatch and releaseVersionMatch: + release = version = '.'.join((majorVersionMatch.group(1), + minorVersionMatch.group(1), + releaseVersionMatch.group(1))) except Exception as ex: print("WARNING: Version will be set to '{0}' because: '{1}'.".format(release, str(ex)))