Salome HOME
bos #18858 Use sphinx_rtd_theme as theme for SALOME documentation built with Sphinx
authorvsr <vsr@opencascade.com>
Fri, 13 Mar 2020 11:12:39 +0000 (14:12 +0300)
committervsr <vsr@opencascade.com>
Fri, 13 Mar 2020 11:40:37 +0000 (14:40 +0300)
doc/salome/gui/SMESH/conf.py.in
src/Tools/MGCleanerPlug/doc/conf.py.in
src/Tools/Verima/Doc/conf.py.in
src/Tools/YamsPlug/doc/conf.py.in
src/Tools/ZCracksPlug/doc/conf.py.in
src/Tools/blocFissure/doc/conf.py.in

index d11dbd5c4bc1ac85e2813c3136f568d498f2c354..66efe32d3c7318abd5d6c5c736683895d4b1e8e6 100644 (file)
@@ -30,7 +30,12 @@ try:
   extensions += ['sphinxcontrib.napoleon']
 except:
   pass
-
+try:
+  import sphinx_rtd_theme
+  extensions += ['sphinx_rtd_theme']
+  use_rtd_theme = True
+except:
+  use_rtd_theme = False
 #add pdfbuilder to build a pdf with rst2pdf
 #extensions = ['rst2pdf.pdfbuilder']
 
@@ -106,7 +111,11 @@ pygments_style = 'sphinx'
 
 # The theme to use for HTML and HTML Help pages.  Major themes that come with
 # Sphinx are currently 'default' and 'sphinxdoc'.
