We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
spurious sphinx warnings due to duplicate labels in included files
### Observed behavior
<!--
Description of the behavior that was observed, including screenshots or other references when applicable
-->

```
/Users/d/Projects/learning_equality/repos/k2/docs/install/advanced.rst:13: WARNING: duplicate label advanced-installation, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/install.rst
/Users/d/Projects/learning_equality/repos/k2/docs/install/advanced.rst:21: WARNING: duplicate label pip-installation, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/install.rst
/Users/d/Projects/learning_equality/repos/k2/docs/install/advanced.rst:51: WARNING: duplicate label raspberry-pi-wifi, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/install.rst
/Users/d/Projects/learning_equality/repos/k2/docs/install/advanced.rst:31: WARNING: duplicate label ppa-installation, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/install.rst
/Users/d/Projects/learning_equality/repos/k2/docs/install/android.rst:13: WARNING: duplicate label apk, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/install.rst
/Users/d/Projects/learning_equality/repos/k2/docs/install/initial_setup.rst:14: WARNING: duplicate label setup_initial, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/install.rst
```

and 

```
/Users/d/Projects/learning_equality/repos/k2/docs/manage_classes.rst:73: WARNING: duplicate label enroll_new_users_class, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/manage.rst
/Users/d/Projects/learning_equality/repos/k2/docs/manage_classes.rst:14: WARNING: duplicate label manage_classes_ref, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/manage.rst
/Users/d/Projects/learning_equality/repos/k2/docs/manage_content.rst:13: WARNING: duplicate label manage_content_ref, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/manage.rst
/Users/d/Projects/learning_equality/repos/k2/docs/manage_data.rst:13: WARNING: duplicate label manage_data_ref, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/manage.rst
/Users/d/Projects/learning_equality/repos/k2/docs/manage_device.rst:68: WARNING: duplicate label device_info, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/manage.rst
/Users/d/Projects/learning_equality/repos/k2/docs/manage_device.rst:13: WARNING: duplicate label manage_device_ref, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/manage.rst
/Users/d/Projects/learning_equality/repos/k2/docs/manage_device.rst:24: WARNING: duplicate label permissions, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/manage.rst
/Users/d/Projects/learning_equality/repos/k2/docs/manage_exams.rst:14: WARNING: duplicate label manage_exams, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/coach.rst
/Users/d/Projects/learning_equality/repos/k2/docs/manage_facility.rst:13: WARNING: duplicate label manage_facility_ref, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/manage.rst
/Users/d/Projects/learning_equality/repos/k2/docs/manage_groups.rst:14: WARNING: duplicate label manage_groups, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/coach.rst
/Users/d/Projects/learning_equality/repos/k2/docs/manage_users.rst:13: WARNING: duplicate label manage_users_ref, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/manage.rst
/Users/d/Projects/learning_equality/repos/k2/docs/user_roles.rst:13: WARNING: duplicate label user_roles, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/manage.rst

```

these 'partial' files are also built into individual HTML files

### Expected behavior

only the master file should be built

### User-facing consequences

none, but bad for devs


### Context

https://github.com/learningequality/kolibri/issues/2598


