We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
links on read the doc footer leads to 404
https://github.com/opendatacube/datacube-core/blob/develop/docs/_templates/odc-footer.html renders at the footer of page https://datacube-core.readthedocs.io/en/latest/index.html

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `docs/conf.py`
Content:
```
1 # This file is part of the Open Data Cube, see https://opendatacube.org for more information
2 #
3 # Copyright (c) 2015-2020 ODC Contributors
4 # SPDX-License-Identifier: Apache-2.0
5 import os
6 import sys
7 
8 from bs4 import BeautifulSoup as bs  # noqa: N813
9 
10 # If extensions (or modules to document with autodoc) are in another directory,
11 # add these directories to sys.path here. If the directory is relative to the
12 # documentation root, use os.path.abspath to make it absolute, like shown here.
13 sys.path.insert(0, os.path.abspath('..'))
14 sys.path.insert(0, os.path.abspath('.'))
15 print(sys.path)
16 on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
17 
18 # -- General configuration ------------------------------------------------
19 
20 # If your documentation needs a minimal Sphinx version, state it here.
21 # needs_sphinx = '1.0'
22 
23 # Add any Sphinx extension module names here, as strings. They can be
24 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
25 # ones.
26 extensions = [
27     'sphinx.ext.autodoc',
28     'sphinx.ext.autosummary',
29     'sphinx_autodoc_typehints',
30     'sphinx.ext.graphviz',
31     'sphinx.ext.viewcode',
32     'sphinx.ext.intersphinx',
33     'sphinx.ext.extlinks',
34     'sphinx.ext.mathjax',
35     'sphinx_click.ext',
36     'click_utils',
37     'autodocsumm',
38     'nbsphinx',
39     'sphinx.ext.napoleon',
40     'sphinx.ext.autosectionlabel'
41 ]
42 
43 # Add any paths that contain templates here, relative to this directory.
44 templates_path = ['_templates']
45 
46 # The suffix of source filenames.
47 source_suffix = ['.rst', '.md']
48 
49 # The master toctree document.
50 master_doc = 'index'
51 
52 # General information about the project.
53 project = u'Open Data Cube'
54 
55 # The version info for the project you're documenting, acts as replacement for
56 # |version| and |release|, also used in various other places throughout the
57 # built documents.
58 #
59 # The short X.Y version.
60 version = "1.8"
61 # The full version, including alpha/beta/rc tags.
62 # FIXME: obtain real version by running git
63 release = version
64 
65 # There are two options for replacing |today|: either, you set today to some
66 # non-false value, then it is used:
67 # today = ''
68 # Else, today_fmt is used as the format for a strftime call.
69 # today_fmt = '%B %d, %Y'
70 
71 # List of patterns, relative to source directory, that match files and
72 # directories to ignore when looking for source files.
73 exclude_patterns = ['README.rst', '.condaenv', '.direnv']
74 
75 # If true, '()' will be appended to :func: etc. cross-reference text.
76 add_function_parentheses = True
77 
78 # If true, sectionauthor and moduleauthor directives will be shown in the
79 # output. They are ignored by default.
80 show_authors = False
81 
82 # The name of the Pygments (syntax highlighting) style to use.
83 pygments_style = 'friendly'
84 
85 autosummary_generate = True
86 autoclass_content = "both"
87 
88 autodoc_default_options = {
89     'autosummary': True,
90     'inherited-members': True
91 }
92 
93 extlinks = {'issue': ('https://github.com/opendatacube/datacube-core/issues/%s', 'issue '),
94             'pull': ('https://github.com/opendatacube/datacube-core/pulls/%s', 'PR ')}
95 
96 intersphinx_mapping = {
97     'python': ('https://docs.python.org/3', None),
98     'pandas': ('https://pandas.pydata.org/pandas-docs/stable/', None),
99     'numpy': ('https://docs.scipy.org/doc/numpy/', None),
100     'xarray': ('https://xarray.pydata.org/en/stable/', None),
101 }
102 
103 graphviz_output_format = 'svg'
104 
105 # -- Options for HTML output ----------------------------------------------
106 
107 # The theme to use for HTML and HTML Help pages.  See the documentation for
108 # a list of builtin themes.
109 if on_rtd:
110     html_theme = 'pydata_sphinx_theme'
111 else:
112     html_theme = 'pydata_sphinx_theme'
113 
114 html_theme_options = {
115     "navigation_depth": 1,
116     "show_prev_next": False,
117     "collapse_navigation": True,
118     "use_edit_page_button": True,
119     "footer_items": ["odc-footer"],
120     "page_sidebar_items": [
121         "page-toc",
122         "autoclass_page_toc",
123         "autosummary_page_toc",
124         "edit-this-page"
125     ],
126     "icon_links": [
127         {
128             "name": "GitHub",
129             "url": "https://github.com/opendatacube/datacube-core",
130             "icon": "fab fa-github",
131         },
132         {
133             "name": "Slack",
134             "url": "http://slack.opendatacube.org/",
135             "icon": "fab fa-slack",
136         },
137     ],
138 }
139 
140 html_context = {
141     "github_user": "opendatacube",
142     "github_repo": "datacube-core",
143     "github_version": "develop",
144     "doc_path": "docs",
145 }
146 
147 html_logo = '_static/odc-logo-horizontal.svg'
148 html_static_path = ['_static']
149 
150 # The name of an image file (within the static path) to use as favicon of the
151 # docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
152 # pixels large.
153 # html_favicon = None
154 
155 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
156 # using the given strftime format.
157 html_last_updated_fmt = '%b %d, %Y'
158 
159 
160 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
161 html_show_sphinx = False
162 
163 # Output file base name for HTML help builder.
164 htmlhelp_basename = 'ODCdoc'
165 
166 # Grouping the document tree into LaTeX files. List of tuples
167 # (source start file, target name, title,
168 #  author, documentclass [howto, manual, or own class]).
169 latex_documents = [
170     ('index', 'ODC.tex', u'Open Data Cube Documentation', 'Open Data Cube', 'manual')
171 ]
172 
173 numfig = True
174 
175 
176 def custom_page_funcs(app, pagename, templatename, context, doctree):
177 
178     def get_autosummary_toc():
179         soup = bs(context["body"], "html.parser")
180 
181         class_sections = soup.find(class_='class')
182         if class_sections != None:
183             return ""
184 
185         matches = soup.find_all('dl')
186         if matches == None or len(matches) == 0:
187             return ""
188 
189         out = {
190             'title': '',
191             'menu_items': []
192         }
193 
194         #  remove the class dt
195         pyclass = matches.pop(0)
196         pyclass = pyclass.find('dt')
197         if pyclass != None:
198             out['title'] = pyclass.get('id')
199 
200         for match in matches:
201             match_dt = match.find('dt')
202             link = match.find(class_="headerlink")
203             if link != None:
204                 out['menu_items'].append({
205                     'title': match_dt.get('id'),
206                     'link': link['href']
207                 })
208 
209         return out
210 
211     def get_class_toc():
212         soup = bs(context["body"], "html.parser")
213 
214         class_sections = soup.find_all(class_='autosummary')
215         if class_sections == None or len(class_sections) == 0:
216             return ""
217 
218         out = {
219             'title': '',
220             'menu_items': []
221         }
222         class_title = soup.find(class_='class')
223         if class_title == None:
224             return ""
225 
226         pyclass = class_title.find('dt')
227         if pyclass != None:
228             out['title'] = pyclass.get('id')
229 
230         for section in class_sections:
231             out_section = {
232                 'title': '',
233                 'menu_items': []
234             }
235             out_section['title'] = section.find_previous_sibling('p').text.replace(':', '')
236             matches = section.find_all('tr')
237             for match in matches:
238                 link = match.find(class_="internal")
239 
240                 if link != None:
241                     title = link['title']
242                     if title != None:
243                         title = title.replace(out['title'], '')
244                     out_section['menu_items'].append({
245                         'title': title,
246                         'link': link['href']
247                     })
248             if len(out_section['menu_items']) > 0:
249                 out['menu_items'].append(out_section)
250 
251         # print(out)
252         return out
253 
254     context['get_class_toc'] = get_class_toc
255     context['get_autosummary_toc'] = get_autosummary_toc
256 
257 
258 def setup(app):
259     # Fix bug where code isn't being highlighted
260     app.add_css_file('pygments.css')
261     app.add_css_file('custom.css')
262 
263     app.connect("html-page-context", custom_page_funcs)
264 
265 
266 # Clean up generated documentation files that RTD seems to be having trouble with
267 if on_rtd:
268     import shutil
269 
270     shutil.rmtree('./dev/generate', ignore_errors=True)
271
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/docs/conf.py b/docs/conf.py
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -70,7 +70,7 @@
 
 # List of patterns, relative to source directory, that match files and
 # directories to ignore when looking for source files.
-exclude_patterns = ['README.rst', '.condaenv', '.direnv']
+exclude_patterns = ['README.rst', '.condaenv', '.direnv', '_build']
 
 # If true, '()' will be appended to :func: etc. cross-reference text.
 add_function_parentheses = True

{"golden_diff": "diff --git a/docs/conf.py b/docs/conf.py\n--- a/docs/conf.py\n+++ b/docs/conf.py\n@@ -70,7 +70,7 @@\n \n # List of patterns, relative to source directory, that match files and\n # directories to ignore when looking for source files.\n-exclude_patterns = ['README.rst', '.condaenv', '.direnv']\n+exclude_patterns = ['README.rst', '.condaenv', '.direnv', '_build']\n \n # If true, '()' will be appended to :func: etc. cross-reference text.\n add_function_parentheses = True\n", "issue": "links on read the doc footer leads to 404\nhttps://github.com/opendatacube/datacube-core/blob/develop/docs/_templates/odc-footer.html renders at the footer of page https://datacube-core.readthedocs.io/en/latest/index.html\n", "before_files": [{"content": "# This file is part of the Open Data Cube, see https://opendatacube.org for more information\n#\n# Copyright (c) 2015-2020 ODC Contributors\n# SPDX-License-Identifier: Apache-2.0\nimport os\nimport sys\n\nfrom bs4 import BeautifulSoup as bs  # noqa: N813\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\nsys.path.insert(0, os.path.abspath('..'))\nsys.path.insert(0, os.path.abspath('.'))\nprint(sys.path)\non_rtd = os.environ.get('READTHEDOCS', None) == 'True'\n\n# -- General configuration ------------------------------------------------\n\n# If your documentation needs a minimal Sphinx version, state it here.\n# needs_sphinx = '1.0'\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = [\n    'sphinx.ext.autodoc',\n    'sphinx.ext.autosummary',\n    'sphinx_autodoc_typehints',\n    'sphinx.ext.graphviz',\n    'sphinx.ext.viewcode',\n    'sphinx.ext.intersphinx',\n    'sphinx.ext.extlinks',\n    'sphinx.ext.mathjax',\n    'sphinx_click.ext',\n    'click_utils',\n    'autodocsumm',\n    'nbsphinx',\n    'sphinx.ext.napoleon',\n    'sphinx.ext.autosectionlabel'\n]\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# The suffix of source filenames.\nsource_suffix = ['.rst', '.md']\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = u'Open Data Cube'\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\n#\n# The short X.Y version.\nversion = \"1.8\"\n# The full version, including alpha/beta/rc tags.\n# FIXME: obtain real version by running git\nrelease = version\n\n# There are two options for replacing |today|: either, you set today to some\n# non-false value, then it is used:\n# today = ''\n# Else, today_fmt is used as the format for a strftime call.\n# today_fmt = '%B %d, %Y'\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\nexclude_patterns = ['README.rst', '.condaenv', '.direnv']\n\n# If true, '()' will be appended to :func: etc. cross-reference text.\nadd_function_parentheses = True\n\n# If true, sectionauthor and moduleauthor directives will be shown in the\n# output. They are ignored by default.\nshow_authors = False\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'friendly'\n\nautosummary_generate = True\nautoclass_content = \"both\"\n\nautodoc_default_options = {\n    'autosummary': True,\n    'inherited-members': True\n}\n\nextlinks = {'issue': ('https://github.com/opendatacube/datacube-core/issues/%s', 'issue '),\n            'pull': ('https://github.com/opendatacube/datacube-core/pulls/%s', 'PR ')}\n\nintersphinx_mapping = {\n    'python': ('https://docs.python.org/3', None),\n    'pandas': ('https://pandas.pydata.org/pandas-docs/stable/', None),\n    'numpy': ('https://docs.scipy.org/doc/numpy/', None),\n    'xarray': ('https://xarray.pydata.org/en/stable/', None),\n}\n\ngraphviz_output_format = 'svg'\n\n# -- Options for HTML output ----------------------------------------------\n\n# The theme to use for HTML and HTML Help pages.  See the documentation for\n# a list of builtin themes.\nif on_rtd:\n    html_theme = 'pydata_sphinx_theme'\nelse:\n    html_theme = 'pydata_sphinx_theme'\n\nhtml_theme_options = {\n    \"navigation_depth\": 1,\n    \"show_prev_next\": False,\n    \"collapse_navigation\": True,\n    \"use_edit_page_button\": True,\n    \"footer_items\": [\"odc-footer\"],\n    \"page_sidebar_items\": [\n        \"page-toc\",\n        \"autoclass_page_toc\",\n        \"autosummary_page_toc\",\n        \"edit-this-page\"\n    ],\n    \"icon_links\": [\n        {\n            \"name\": \"GitHub\",\n            \"url\": \"https://github.com/opendatacube/datacube-core\",\n            \"icon\": \"fab fa-github\",\n        },\n        {\n            \"name\": \"Slack\",\n            \"url\": \"http://slack.opendatacube.org/\",\n            \"icon\": \"fab fa-slack\",\n        },\n    ],\n}\n\nhtml_context = {\n    \"github_user\": \"opendatacube\",\n    \"github_repo\": \"datacube-core\",\n    \"github_version\": \"develop\",\n    \"doc_path\": \"docs\",\n}\n\nhtml_logo = '_static/odc-logo-horizontal.svg'\nhtml_static_path = ['_static']\n\n# The name of an image file (within the static path) to use as favicon of the\n# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32\n# pixels large.\n# html_favicon = None\n\n# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,\n# using the given strftime format.\nhtml_last_updated_fmt = '%b %d, %Y'\n\n\n# If true, \"Created using Sphinx\" is shown in the HTML footer. Default is True.\nhtml_show_sphinx = False\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'ODCdoc'\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title,\n#  author, documentclass [howto, manual, or own class]).\nlatex_documents = [\n    ('index', 'ODC.tex', u'Open Data Cube Documentation', 'Open Data Cube', 'manual')\n]\n\nnumfig = True\n\n\ndef custom_page_funcs(app, pagename, templatename, context, doctree):\n\n    def get_autosummary_toc():\n        soup = bs(context[\"body\"], \"html.parser\")\n\n        class_sections = soup.find(class_='class')\n        if class_sections != None:\n            return \"\"\n\n        matches = soup.find_all('dl')\n        if matches == None or len(matches) == 0:\n            return \"\"\n\n        out = {\n            'title': '',\n            'menu_items': []\n        }\n\n        #  remove the class dt\n        pyclass = matches.pop(0)\n        pyclass = pyclass.find('dt')\n        if pyclass != None:\n            out['title'] = pyclass.get('id')\n\n        for match in matches:\n            match_dt = match.find('dt')\n            link = match.find(class_=\"headerlink\")\n            if link != None:\n                out['menu_items'].append({\n                    'title': match_dt.get('id'),\n                    'link': link['href']\n                })\n\n        return out\n\n    def get_class_toc():\n        soup = bs(context[\"body\"], \"html.parser\")\n\n        class_sections = soup.find_all(class_='autosummary')\n        if class_sections == None or len(class_sections) == 0:\n            return \"\"\n\n        out = {\n            'title': '',\n            'menu_items': []\n        }\n        class_title = soup.find(class_='class')\n        if class_title == None:\n            return \"\"\n\n        pyclass = class_title.find('dt')\n        if pyclass != None:\n            out['title'] = pyclass.get('id')\n\n        for section in class_sections:\n            out_section = {\n                'title': '',\n                'menu_items': []\n            }\n            out_section['title'] = section.find_previous_sibling('p').text.replace(':', '')\n            matches = section.find_all('tr')\n            for match in matches:\n                link = match.find(class_=\"internal\")\n\n                if link != None:\n                    title = link['title']\n                    if title != None:\n                        title = title.replace(out['title'], '')\n                    out_section['menu_items'].append({\n                        'title': title,\n                        'link': link['href']\n                    })\n            if len(out_section['menu_items']) > 0:\n                out['menu_items'].append(out_section)\n\n        # print(out)\n        return out\n\n    context['get_class_toc'] = get_class_toc\n    context['get_autosummary_toc'] = get_autosummary_toc\n\n\ndef setup(app):\n    # Fix bug where code isn't being highlighted\n    app.add_css_file('pygments.css')\n    app.add_css_file('custom.css')\n\n    app.connect(\"html-page-context\", custom_page_funcs)\n\n\n# Clean up generated documentation files that RTD seems to be having trouble with\nif on_rtd:\n    import shutil\n\n    shutil.rmtree('./dev/generate', ignore_errors=True)\n", "path": "docs/conf.py"}], "after_files": [{"content": "# This file is part of the Open Data Cube, see https://opendatacube.org for more information\n#\n# Copyright (c) 2015-2020 ODC Contributors\n# SPDX-License-Identifier: Apache-2.0\nimport os\nimport sys\n\nfrom bs4 import BeautifulSoup as bs  # noqa: N813\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\nsys.path.insert(0, os.path.abspath('..'))\nsys.path.insert(0, os.path.abspath('.'))\nprint(sys.path)\non_rtd = os.environ.get('READTHEDOCS', None) == 'True'\n\n# -- General configuration ------------------------------------------------\n\n# If your documentation needs a minimal Sphinx version, state it here.\n# needs_sphinx = '1.0'\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = [\n    'sphinx.ext.autodoc',\n    'sphinx.ext.autosummary',\n    'sphinx_autodoc_typehints',\n    'sphinx.ext.graphviz',\n    'sphinx.ext.viewcode',\n    'sphinx.ext.intersphinx',\n    'sphinx.ext.extlinks',\n    'sphinx.ext.mathjax',\n    'sphinx_click.ext',\n    'click_utils',\n    'autodocsumm',\n    'nbsphinx',\n    'sphinx.ext.napoleon',\n    'sphinx.ext.autosectionlabel'\n]\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# The suffix of source filenames.\nsource_suffix = ['.rst', '.md']\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = u'Open Data Cube'\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\n#\n# The short X.Y version.\nversion = \"1.8\"\n# The full version, including alpha/beta/rc tags.\n# FIXME: obtain real version by running git\nrelease = version\n\n# There are two options for replacing |today|: either, you set today to some\n# non-false value, then it is used:\n# today = ''\n# Else, today_fmt is used as the format for a strftime call.\n# today_fmt = '%B %d, %Y'\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\nexclude_patterns = ['README.rst', '.condaenv', '.direnv', '_build']\n\n# If true, '()' will be appended to :func: etc. cross-reference text.\nadd_function_parentheses = True\n\n# If true, sectionauthor and moduleauthor directives will be shown in the\n# output. They are ignored by default.\nshow_authors = False\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'friendly'\n\nautosummary_generate = True\nautoclass_content = \"both\"\n\nautodoc_default_options = {\n    'autosummary': True,\n    'inherited-members': True\n}\n\nextlinks = {'issue': ('https://github.com/opendatacube/datacube-core/issues/%s', 'issue '),\n            'pull': ('https://github.com/opendatacube/datacube-core/pulls/%s', 'PR ')}\n\nintersphinx_mapping = {\n    'python': ('https://docs.python.org/3', None),\n    'pandas': ('https://pandas.pydata.org/pandas-docs/stable/', None),\n    'numpy': ('https://docs.scipy.org/doc/numpy/', None),\n    'xarray': ('https://xarray.pydata.org/en/stable/', None),\n}\n\ngraphviz_output_format = 'svg'\n\n# -- Options for HTML output ----------------------------------------------\n\n# The theme to use for HTML and HTML Help pages.  See the documentation for\n# a list of builtin themes.\nif on_rtd:\n    html_theme = 'pydata_sphinx_theme'\nelse:\n    html_theme = 'pydata_sphinx_theme'\n\nhtml_theme_options = {\n    \"navigation_depth\": 1,\n    \"show_prev_next\": False,\n    \"collapse_navigation\": True,\n    \"use_edit_page_button\": True,\n    \"footer_items\": [\"odc-footer\"],\n    \"page_sidebar_items\": [\n        \"page-toc\",\n        \"autoclass_page_toc\",\n        \"autosummary_page_toc\",\n        \"edit-this-page\"\n    ],\n    \"icon_links\": [\n        {\n            \"name\": \"GitHub\",\n            \"url\": \"https://github.com/opendatacube/datacube-core\",\n            \"icon\": \"fab fa-github\",\n        },\n        {\n            \"name\": \"Slack\",\n            \"url\": \"http://slack.opendatacube.org/\",\n            \"icon\": \"fab fa-slack\",\n        },\n    ],\n}\n\nhtml_context = {\n    \"github_user\": \"opendatacube\",\n    \"github_repo\": \"datacube-core\",\n    \"github_version\": \"develop\",\n    \"doc_path\": \"docs\",\n}\n\nhtml_logo = '_static/odc-logo-horizontal.svg'\nhtml_static_path = ['_static']\n\n# The name of an image file (within the static path) to use as favicon of the\n# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32\n# pixels large.\n# html_favicon = None\n\n# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,\n# using the given strftime format.\nhtml_last_updated_fmt = '%b %d, %Y'\n\n\n# If true, \"Created using Sphinx\" is shown in the HTML footer. Default is True.\nhtml_show_sphinx = False\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'ODCdoc'\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title,\n#  author, documentclass [howto, manual, or own class]).\nlatex_documents = [\n    ('index', 'ODC.tex', u'Open Data Cube Documentation', 'Open Data Cube', 'manual')\n]\n\nnumfig = True\n\n\ndef custom_page_funcs(app, pagename, templatename, context, doctree):\n\n    def get_autosummary_toc():\n        soup = bs(context[\"body\"], \"html.parser\")\n\n        class_sections = soup.find(class_='class')\n        if class_sections != None:\n            return \"\"\n\n        matches = soup.find_all('dl')\n        if matches == None or len(matches) == 0:\n            return \"\"\n\n        out = {\n            'title': '',\n            'menu_items': []\n        }\n\n        #  remove the class dt\n        pyclass = matches.pop(0)\n        pyclass = pyclass.find('dt')\n        if pyclass != None:\n            out['title'] = pyclass.get('id')\n\n        for match in matches:\n            match_dt = match.find('dt')\n            link = match.find(class_=\"headerlink\")\n            if link != None:\n                out['menu_items'].append({\n                    'title': match_dt.get('id'),\n                    'link': link['href']\n                })\n\n        return out\n\n    def get_class_toc():\n        soup = bs(context[\"body\"], \"html.parser\")\n\n        class_sections = soup.find_all(class_='autosummary')\n        if class_sections == None or len(class_sections) == 0:\n            return \"\"\n\n        out = {\n            'title': '',\n            'menu_items': []\n        }\n        class_title = soup.find(class_='class')\n        if class_title == None:\n            return \"\"\n\n        pyclass = class_title.find('dt')\n        if pyclass != None:\n            out['title'] = pyclass.get('id')\n\n        for section in class_sections:\n            out_section = {\n                'title': '',\n                'menu_items': []\n            }\n            out_section['title'] = section.find_previous_sibling('p').text.replace(':', '')\n            matches = section.find_all('tr')\n            for match in matches:\n                link = match.find(class_=\"internal\")\n\n                if link != None:\n                    title = link['title']\n                    if title != None:\n                        title = title.replace(out['title'], '')\n                    out_section['menu_items'].append({\n                        'title': title,\n                        'link': link['href']\n                    })\n            if len(out_section['menu_items']) > 0:\n                out['menu_items'].append(out_section)\n\n        # print(out)\n        return out\n\n    context['get_class_toc'] = get_class_toc\n    context['get_autosummary_toc'] = get_autosummary_toc\n\n\ndef setup(app):\n    # Fix bug where code isn't being highlighted\n    app.add_css_file('pygments.css')\n    app.add_css_file('custom.css')\n\n    app.connect(\"html-page-context\", custom_page_funcs)\n\n\n# Clean up generated documentation files that RTD seems to be having trouble with\nif on_rtd:\n    import shutil\n\n    shutil.rmtree('./dev/generate', ignore_errors=True)\n", "path": "docs/conf.py"}]}