File indexing completed on 2024-07-14 03:40:38

0001 # Configuration file for the Sphinx documentation builder.
0002 #
0003 # This file only contains a selection of the most common options. For a full
0004 # list see the documentation:
0005 # https://www.sphinx-doc.org/en/master/usage/configuration.html
0006 #
0007 # SPDX-License-Identifier: BSD-3-Clause
0008 
0009 # -- Path setup --------------------------------------------------------------
0010 
0011 # If extensions (or modules to document with autodoc) are in another directory,
0012 # add these directories to sys.path here. If the directory is relative to the
0013 # documentation root, use os.path.abspath to make it absolute, like shown here.
0014 #
0015 # import os
0016 # import sys
0017 # sys.path.insert(0, os.path.abspath('.'))
0018 
0019 
0020 # -- Project information -----------------------------------------------------
0021 
0022 import os
0023 import subprocess
0024 
0025 project = 'Digikam Manual'
0026 description = 'The Official digiKam Documentation'
0027 copyright = 'licensed under the  <a href="https://spdx.org/licenses/GFDL-1.2-or-later.html">licensed under the terms of the GNU Free Documentation License 1.2+</a> unless stated otherwise'
0028 author = 'digiKam Community'
0029 
0030 # The full version, including alpha/beta/rc tags
0031 release = '8.3.0'
0032 version = '8.3.0'
0033 
0034 # Get the git description if possible, to put it in the footer.
0035 
0036 try:
0037     gitcommitfriendly = subprocess.check_output(["git", "describe", "--always"]).decode("utf-8").strip()
0038 except subprocess.CalledProcessError as exc:
0039     gitcommitfriendly = None
0040 
0041 
0042 # -- General configuration ---------------------------------------------------
0043 
0044 # Add any Sphinx extension module names here, as strings. They can be
0045 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
0046 # ones.
0047 extensions = [
0048 ]
0049 
0050 # Add any paths that contain templates here, relative to this directory.
0051 templates_path = ['resources/templates']
0052 
0053 # List of patterns, relative to source directory, that match files and
0054 # directories to ignore when looking for source files.
0055 # This pattern also affects html_static_path and html_extra_path.
0056 exclude_patterns = ['build', 'Thumbs.db', '.DS_Store', '.venv*']
0057 html_extra_path = ['404handler.php'] # bring our 404 handler in
0058 
0059 # The master toctree document.
0060 master_doc = 'index'
0061 
0062 # The language for content autogenerated by Sphinx. Refer to documentation
0063 # for a list of supported languages.
0064 #
0065 # This is also used if you do content translation via gettext catalogs.
0066 # Usually you set "language" from the command line for these cases.
0067 language = 'en'
0068 
0069 # languages to exclude from smartquotes transformation. Requested by catalan translators due l':ref:`<crop_tool>` getting rendered as l"crop tool.
0070 smartquotes_excludes = {'languages':[
0071                                     'ja',
0072                                     'ca',
0073                                     'fr'
0074                                     ],
0075                         'builders': [
0076                                     'man',
0077                                     'text'
0078                                     ]
0079                         }
0080 
0081 # This reStructuredText will be included at the begin of every source file.
0082 #rst_prolog = ""
0083 # This reStructuredText will be included at the end of every source file.
0084 rst_epilog = ""
0085 
0086 # -- Options for HTML output -------------------------------------------------
0087 
0088 # The theme to use for HTML and HTML Help pages.  See the documentation for
0089 # a list of builtin themes.
0090 #
0091 
0092 import sphinx_rtd_theme
0093 html_theme = 'sphinx_rtd_theme' #'alabaster' #'sphinx_rtd_theme' 'insegel'
0094 html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
0095 
0096 # Add any paths that contain custom static files (such as style sheets) here,
0097 # relative to this directory. They are copied after the builtin static files,
0098 # so a file named "default.css" will overwrite the builtin "default.css".
0099 html_static_path = ['resources/static']
0100 
0101 html_favicon = 'resources/static/images/favicon.ico'
0102 
0103 html_logo = 'resources/static/images/logo-light.svg'
0104 
0105 if html_theme == "sphinx_rtd_theme":
0106     html_css_files = ["css/theme_overrides.css",
0107                       "css/version_switch.css"]
0108     html_js_files = ["js/version_switch.js"]
0109 
0110 html_context = {
0111     'build_id': os.getenv('BUILD_NUMBER', None),
0112     'build_url': os.getenv('BUILD_URL', None),
0113     'commit' : gitcommitfriendly
0114 }
0115 
0116 html_last_updated_fmt = '%Y-%m-%dT%H:%M:%S'
0117 
0118 # -- Internationalization Options --------------------------------------------
0119 
0120 locale_dirs = ['locale/']   # Where the PO files will be stored at
0121 gettext_compact = False     # optional.
0122 #gettext_additional_targets = ['image', 'index', 'literal-block'] # allows images to be translatable
0123 #figure_language_filename = "{path}{language}/{basename}{ext}"
0124 
0125 # -- Options for Epub output -------------------------------------------------
0126 
0127 # Bibliographic Dublin Core info.
0128 # filename
0129 # epub_basename = project.replace(' ', '_') + '_' + language
0130 
0131 epub_title = project+" "+version
0132 epub_description = description
0133 
0134 # Technically speaking dublincore accepts multiple author and contributor elements, but
0135 # the sphinx builder only accepts one.
0136 epub_author = author
0137 epub_publisher = 'https://www.digikam.org'
0138 epub_copyright = copyright
0139 
0140 epub_cover = ('_static/images/manual_cover.png', '')
0141 
0142 # The unique identifier of the text. This can be a ISBN number
0143 # or the project homepage.
0144 #
0145 epub_identifier = 'https://www.digikam.org'
0146 
0147 # A unique identification for the text.
0148 #
0149 epub_uid = 'url'
0150 
0151 # Not actually used anywhere? Docs say that this should be what the epub uid is used for but...
0152 epub_scheme = 'URL'
0153 
0154 # A list of files that should not be packed into the epub file.
0155 epub_exclude_files = ['search.html', '.htaccess', '404.xhtml', '404handler.php', '_static/favicon.ico', '_static/images/favicon.ico']
0156 
0157 epub_tocscope = 'includehidden'
0158