--- 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 # -*- coding: utf-8 -*-
2 #
3 # Kolibri 'user docs' documentation build configuration file
4 #
5 # This file is execfile()d with the current directory set to its containing dir.
6 
7 
8 from datetime import datetime
9 import os
10 import sys
11 
12 
13 # If extensions (or modules to document with autodoc) are in another directory,
14 # add these directories to sys.path here. If the directory is relative to the
15 # documentation root, use os.path.abspath to make it absolute, like shown here.
16 cwd = os.getcwd()
17 parent = os.path.dirname(cwd)
18 sys.path.insert(0, os.path.abspath(parent))
19 
20 # This import *must* come after the path insertion, otherwise sphinx won't be able to find the kolibri module
21 import kolibri  # noqa
22 
23 builddir = os.path.join(cwd, '_build')
24 
25 # When we start loading stuff from kolibri, we're gonna need this
26 os.environ.setdefault("DJANGO_SETTINGS_MODULE", "kolibri.deployment.default.settings.base")
27 os.environ["KOLIBRI_HOME"] = os.path.join(builddir, 'kolibri_home')
28 
29 if not os.path.exists(os.environ["KOLIBRI_HOME"]):
30     os.mkdir(os.environ["KOLIBRI_HOME"])
31 
32 
33 # -- General configuration -----------------------------------------------------
34 
35 linkcheck_ignore = [
36     'https://groups.google.com/a/learningequality.org/forum/#!forum/dev',
37 ]
38 
39 # Add any paths that contain templates here, relative to this directory.
40 templates_path = ['_templates']
41 
42 # The suffix(es) of source filenames.
43 # You can specify multiple suffix as a list of string:
44 source_suffix = ['.rst', '.md']
45 
46 # The master toctree document.
47 master_doc = 'index'
48 
49 # General information about the project.
50 project = u'Kolibri'
51 copyright = u'{year:d}, Learning Equality'.format(year=datetime.now().year)
52 
53 # The version info for the project you're documenting, acts as replacement for
54 # |version| and |release|, also used in various other places throughout the
55 # built documents.
56 #
57 # The short X.Y version.
58 version = kolibri.__version__
59 # The full version, including alpha/beta/rc tags.
60 release = kolibri.__version__
61 
62 # List of patterns, relative to source directory, that match files and
63 # directories to ignore when looking for source files.
64 exclude_patterns = ['_build']
65 
66 # The name of the Pygments (syntax highlighting) style to use.
67 pygments_style = 'sphinx'
68 
69 
70 # -- Options for HTML output ---------------------------------------------------
71 
72 # The theme to use for HTML and HTML Help pages.  See the documentation for
73 # a list of builtin themes.
74 html_theme = 'default'
75 on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
76 
77 
78 if on_rtd:
79     os.system("sphinx-apidoc --doc-project='Python Reference' -f -o . ../kolibri ../kolibri/test ../kolibri/deployment/ ../kolibri/dist/")
80 
81 if not on_rtd:  # only import and set the theme if we're building docs locally
82     import sphinx_rtd_theme
83     html_theme = 'sphinx_rtd_theme'
84     html_theme_path = ['.', sphinx_rtd_theme.get_html_theme_path()]
85 
86 # Theme options are theme-specific and customize the look and feel of a theme
87 # further.  For a list of options available for each theme, see the
88 # documentation.
89 # html_theme_options = {}
90 
91 # Add any paths that contain custom themes here, relative to this directory.
92 # html_theme_path = []
93 
94 # The name for this set of Sphinx documents.  If None, it defaults to
95 # "<project> v<release> documentation".
96 # html_title = None
97 
98 # A shorter title for the navigation bar.  Default is the same as html_title.
99 # html_short_title = None
100 
101 # The name of an image file (relative to this directory) to place at the top
102 # of the sidebar.
103 html_logo = 'logo.png'
104 
105 # The name of an image file (within the static path) to use as favicon of the
106 # docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
107 # pixels large.
108 # html_favicon = None
109 
110 # Add any paths that contain custom static files (such as style sheets) here,
111 # relative to this directory. They are copied after the builtin static files,
112 # so a file named "default.css" will overwrite the builtin "default.css".
113 html_static_path = ['_static']
114 
115 
116 # This should be commented back in for wide tables
117 # See: https://github.com/rtfd/readthedocs.org/issues/2116
118 # and: https://github.com/rtfd/sphinx_rtd_theme/pull/432
119 
120 # html_context = {
121 #     'css_files': [
122 #         '_static/theme_overrides.css',  # override wide tables in RTD theme
123 #     ],
124 # }
125 
126 # Approach for custom stylesheet:
127 # adapted from: http://rackerlabs.github.io/docs-rackspace/tools/rtd-tables.html
128 # and https://github.com/altair-viz/altair/pull/418/files
129 # https://github.com/rtfd/sphinx_rtd_theme/issues/117
130 def setup(app):
131     # Add our custom CSS overrides
132     app.add_stylesheet('theme_overrides.css')
133 
134 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
135 # using the given strftime format.
136 html_last_updated_fmt = '%b %d, %Y'
137 
138 # If true, SmartyPants will be used to convert quotes and dashes to
139 # typographically correct entities.
140 # html_use_smartypants = True
141 
142 # If true, links to the reST sources are added to the pages.
143 html_show_sourcelink = False
144 
145 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
146 html_show_sphinx = False
147 
148 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
149 html_show_copyright = False
150 
151 # Output file base name for HTML help builder.
152 htmlhelp_basename = 'kolibri-user'
153 
154 rst_prolog = """
155 .. role:: raw-html(raw)
156       :format: html
157 
158 .. |content| replace:: :raw-html:`<span class="fa fa-th" aria-hidden="true"></span><span class="visuallyhidden">Content</span>`
159 .. |info| replace:: :raw-html:`<span class="fa fa-info fa-border" aria-hidden="true"></span><span class="visuallyhidden">Info</span>`
160 .. |lock| replace:: :raw-html:`<span class="fa fa-lock" aria-hidden="true"></span><span class="visuallyhidden">Permissions</span>`
161 
162 """
163 
164 
165 # -- Options for manual page output --------------------------------------------
166 
167 # One entry per manual page. List of tuples
168 # (source start file, name, description, authors, manual section).
169 man_pages = [
170     ('index', 'kolibri', u'Kolibri Documentation',
171      [u'Learning Equality'], 1)
172 ]
173 
174 # If true, show URL addresses after external links.
175 # man_show_urls = False
176 
177 
178 # -- I18N ----------------------------------------------------------------------
179 
180 # The language for content autogenerated by Sphinx. Refer to documentation
181 # for a list of supported languages.
182 # language = None
183 
184 locale_dirs = [
185     os.path.join(os.getcwd(), "locale", "docs"),
186 ]
187
```
--- 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
@@ -61,7 +61,7 @@
 
 # List of patterns, relative to source directory, that match files and
 # directories to ignore when looking for source files.
-exclude_patterns = ['_build']
+exclude_patterns = ['_build', '**/_*.rst']
 
 # The name of the Pygments (syntax highlighting) style to use.
 pygments_style = 'sphinx'

{"golden_diff": "diff --git a/docs/conf.py b/docs/conf.py\n--- a/docs/conf.py\n+++ b/docs/conf.py\n@@ -61,7 +61,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 = ['_build']\n+exclude_patterns = ['_build', '**/_*.rst']\n \n # The name of the Pygments (syntax highlighting) style to use.\n pygments_style = 'sphinx'\n", "issue": "spurious sphinx warnings due to duplicate labels in included files\n### Observed behavior\r\n<!--\r\nDescription of the behavior that was observed, including screenshots or other references when applicable\r\n-->\r\n\r\n```\r\n/Users/d/Projects/learning_equality/repos/k2/docs/install/advanced.rst:13: WARNING: duplicate label advanced-installation, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/install.rst\r\n/Users/d/Projects/learning_equality/repos/k2/docs/install/advanced.rst:21: WARNING: duplicate label pip-installation, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/install.rst\r\n/Users/d/Projects/learning_equality/repos/k2/docs/install/advanced.rst:51: WARNING: duplicate label raspberry-pi-wifi, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/install.rst\r\n/Users/d/Projects/learning_equality/repos/k2/docs/install/advanced.rst:31: WARNING: duplicate label ppa-installation, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/install.rst\r\n/Users/d/Projects/learning_equality/repos/k2/docs/install/android.rst:13: WARNING: duplicate label apk, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/install.rst\r\n/Users/d/Projects/learning_equality/repos/k2/docs/install/initial_setup.rst:14: WARNING: duplicate label setup_initial, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/install.rst\r\n```\r\n\r\nand \r\n\r\n```\r\n/Users/d/Projects/learning_equality/repos/k2/docs/manage_classes.rst:73: WARNING: duplicate label enroll_new_users_class, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/manage.rst\r\n/Users/d/Projects/learning_equality/repos/k2/docs/manage_classes.rst:14: WARNING: duplicate label manage_classes_ref, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/manage.rst\r\n/Users/d/Projects/learning_equality/repos/k2/docs/manage_content.rst:13: WARNING: duplicate label manage_content_ref, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/manage.rst\r\n/Users/d/Projects/learning_equality/repos/k2/docs/manage_data.rst:13: WARNING: duplicate label manage_data_ref, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/manage.rst\r\n/Users/d/Projects/learning_equality/repos/k2/docs/manage_device.rst:68: WARNING: duplicate label device_info, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/manage.rst\r\n/Users/d/Projects/learning_equality/repos/k2/docs/manage_device.rst:13: WARNING: duplicate label manage_device_ref, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/manage.rst\r\n/Users/d/Projects/learning_equality/repos/k2/docs/manage_device.rst:24: WARNING: duplicate label permissions, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/manage.rst\r\n/Users/d/Projects/learning_equality/repos/k2/docs/manage_exams.rst:14: WARNING: duplicate label manage_exams, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/coach.rst\r\n/Users/d/Projects/learning_equality/repos/k2/docs/manage_facility.rst:13: WARNING: duplicate label manage_facility_ref, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/manage.rst\r\n/Users/d/Projects/learning_equality/repos/k2/docs/manage_groups.rst:14: WARNING: duplicate label manage_groups, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/coach.rst\r\n/Users/d/Projects/learning_equality/repos/k2/docs/manage_users.rst:13: WARNING: duplicate label manage_users_ref, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/manage.rst\r\n/Users/d/Projects/learning_equality/repos/k2/docs/user_roles.rst:13: WARNING: duplicate label user_roles, other instance in /Users/d/Projects/learning_equality/repos/k2/docs/manage.rst\r\n\r\n```\r\n\r\nthese 'partial' files are also built into individual HTML files\r\n\r\n### Expected behavior\r\n\r\nonly the master file should be built\r\n\r\n### User-facing consequences\r\n\r\nnone, but bad for devs\r\n\r\n\r\n### Context\r\n\r\nhttps://github.com/learningequality/kolibri/issues/2598\r\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n#\n# Kolibri 'user docs' documentation build configuration file\n#\n# This file is execfile()d with the current directory set to its containing dir.\n\n\nfrom datetime import datetime\nimport os\nimport sys\n\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.\ncwd = os.getcwd()\nparent = os.path.dirname(cwd)\nsys.path.insert(0, os.path.abspath(parent))\n\n# This import *must* come after the path insertion, otherwise sphinx won't be able to find the kolibri module\nimport kolibri  # noqa\n\nbuilddir = os.path.join(cwd, '_build')\n\n# When we start loading stuff from kolibri, we're gonna need this\nos.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"kolibri.deployment.default.settings.base\")\nos.environ[\"KOLIBRI_HOME\"] = os.path.join(builddir, 'kolibri_home')\n\nif not os.path.exists(os.environ[\"KOLIBRI_HOME\"]):\n    os.mkdir(os.environ[\"KOLIBRI_HOME\"])\n\n\n# -- General configuration -----------------------------------------------------\n\nlinkcheck_ignore = [\n    'https://groups.google.com/a/learningequality.org/forum/#!forum/dev',\n]\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# The suffix(es) of source filenames.\n# You can specify multiple suffix as a list of string:\nsource_suffix = ['.rst', '.md']\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = u'Kolibri'\ncopyright = u'{year:d}, Learning Equality'.format(year=datetime.now().year)\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 = kolibri.__version__\n# The full version, including alpha/beta/rc tags.\nrelease = kolibri.__version__\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\nexclude_patterns = ['_build']\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'sphinx'\n\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.\nhtml_theme = 'default'\non_rtd = os.environ.get('READTHEDOCS', None) == 'True'\n\n\nif on_rtd:\n    os.system(\"sphinx-apidoc --doc-project='Python Reference' -f -o . ../kolibri ../kolibri/test ../kolibri/deployment/ ../kolibri/dist/\")\n\nif not on_rtd:  # only import and set the theme if we're building docs locally\n    import sphinx_rtd_theme\n    html_theme = 'sphinx_rtd_theme'\n    html_theme_path = ['.', sphinx_rtd_theme.get_html_theme_path()]\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further.  For a list of options available for each theme, see the\n# documentation.\n# html_theme_options = {}\n\n# Add any paths that contain custom themes here, relative to this directory.\n# html_theme_path = []\n\n# The name for this set of Sphinx documents.  If None, it defaults to\n# \"<project> v<release> documentation\".\n# html_title = None\n\n# A shorter title for the navigation bar.  Default is the same as html_title.\n# html_short_title = None\n\n# The name of an image file (relative to this directory) to place at the top\n# of the sidebar.\nhtml_logo = 'logo.png'\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# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = ['_static']\n\n\n# This should be commented back in for wide tables\n# See: https://github.com/rtfd/readthedocs.org/issues/2116\n# and: https://github.com/rtfd/sphinx_rtd_theme/pull/432\n\n# html_context = {\n#     'css_files': [\n#         '_static/theme_overrides.css',  # override wide tables in RTD theme\n#     ],\n# }\n\n# Approach for custom stylesheet:\n# adapted from: http://rackerlabs.github.io/docs-rackspace/tools/rtd-tables.html\n# and https://github.com/altair-viz/altair/pull/418/files\n# https://github.com/rtfd/sphinx_rtd_theme/issues/117\ndef setup(app):\n    # Add our custom CSS overrides\n    app.add_stylesheet('theme_overrides.css')\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# If true, SmartyPants will be used to convert quotes and dashes to\n# typographically correct entities.\n# html_use_smartypants = True\n\n# If true, links to the reST sources are added to the pages.\nhtml_show_sourcelink = False\n\n# If true, \"Created using Sphinx\" is shown in the HTML footer. Default is True.\nhtml_show_sphinx = False\n\n# If true, \"(C) Copyright ...\" is shown in the HTML footer. Default is True.\nhtml_show_copyright = False\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'kolibri-user'\n\nrst_prolog = \"\"\"\n.. role:: raw-html(raw)\n      :format: html\n\n.. |content| replace:: :raw-html:`<span class=\"fa fa-th\" aria-hidden=\"true\"></span><span class=\"visuallyhidden\">Content</span>`\n.. |info| replace:: :raw-html:`<span class=\"fa fa-info fa-border\" aria-hidden=\"true\"></span><span class=\"visuallyhidden\">Info</span>`\n.. |lock| replace:: :raw-html:`<span class=\"fa fa-lock\" aria-hidden=\"true\"></span><span class=\"visuallyhidden\">Permissions</span>`\n\n\"\"\"\n\n\n# -- Options for manual page output --------------------------------------------\n\n# One entry per manual page. List of tuples\n# (source start file, name, description, authors, manual section).\nman_pages = [\n    ('index', 'kolibri', u'Kolibri Documentation',\n     [u'Learning Equality'], 1)\n]\n\n# If true, show URL addresses after external links.\n# man_show_urls = False\n\n\n# -- I18N ----------------------------------------------------------------------\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n# language = None\n\nlocale_dirs = [\n    os.path.join(os.getcwd(), \"locale\", \"docs\"),\n]\n", "path": "docs/conf.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n#\n# Kolibri 'user docs' documentation build configuration file\n#\n# This file is execfile()d with the current directory set to its containing dir.\n\n\nfrom datetime import datetime\nimport os\nimport sys\n\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.\ncwd = os.getcwd()\nparent = os.path.dirname(cwd)\nsys.path.insert(0, os.path.abspath(parent))\n\n# This import *must* come after the path insertion, otherwise sphinx won't be able to find the kolibri module\nimport kolibri  # noqa\n\nbuilddir = os.path.join(cwd, '_build')\n\n# When we start loading stuff from kolibri, we're gonna need this\nos.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"kolibri.deployment.default.settings.base\")\nos.environ[\"KOLIBRI_HOME\"] = os.path.join(builddir, 'kolibri_home')\n\nif not os.path.exists(os.environ[\"KOLIBRI_HOME\"]):\n    os.mkdir(os.environ[\"KOLIBRI_HOME\"])\n\n\n# -- General configuration -----------------------------------------------------\n\nlinkcheck_ignore = [\n    'https://groups.google.com/a/learningequality.org/forum/#!forum/dev',\n]\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# The suffix(es) of source filenames.\n# You can specify multiple suffix as a list of string:\nsource_suffix = ['.rst', '.md']\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = u'Kolibri'\ncopyright = u'{year:d}, Learning Equality'.format(year=datetime.now().year)\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 = kolibri.__version__\n# The full version, including alpha/beta/rc tags.\nrelease = kolibri.__version__\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\nexclude_patterns = ['_build', '**/_*.rst']\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'sphinx'\n\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.\nhtml_theme = 'default'\non_rtd = os.environ.get('READTHEDOCS', None) == 'True'\n\n\nif on_rtd:\n    os.system(\"sphinx-apidoc --doc-project='Python Reference' -f -o . ../kolibri ../kolibri/test ../kolibri/deployment/ ../kolibri/dist/\")\n\nif not on_rtd:  # only import and set the theme if we're building docs locally\n    import sphinx_rtd_theme\n    html_theme = 'sphinx_rtd_theme'\n    html_theme_path = ['.', sphinx_rtd_theme.get_html_theme_path()]\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further.  For a list of options available for each theme, see the\n# documentation.\n# html_theme_options = {}\n\n# Add any paths that contain custom themes here, relative to this directory.\n# html_theme_path = []\n\n# The name for this set of Sphinx documents.  If None, it defaults to\n# \"<project> v<release> documentation\".\n# html_title = None\n\n# A shorter title for the navigation bar.  Default is the same as html_title.\n# html_short_title = None\n\n# The name of an image file (relative to this directory) to place at the top\n# of the sidebar.\nhtml_logo = 'logo.png'\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# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = ['_static']\n\n\n# This should be commented back in for wide tables\n# See: https://github.com/rtfd/readthedocs.org/issues/2116\n# and: https://github.com/rtfd/sphinx_rtd_theme/pull/432\n\n# html_context = {\n#     'css_files': [\n#         '_static/theme_overrides.css',  # override wide tables in RTD theme\n#     ],\n# }\n\n# Approach for custom stylesheet:\n# adapted from: http://rackerlabs.github.io/docs-rackspace/tools/rtd-tables.html\n# and https://github.com/altair-viz/altair/pull/418/files\n# https://github.com/rtfd/sphinx_rtd_theme/issues/117\ndef setup(app):\n    # Add our custom CSS overrides\n    app.add_stylesheet('theme_overrides.css')\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# If true, SmartyPants will be used to convert quotes and dashes to\n# typographically correct entities.\n# html_use_smartypants = True\n\n# If true, links to the reST sources are added to the pages.\nhtml_show_sourcelink = False\n\n# If true, \"Created using Sphinx\" is shown in the HTML footer. Default is True.\nhtml_show_sphinx = False\n\n# If true, \"(C) Copyright ...\" is shown in the HTML footer. Default is True.\nhtml_show_copyright = False\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'kolibri-user'\n\nrst_prolog = \"\"\"\n.. role:: raw-html(raw)\n      :format: html\n\n.. |content| replace:: :raw-html:`<span class=\"fa fa-th\" aria-hidden=\"true\"></span><span class=\"visuallyhidden\">Content</span>`\n.. |info| replace:: :raw-html:`<span class=\"fa fa-info fa-border\" aria-hidden=\"true\"></span><span class=\"visuallyhidden\">Info</span>`\n.. |lock| replace:: :raw-html:`<span class=\"fa fa-lock\" aria-hidden=\"true\"></span><span class=\"visuallyhidden\">Permissions</span>`\n\n\"\"\"\n\n\n# -- Options for manual page output --------------------------------------------\n\n# One entry per manual page. List of tuples\n# (source start file, name, description, authors, manual section).\nman_pages = [\n    ('index', 'kolibri', u'Kolibri Documentation',\n     [u'Learning Equality'], 1)\n]\n\n# If true, show URL addresses after external links.\n# man_show_urls = False\n\n\n# -- I18N ----------------------------------------------------------------------\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n# language = None\n\nlocale_dirs = [\n    os.path.join(os.getcwd(), \"locale\", \"docs\"),\n]\n", "path": "docs/conf.py"}]}