-html_theme = 'default' if sphinx.version_info[:2] < (1,3) else 'classic'
+if use_rtd_theme:
+  html_theme = 'sphinx_rtd_theme'
+else:
+  html_theme = 'default' if sphinx.version_info[:2] < (1,3) else 'classic'
+
 themes_options = {}
 themes_options['classic'] = {
   'body_max_width':'none',
index 560450bf16faa9d7c55c9d7ea5777a0773e39964..173f096b5f9d560410acd82efa71ae78ee39dcca 100644 (file)
@@ -25,6 +25,12 @@ import sphinx
 # Add any Sphinx extension module names here, as strings. They can be extensions
 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
 extensions = ['sphinx.ext.autodoc']
+try:
+  import sphinx_rtd_theme
+  extensions += ['sphinx_rtd_theme']
+  use_rtd_theme = True
+except:
+  use_rtd_theme = False
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['.templates']
@@ -83,7 +89,11 @@ pygments_style = 'sphinx'
 
 # The theme to use for HTML and HTML Help pages.  Major themes that come with
 # Sphinx are currently 'default' and 'sphinxdoc'.
-html_theme = 'default' if sphinx.version_info[:2] < (1,3) else 'classic'
+if use_rtd_theme:
+  html_theme = 'sphinx_rtd_theme'
+else:
+  html_theme = 'default' if sphinx.version_info[:2] < (1,3) else 'classic'
+
 themes_options = {}
 themes_options['classic'] = {
   'body_max_width':'none',
index d4b53b638a55a943d5092f1427e39403d80e192d..47e27b6642cc5c2b4d1f96f0efdfeaebf133caef 100644 (file)
@@ -25,6 +25,12 @@ import sphinx
 # Add any Sphinx extension module names here, as strings. They can be extensions
 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
 extensions = ['sphinx.ext.autodoc']
+try:
+  import sphinx_rtd_theme
+  extensions += ['sphinx_rtd_theme']
+  use_rtd_theme = True
+except:
+  use_rtd_theme = False
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['.templates']
@@ -83,7 +89,11 @@ pygments_style = 'sphinx'
 
 # The theme to use for HTML and HTML Help pages.  Major themes that come with
 # Sphinx are currently 'default' and 'sphinxdoc'.
-html_theme = 'default' if sphinx.version_info[:2] < (1,3) else 'classic'
+if use_rtd_theme:
+  html_theme = 'sphinx_rtd_theme'
+else:
+  html_theme = 'default' if sphinx.version_info[:2] < (1,3) else 'classic'
+
 themes_options = {}
 themes_options['classic'] = {
   'body_max_width':'none',
index 2a4b9928609f6a6daa8f4b3ef0237222c588af66..1241b2c6fcb983fe33d8aa3a5513125220fec8fd 100644 (file)
@@ -25,6 +25,12 @@ import sphinx
 # Add any Sphinx extension module names here, as strings. They can be extensions
 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
 extensions = ['sphinx.ext.autodoc']
+try:
+  import sphinx_rtd_theme
+  extensions += ['sphinx_rtd_theme']
+  use_rtd_theme = True
+except:
+  use_rtd_theme = False
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['.templates']
@@ -83,7 +89,11 @@ pygments_style = 'sphinx'
 
 # The theme to use for HTML and HTML Help pages.  Major themes that come with
 # Sphinx are currently 'default' and 'sphinxdoc'.
-html_theme = 'default' if sphinx.version_info[:2] < (1,3) else 'classic'
+if use_rtd_theme:
+  html_theme = 'sphinx_rtd_theme'
+else:
+  html_theme = 'default' if sphinx.version_info[:2] < (1,3) else 'classic'
+
 themes_options = {}
 themes_options['classic'] = {
   'body_max_width':'none',
index db09764fc74a3fb85ac7032a4ac551a9d63e0fd1..0fe90574ef872b4c24dbfc9d5b54076589ee2a83 100644 (file)
@@ -12,6 +12,7 @@
 # serve to show the default value.
 
 import sys, os
+import sphinx
 
 # If your extensions are in another directory, add it here. If the directory
 # is relative to the documentation root, use os.path.abspath to make it
@@ -24,6 +25,12 @@ import sys, os
 # Add any Sphinx extension module names here, as strings. They can be extensions
 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
 extensions = ['sphinx.ext.autodoc']
+try:
+  import sphinx_rtd_theme
+  extensions += ['sphinx_rtd_theme']
+  use_rtd_theme = True
+except:
+  use_rtd_theme = False
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['.templates']
@@ -80,10 +87,24 @@ pygments_style = 'sphinx'
 # Options for HTML output
 # -----------------------
 
+# The theme to use for HTML and HTML Help pages.  Major themes that come with
+# Sphinx are currently 'default' and 'sphinxdoc'.
+if use_rtd_theme:
+  html_theme = 'sphinx_rtd_theme'
+else:
+  html_theme = 'default' if sphinx.version_info[:2] < (1,3) else 'classic'
+
+themes_options = {}
+themes_options['classic'] = {
+  'body_max_width':'none',
+  'body_min_width':0,
+}
+html_theme_options = themes_options.get(html_theme, {})
+
 # The style sheet to use for HTML and HTML Help pages. A file of that name
 # must exist either in Sphinx' static/ path, or in one of the custom paths
 # given in html_static_path.
-html_style = 'default.css'
+#html_style = 'default.css'
 
 # The name for this set of Sphinx documents.  If None, it defaults to
 # "<project> v<release> documentation".
index d6db7e5cecf77c80033e36d4571d149dd19d442a..07f6864d3dbd813f79ce7f9bc74b9de16dbd66bc 100644 (file)
@@ -24,6 +24,12 @@ import sys, os
 # Add any Sphinx extension module names here, as strings. They can be extensions
 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
 extensions = ['sphinx.ext.autodoc']
+try:
+  import sphinx_rtd_theme
+  extensions += ['sphinx_rtd_theme']
+  use_rtd_theme = True
+except:
+  use_rtd_theme = False
 
 # Add any paths that contain templates here, relative to this directory.
 #templates_path = ['.templates']
@@ -83,8 +89,17 @@ pygments_style = 'sphinx'
 # The style sheet to use for HTML and HTML Help pages. A file of that name
 # must exist either in Sphinx' static/ path, or in one of the custom paths
 # given in html_static_path.
-#html_style = 'default'
-html_theme = 'default'
+if use_rtd_theme:
+  html_theme = 'sphinx_rtd_theme'
+else:
+  html_theme = 'default' if sphinx.version_info[:2] < (1,3) else 'classic'
+
+themes_options = {}
+themes_options['classic'] = {
+  'body_max_width':'none',
+  'body_min_width':0,
+}
+html_theme_options = themes_options.get(html_theme, {})
 
 # The name for this set of Sphinx documents.  If None, it defaults to
 # "<project> v<release> documentation".