Refactor conf.py
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-#
-# PoreSpy documentation build configuration file, created by
-# sphinx-quickstart on Fri Jul 28 00:04:40 2017.
-#
-# This file is execfile()d with the current directory set to its
-# containing dir.
-#
-# Note that not all possible configuration values are present in this
-# autogenerated file.
-#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
-
+#------------------------------------------------------------------------#
+# Path setup #
+#------------------------------------------------------------------------#
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
import os
import sys
-import datetime
+from datetime import datetime
import mock
sys.path.insert(0, os.path.abspath('.'))
@@ -30,15 +18,20 @@ MOCK_MODULES = ['imagej']
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = mock.Mock()
-# -- General configuration ------------------------------------------------
+#------------------------------------------------------------------------#
+# Project info #
+#------------------------------------------------------------------------#
-# If your documentation needs a minimal Sphinx version, state it here.
-#
-# needs_sphinx = '1.0'
+project = 'PoreSpy'
+copyright = f'{datetime.now().year}, PMEAL'
+author = 'PoreSpy Dev Team'
+
+# Import examples_linker file/module so that it runs each time docs are built
+import examples_linker
-# Add any Sphinx extension module names here, as strings. They can be
-# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
-# ones.
+#------------------------------------------------------------------------#
+# General config #
+#------------------------------------------------------------------------#
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.napoleon',
@@ -121,13 +114,6 @@ templates_path = ['_templates']
# The master toctree document.
master_doc = 'index'
-# General information about the project.
-
-project = 'PoreSpy'
-year = datetime.datetime.now().year
-copyright = '%d PoreSpy Team' % year
-author = 'PMEAL Team'
-
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
