We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Hosted develop branch documentation
I think we should host the documentation for the develop branch somewhere.  Bonus points if it automatically updates every time develop changes (could be a nightly build type thing).  Extra bonus points if it also displays the documentation for open PRs.


--- 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/sphinxext/notebook_sphinxext.py`
Content:
```
1 import sys
2 import os.path
3 import re
4 import time
5 from docutils import io, nodes, statemachine, utils
6 try:
7     from docutils.utils.error_reporting import ErrorString  # the new way
8 except ImportError:
9     from docutils.error_reporting import ErrorString        # the old way
10 from docutils.parsers.rst import Directive, convert_directive_function
11 from docutils.parsers.rst import directives, roles, states
12 from docutils.parsers.rst.roles import set_classes
13 from docutils.transforms import misc
14 
15 try:
16     from IPython.nbconver.exporters import html
17 except ImportError:
18     from IPython.nbconvert import html
19 
20 
21 class Notebook(Directive):
22     """Use nbconvert to insert a notebook into the environment.
23     This is based on the Raw directive in docutils
24     """
25     required_arguments = 1
26     optional_arguments = 0
27     final_argument_whitespace = True
28     option_spec = {}
29     has_content = False
30 
31     def run(self):
32         # check if raw html is supported
33         if not self.state.document.settings.raw_enabled:
34             raise self.warning('"%s" directive disabled.' % self.name)
35 
36         # set up encoding
37         attributes = {'format': 'html'}
38         encoding = self.options.get(
39             'encoding', self.state.document.settings.input_encoding)
40         e_handler = self.state.document.settings.input_encoding_error_handler
41 
42         # get path to notebook
43         source_dir = os.path.dirname(
44             os.path.abspath(self.state.document.current_source))
45         nb_path = os.path.normpath(os.path.join(source_dir,
46                                                 self.arguments[0]))
47         nb_path = utils.relative_path(None, nb_path)
48 
49         # convert notebook to html
50         exporter = html.HTMLExporter(template_file='full')
51         output, resources = exporter.from_filename(nb_path)
52         header = output.split('<head>', 1)[1].split('</head>',1)[0]
53         body = output.split('<body>', 1)[1].split('</body>',1)[0]
54 
55         # add HTML5 scoped attribute to header style tags
56         header = header.replace('<style', '<style scoped="scoped"')
57         header = header.replace('body {\n  overflow: visible;\n  padding: 8px;\n}\n',
58                                 '')
59         header = header.replace("code,pre{", "code{")
60 
61         # Filter out styles that conflict with the sphinx theme.
62         filter_strings = [
63             'navbar',
64             'body{',
65             'alert{',
66             'uneditable-input{',
67             'collapse{',
68         ]
69 
70         filter_strings.extend(['h%s{' % (i+1) for i in range(6)])
71 
72         line_begin = [
73             'pre{',
74             'p{margin'
75         ]
76 
77         filterfunc = lambda x: not any([s in x for s in filter_strings])
78         header_lines = filter(filterfunc, header.split('\n'))
79 
80         filterfunc = lambda x: not any([x.startswith(s) for s in line_begin])
81         header_lines = filter(filterfunc, header_lines)
82 
83         header = '\n'.join(header_lines)
84 
85         # concatenate raw html lines
86         lines = ['<div class="ipynotebook">']
87         lines.append(header)
88         lines.append(body)
89         lines.append('</div>')
90         text = '\n'.join(lines)
91 
92         # add dependency
93         self.state.document.settings.record_dependencies.add(nb_path)
94         attributes['source'] = nb_path
95 
96         # create notebook node
97         nb_node = notebook('', text, **attributes)
98         (nb_node.source, nb_node.line) = \
99             self.state_machine.get_source_and_line(self.lineno)
100 
101         return [nb_node]
102 
103 
104 class notebook(nodes.raw):
105     pass
106 
107 
108 def visit_notebook_node(self, node):
109     self.visit_raw(node)
110 
111 
112 def depart_notebook_node(self, node):
113     self.depart_raw(node)
114 
115 
116 def setup(app):
117     app.add_node(notebook,
118                  html=(visit_notebook_node, depart_notebook_node))
119 
120     app.add_directive('notebook', Notebook)
121
```

Path: `docs/source/conf.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 #
3 # metasci documentation build configuration file, created by
4 # sphinx-quickstart on Sun Feb  7 22:29:49 2010.
5 #
6 # This file is execfile()d with the current directory set to its containing dir.
7 #
8 # Note that not all possible configuration values are present in this
9 # autogenerated file.
10 #
11 # All configuration values have a default; values that are commented out
12 # serve to show the default.
13 
14 import sys, os
15 
16 # If extensions (or modules to document with autodoc) are in another directory,
17 # add these directories to sys.path here. If the directory is relative to the
18 # documentation root, use os.path.abspath to make it absolute, like shown here.
19 sys.path.insert(0, os.path.abspath('../sphinxext'))
20 sys.path.insert(0, os.path.abspath('../..'))
21 
22 
23 # -- General configuration -----------------------------------------------------
24 
25 # Add any Sphinx extension module names here, as strings. They can be extensions
26 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
27 extensions = ['sphinx.ext.autodoc',
28               'sphinx.ext.napoleon',
29               'sphinx.ext.pngmath',
30               'sphinx.ext.autosummary',
31               'sphinxcontrib.tikz',
32               'sphinx_numfig',
33               'notebook_sphinxext']
34 
35 # Add any paths that contain templates here, relative to this directory.
36 templates_path = ['_templates']
37 
38 # The suffix of source filenames.
39 source_suffix = '.rst'
40 
41 # The encoding of source files.
42 #source_encoding = 'utf-8'
43 
44 # The master toctree document.
45 master_doc = 'index'
46 
47 # General information about the project.
48 project = u'OpenMC'
49 copyright = u'2011-2015, Massachusetts Institute of Technology'
50 
51 # The version info for the project you're documenting, acts as replacement for
52 # |version| and |release|, also used in various other places throughout the
53 # built documents.
54 #
55 # The short X.Y version.
56 version = "0.7"
57 # The full version, including alpha/beta/rc tags.
58 release = "0.7.1"
59 
60 # The language for content autogenerated by Sphinx. Refer to documentation
61 # for a list of supported languages.
62 #language = None
63 
64 # There are two options for replacing |today|: either, you set today to some
65 # non-false value, then it is used:
66 #today = ''
67 # Else, today_fmt is used as the format for a strftime call.
68 #today_fmt = '%B %d, %Y'
69 
70 # List of documents that shouldn't be included in the build.
71 #unused_docs = []
72 
73 # List of directories, relative to source directory, that shouldn't be searched
74 # for source files.
75 exclude_trees = []
76 
77 # The reST default role (used for this markup: `text`) to use for all documents.
78 #default_role = None
79 
80 # If true, '()' will be appended to :func: etc. cross-reference text.
81 #add_function_parentheses = True
82 
83 # If true, the current module name will be prepended to all description
84 # unit titles (such as .. function::).
85 #add_module_names = True
86 
87 # If true, sectionauthor and moduleauthor directives will be shown in the
88 # output. They are ignored by default.
89 #show_authors = False
90 
91 # The name of the Pygments (syntax highlighting) style to use.
92 #pygments_style = 'sphinx'
93 #pygments_style = 'friendly'
94 #pygments_style = 'bw'
95 #pygments_style = 'fruity'
96 #pygments_style = 'manni'
97 pygments_style = 'tango'
98 
99 
100 # A list of ignored prefixes for module index sorting.
101 #modindex_common_prefix = []
102 
103 
104 # -- Options for HTML output ---------------------------------------------------
105 
106 # The theme to use for HTML and HTML Help pages.  Major themes that come with
107 # Sphinx are currently 'default' and 'sphinxdoc'.
108 html_theme = 'haiku'
109 #html_theme = 'altered_nature'
110 #html_theme = 'sphinxdoc'
111 
112 # Theme options are theme-specific and customize the look and feel of a theme
113 # further.  For a list of options available for each theme, see the
114 # documentation.
115 html_theme_options = {'full_logo': True,
116                       'linkcolor': '#0c3762',
117                       'visitedlinkcolor': '#0c3762'}
118 
119 # Add any paths that contain custom themes here, relative to this directory.
120 #html_theme_path = ["_theme"]
121 
122 # The name for this set of Sphinx documents.  If None, it defaults to
123 # "<project> v<release> documentation".
124 html_title = "OpenMC Documentation"
125 
126 # A shorter title for the navigation bar.  Default is the same as html_title.
127 #html_short_title = None
128 
129 # The name of an image file (relative to this directory) to place at the top
130 # of the sidebar.
131 html_logo = '_images/openmc.png'
132 
133 # The name of an image file (within the static path) to use as favicon of the
134 # docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
135 # pixels large.
136 #html_favicon = None
137 
138 # Add any paths that contain custom static files (such as style sheets) here,
139 # relative to this directory. They are copied after the builtin static files,
140 # so a file named "default.css" will overwrite the builtin "default.css".
141 #html_static_path = ['_static']
142 
143 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
144 # using the given strftime format.
145 #html_last_updated_fmt = '%b %d, %Y'
146 
147 # If true, SmartyPants will be used to convert quotes and dashes to
148 # typographically correct entities.
149 #html_use_smartypants = True
150 
151 # Custom sidebar templates, maps document names to template names.
152 #html_sidebars = {}
153 
154 # Additional templates that should be rendered to pages, maps page names to
155 # template names.
156 #html_additional_pages = {}
157 
158 # If false, no module index is generated.
159 #html_use_modindex = True
160 
161 # If false, no index is generated.
162 #html_use_index = True
163 
164 # If true, the index is split into individual pages for each letter.
165 #html_split_index = False
166 
167 # If true, links to the reST sources are added to the pages.
168 #html_show_sourcelink = True
169 
170 # If true, an OpenSearch description file will be output, and all pages will
171 # contain a <link> tag referring to it.  The value of this option must be the
172 # base URL from which the finished HTML is served.
173 #html_use_opensearch = ''
174 
175 # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
176 #html_file_suffix = ''
177 
178 # Output file base name for HTML help builder.
179 htmlhelp_basename = 'openmcdoc'
180 
181 
182 
183 # -- Options for LaTeX output --------------------------------------------------
184 
185 # The paper size ('letter' or 'a4').
186 #latex_paper_size = 'letter'
187 
188 # The font size ('10pt', '11pt' or '12pt').
189 #latex_font_size = '10pt'
190 
191 # Grouping the document tree into LaTeX files. List of tuples
192 # (source start file, target name, title, author, documentclass [howto/manual]).
193 latex_documents = [
194   ('index', 'openmc.tex', u'OpenMC Documentation',
195    u'Massachusetts Institute of Technology', 'manual'),
196 ]
197 
198 latex_elements = {
199 'preamble': r"""
200 \usepackage{enumitem}
201 \usepackage{amsfonts}
202 \usepackage{amsmath}
203 \setlistdepth{99}
204 \usepackage{tikz}
205 \usetikzlibrary{shapes,snakes,shadows,arrows,calc,decorations.markings,patterns,fit,matrix,spy}
206 \usepackage{fixltx2e}
207 \hypersetup{bookmarksdepth=3}
208 \setcounter{tocdepth}{2}
209 \numberwithin{equation}{section}
210 """,
211 'printindex': r""
212 }
213 
214 # The name of an image file (relative to this directory) to place at the top of
215 # the title page.
216 #latex_logo = None
217 
218 # For "manual" documents, if this is true, then toplevel headings are parts,
219 # not chapters.
220 #latex_use_parts = False
221 
222 # Additional stuff for the LaTeX preamble.
223 #latex_preamble = ''
224 
225 # Documents to append as an appendix to all manuals.
226 #latex_appendices = []
227 
228 # If false, no module index is generated.
229 #latex_use_modindex = True
230 
231 #Autodocumentation Flags
232 #autodoc_member_order = "groupwise"
233 #autoclass_content = "both"
234 #autosummary_generate = []
235
```
--- 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/source/conf.py b/docs/source/conf.py
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -13,6 +13,26 @@
 
 import sys, os
 
+# Determine if we're on Read the Docs server
+on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
+
+# On Read the Docs, we need to mock a few third-party modules so we don't get
+# ImportErrors when building documentation
+try:
+    from unittest.mock import MagicMock
+except ImportError:
+    from mock import Mock as MagicMock
+
+
+class Mock(MagicMock):
+    @classmethod
+    def __getattr__(cls, name):
+        return Mock()
+
+MOCK_MODULES = ['numpy', 'h5py', 'pandas', 'opencg']
+sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
+
+
 # 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.
@@ -26,9 +46,8 @@
 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
 extensions = ['sphinx.ext.autodoc',
               'sphinx.ext.napoleon',
-              'sphinx.ext.pngmath',
+              'sphinx.ext.mathjax',
               'sphinx.ext.autosummary',
-              'sphinxcontrib.tikz',
               'sphinx_numfig',
               'notebook_sphinxext']
 
@@ -105,16 +124,15 @@
 
 # The theme to use for HTML and HTML Help pages.  Major themes that come with
 # Sphinx are currently 'default' and 'sphinxdoc'.
-html_theme = 'haiku'
-#html_theme = 'altered_nature'
-#html_theme = 'sphinxdoc'
-
-# Theme options are theme-specific and customize the look and feel of a theme
-# further.  For a list of options available for each theme, see the
-# documentation.
-html_theme_options = {'full_logo': True,
-                      'linkcolor': '#0c3762',
-                      'visitedlinkcolor': '#0c3762'}
+if on_rtd:
+    html_theme = 'default'
+    html_logo = '_images/openmc200px.png'
+else:
+    html_theme = 'haiku'
+    html_theme_options = {'full_logo': True,
+                          'linkcolor': '#0c3762',
+                          'visitedlinkcolor': '#0c3762'}
+    html_logo = '_images/openmc.png'
 
 # Add any paths that contain custom themes here, relative to this directory.
 #html_theme_path = ["_theme"]
@@ -126,10 +144,6 @@
 # A shorter title for the navigation bar.  Default is the same as html_title.
 #html_short_title = None
 
-# The name of an image file (relative to this directory) to place at the top
-# of the sidebar.
-html_logo = '_images/openmc.png'
-
 # The name of an image file (within the static path) to use as favicon of the
 # docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
 # pixels large.
diff --git a/docs/sphinxext/notebook_sphinxext.py b/docs/sphinxext/notebook_sphinxext.py
--- a/docs/sphinxext/notebook_sphinxext.py
+++ b/docs/sphinxext/notebook_sphinxext.py
@@ -12,10 +12,7 @@
 from docutils.parsers.rst.roles import set_classes
 from docutils.transforms import misc
 
-try:
-    from IPython.nbconver.exporters import html
-except ImportError:
-    from IPython.nbconvert import html
+from nbconvert import html
 
 
 class Notebook(Directive):

{"golden_diff": "diff --git a/docs/source/conf.py b/docs/source/conf.py\n--- a/docs/source/conf.py\n+++ b/docs/source/conf.py\n@@ -13,6 +13,26 @@\n \n import sys, os\n \n+# Determine if we're on Read the Docs server\n+on_rtd = os.environ.get('READTHEDOCS', None) == 'True'\n+\n+# On Read the Docs, we need to mock a few third-party modules so we don't get\n+# ImportErrors when building documentation\n+try:\n+    from unittest.mock import MagicMock\n+except ImportError:\n+    from mock import Mock as MagicMock\n+\n+\n+class Mock(MagicMock):\n+    @classmethod\n+    def __getattr__(cls, name):\n+        return Mock()\n+\n+MOCK_MODULES = ['numpy', 'h5py', 'pandas', 'opencg']\n+sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)\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.\n@@ -26,9 +46,8 @@\n # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.\n extensions = ['sphinx.ext.autodoc',\n               'sphinx.ext.napoleon',\n-              'sphinx.ext.pngmath',\n+              'sphinx.ext.mathjax',\n               'sphinx.ext.autosummary',\n-              'sphinxcontrib.tikz',\n               'sphinx_numfig',\n               'notebook_sphinxext']\n \n@@ -105,16 +124,15 @@\n \n # The theme to use for HTML and HTML Help pages.  Major themes that come with\n # Sphinx are currently 'default' and 'sphinxdoc'.\n-html_theme = 'haiku'\n-#html_theme = 'altered_nature'\n-#html_theme = 'sphinxdoc'\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 = {'full_logo': True,\n-                      'linkcolor': '#0c3762',\n-                      'visitedlinkcolor': '#0c3762'}\n+if on_rtd:\n+    html_theme = 'default'\n+    html_logo = '_images/openmc200px.png'\n+else:\n+    html_theme = 'haiku'\n+    html_theme_options = {'full_logo': True,\n+                          'linkcolor': '#0c3762',\n+                          'visitedlinkcolor': '#0c3762'}\n+    html_logo = '_images/openmc.png'\n \n # Add any paths that contain custom themes here, relative to this directory.\n #html_theme_path = [\"_theme\"]\n@@ -126,10 +144,6 @@\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.\n-html_logo = '_images/openmc.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.\ndiff --git a/docs/sphinxext/notebook_sphinxext.py b/docs/sphinxext/notebook_sphinxext.py\n--- a/docs/sphinxext/notebook_sphinxext.py\n+++ b/docs/sphinxext/notebook_sphinxext.py\n@@ -12,10 +12,7 @@\n from docutils.parsers.rst.roles import set_classes\n from docutils.transforms import misc\n \n-try:\n-    from IPython.nbconver.exporters import html\n-except ImportError:\n-    from IPython.nbconvert import html\n+from nbconvert import html\n \n \n class Notebook(Directive):\n", "issue": "Hosted develop branch documentation\nI think we should host the documentation for the develop branch somewhere.  Bonus points if it automatically updates every time develop changes (could be a nightly build type thing).  Extra bonus points if it also displays the documentation for open PRs.\n\n", "before_files": [{"content": "import sys\nimport os.path\nimport re\nimport time\nfrom docutils import io, nodes, statemachine, utils\ntry:\n    from docutils.utils.error_reporting import ErrorString  # the new way\nexcept ImportError:\n    from docutils.error_reporting import ErrorString        # the old way\nfrom docutils.parsers.rst import Directive, convert_directive_function\nfrom docutils.parsers.rst import directives, roles, states\nfrom docutils.parsers.rst.roles import set_classes\nfrom docutils.transforms import misc\n\ntry:\n    from IPython.nbconver.exporters import html\nexcept ImportError:\n    from IPython.nbconvert import html\n\n\nclass Notebook(Directive):\n    \"\"\"Use nbconvert to insert a notebook into the environment.\n    This is based on the Raw directive in docutils\n    \"\"\"\n    required_arguments = 1\n    optional_arguments = 0\n    final_argument_whitespace = True\n    option_spec = {}\n    has_content = False\n\n    def run(self):\n        # check if raw html is supported\n        if not self.state.document.settings.raw_enabled:\n            raise self.warning('\"%s\" directive disabled.' % self.name)\n\n        # set up encoding\n        attributes = {'format': 'html'}\n        encoding = self.options.get(\n            'encoding', self.state.document.settings.input_encoding)\n        e_handler = self.state.document.settings.input_encoding_error_handler\n\n        # get path to notebook\n        source_dir = os.path.dirname(\n            os.path.abspath(self.state.document.current_source))\n        nb_path = os.path.normpath(os.path.join(source_dir,\n                                                self.arguments[0]))\n        nb_path = utils.relative_path(None, nb_path)\n\n        # convert notebook to html\n        exporter = html.HTMLExporter(template_file='full')\n        output, resources = exporter.from_filename(nb_path)\n        header = output.split('<head>', 1)[1].split('</head>',1)[0]\n        body = output.split('<body>', 1)[1].split('</body>',1)[0]\n\n        # add HTML5 scoped attribute to header style tags\n        header = header.replace('<style', '<style scoped=\"scoped\"')\n        header = header.replace('body {\\n  overflow: visible;\\n  padding: 8px;\\n}\\n',\n                                '')\n        header = header.replace(\"code,pre{\", \"code{\")\n\n        # Filter out styles that conflict with the sphinx theme.\n        filter_strings = [\n            'navbar',\n            'body{',\n            'alert{',\n            'uneditable-input{',\n            'collapse{',\n        ]\n\n        filter_strings.extend(['h%s{' % (i+1) for i in range(6)])\n\n        line_begin = [\n            'pre{',\n            'p{margin'\n        ]\n\n        filterfunc = lambda x: not any([s in x for s in filter_strings])\n        header_lines = filter(filterfunc, header.split('\\n'))\n\n        filterfunc = lambda x: not any([x.startswith(s) for s in line_begin])\n        header_lines = filter(filterfunc, header_lines)\n\n        header = '\\n'.join(header_lines)\n\n        # concatenate raw html lines\n        lines = ['<div class=\"ipynotebook\">']\n        lines.append(header)\n        lines.append(body)\n        lines.append('</div>')\n        text = '\\n'.join(lines)\n\n        # add dependency\n        self.state.document.settings.record_dependencies.add(nb_path)\n        attributes['source'] = nb_path\n\n        # create notebook node\n        nb_node = notebook('', text, **attributes)\n        (nb_node.source, nb_node.line) = \\\n            self.state_machine.get_source_and_line(self.lineno)\n\n        return [nb_node]\n\n\nclass notebook(nodes.raw):\n    pass\n\n\ndef visit_notebook_node(self, node):\n    self.visit_raw(node)\n\n\ndef depart_notebook_node(self, node):\n    self.depart_raw(node)\n\n\ndef setup(app):\n    app.add_node(notebook,\n                 html=(visit_notebook_node, depart_notebook_node))\n\n    app.add_directive('notebook', Notebook)\n", "path": "docs/sphinxext/notebook_sphinxext.py"}, {"content": "# -*- coding: utf-8 -*-\n#\n# metasci documentation build configuration file, created by\n# sphinx-quickstart on Sun Feb  7 22:29:49 2010.\n#\n# This file is execfile()d with the current directory set to its containing dir.\n#\n# Note that not all possible configuration values are present in this\n# autogenerated file.\n#\n# All configuration values have a default; values that are commented out\n# serve to show the default.\n\nimport sys, os\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('../sphinxext'))\nsys.path.insert(0, os.path.abspath('../..'))\n\n\n# -- General configuration -----------------------------------------------------\n\n# Add any Sphinx extension module names here, as strings. They can be extensions\n# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.\nextensions = ['sphinx.ext.autodoc',\n              'sphinx.ext.napoleon',\n              'sphinx.ext.pngmath',\n              'sphinx.ext.autosummary',\n              'sphinxcontrib.tikz',\n              'sphinx_numfig',\n              'notebook_sphinxext']\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'\n\n# The encoding of source files.\n#source_encoding = 'utf-8'\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = u'OpenMC'\ncopyright = u'2011-2015, Massachusetts Institute of Technology'\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 = \"0.7\"\n# The full version, including alpha/beta/rc tags.\nrelease = \"0.7.1\"\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#language = None\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 documents that shouldn't be included in the build.\n#unused_docs = []\n\n# List of directories, relative to source directory, that shouldn't be searched\n# for source files.\nexclude_trees = []\n\n# The reST default role (used for this markup: `text`) to use for all documents.\n#default_role = None\n\n# If true, '()' will be appended to :func: etc. cross-reference text.\n#add_function_parentheses = True\n\n# If true, the current module name will be prepended to all description\n# unit titles (such as .. function::).\n#add_module_names = True\n\n# If true, sectionauthor and moduleauthor directives will be shown in the\n# output. They are ignored by default.\n#show_authors = False\n\n# The name of the Pygments (syntax highlighting) style to use.\n#pygments_style = 'sphinx'\n#pygments_style = 'friendly'\n#pygments_style = 'bw'\n#pygments_style = 'fruity'\n#pygments_style = 'manni'\npygments_style = 'tango'\n\n\n# A list of ignored prefixes for module index sorting.\n#modindex_common_prefix = []\n\n\n# -- Options for HTML output ---------------------------------------------------\n\n# The theme to use for HTML and HTML Help pages.  Major themes that come with\n# Sphinx are currently 'default' and 'sphinxdoc'.\nhtml_theme = 'haiku'\n#html_theme = 'altered_nature'\n#html_theme = 'sphinxdoc'\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.\nhtml_theme_options = {'full_logo': True,\n                      'linkcolor': '#0c3762',\n                      'visitedlinkcolor': '#0c3762'}\n\n# Add any paths that contain custom themes here, relative to this directory.\n#html_theme_path = [\"_theme\"]\n\n# The name for this set of Sphinx documents.  If None, it defaults to\n# \"<project> v<release> documentation\".\nhtml_title = \"OpenMC Documentation\"\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 = '_images/openmc.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\".\n#html_static_path = ['_static']\n\n# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,\n# using the given strftime format.\n#html_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# Custom sidebar templates, maps document names to template names.\n#html_sidebars = {}\n\n# Additional templates that should be rendered to pages, maps page names to\n# template names.\n#html_additional_pages = {}\n\n# If false, no module index is generated.\n#html_use_modindex = True\n\n# If false, no index is generated.\n#html_use_index = True\n\n# If true, the index is split into individual pages for each letter.\n#html_split_index = False\n\n# If true, links to the reST sources are added to the pages.\n#html_show_sourcelink = True\n\n# If true, an OpenSearch description file will be output, and all pages will\n# contain a <link> tag referring to it.  The value of this option must be the\n# base URL from which the finished HTML is served.\n#html_use_opensearch = ''\n\n# If nonempty, this is the file name suffix for HTML files (e.g. \".xhtml\").\n#html_file_suffix = ''\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'openmcdoc'\n\n\n\n# -- Options for LaTeX output --------------------------------------------------\n\n# The paper size ('letter' or 'a4').\n#latex_paper_size = 'letter'\n\n# The font size ('10pt', '11pt' or '12pt').\n#latex_font_size = '10pt'\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title, author, documentclass [howto/manual]).\nlatex_documents = [\n  ('index', 'openmc.tex', u'OpenMC Documentation',\n   u'Massachusetts Institute of Technology', 'manual'),\n]\n\nlatex_elements = {\n'preamble': r\"\"\"\n\\usepackage{enumitem}\n\\usepackage{amsfonts}\n\\usepackage{amsmath}\n\\setlistdepth{99}\n\\usepackage{tikz}\n\\usetikzlibrary{shapes,snakes,shadows,arrows,calc,decorations.markings,patterns,fit,matrix,spy}\n\\usepackage{fixltx2e}\n\\hypersetup{bookmarksdepth=3}\n\\setcounter{tocdepth}{2}\n\\numberwithin{equation}{section}\n\"\"\",\n'printindex': r\"\"\n}\n\n# The name of an image file (relative to this directory) to place at the top of\n# the title page.\n#latex_logo = None\n\n# For \"manual\" documents, if this is true, then toplevel headings are parts,\n# not chapters.\n#latex_use_parts = False\n\n# Additional stuff for the LaTeX preamble.\n#latex_preamble = ''\n\n# Documents to append as an appendix to all manuals.\n#latex_appendices = []\n\n# If false, no module index is generated.\n#latex_use_modindex = True\n\n#Autodocumentation Flags\n#autodoc_member_order = \"groupwise\"\n#autoclass_content = \"both\"\n#autosummary_generate = []\n", "path": "docs/source/conf.py"}], "after_files": [{"content": "import sys\nimport os.path\nimport re\nimport time\nfrom docutils import io, nodes, statemachine, utils\ntry:\n    from docutils.utils.error_reporting import ErrorString  # the new way\nexcept ImportError:\n    from docutils.error_reporting import ErrorString        # the old way\nfrom docutils.parsers.rst import Directive, convert_directive_function\nfrom docutils.parsers.rst import directives, roles, states\nfrom docutils.parsers.rst.roles import set_classes\nfrom docutils.transforms import misc\n\nfrom nbconvert import html\n\n\nclass Notebook(Directive):\n    \"\"\"Use nbconvert to insert a notebook into the environment.\n    This is based on the Raw directive in docutils\n    \"\"\"\n    required_arguments = 1\n    optional_arguments = 0\n    final_argument_whitespace = True\n    option_spec = {}\n    has_content = False\n\n    def run(self):\n        # check if raw html is supported\n        if not self.state.document.settings.raw_enabled:\n            raise self.warning('\"%s\" directive disabled.' % self.name)\n\n        # set up encoding\n        attributes = {'format': 'html'}\n        encoding = self.options.get(\n            'encoding', self.state.document.settings.input_encoding)\n        e_handler = self.state.document.settings.input_encoding_error_handler\n\n        # get path to notebook\n        source_dir = os.path.dirname(\n            os.path.abspath(self.state.document.current_source))\n        nb_path = os.path.normpath(os.path.join(source_dir,\n                                                self.arguments[0]))\n        nb_path = utils.relative_path(None, nb_path)\n\n        # convert notebook to html\n        exporter = html.HTMLExporter(template_file='full')\n        output, resources = exporter.from_filename(nb_path)\n        header = output.split('<head>', 1)[1].split('</head>',1)[0]\n        body = output.split('<body>', 1)[1].split('</body>',1)[0]\n\n        # add HTML5 scoped attribute to header style tags\n        header = header.replace('<style', '<style scoped=\"scoped\"')\n        header = header.replace('body {\\n  overflow: visible;\\n  padding: 8px;\\n}\\n',\n                                '')\n        header = header.replace(\"code,pre{\", \"code{\")\n\n        # Filter out styles that conflict with the sphinx theme.\n        filter_strings = [\n            'navbar',\n            'body{',\n            'alert{',\n            'uneditable-input{',\n            'collapse{',\n        ]\n\n        filter_strings.extend(['h%s{' % (i+1) for i in range(6)])\n\n        line_begin = [\n            'pre{',\n            'p{margin'\n        ]\n\n        filterfunc = lambda x: not any([s in x for s in filter_strings])\n        header_lines = filter(filterfunc, header.split('\\n'))\n\n        filterfunc = lambda x: not any([x.startswith(s) for s in line_begin])\n        header_lines = filter(filterfunc, header_lines)\n\n        header = '\\n'.join(header_lines)\n\n        # concatenate raw html lines\n        lines = ['<div class=\"ipynotebook\">']\n        lines.append(header)\n        lines.append(body)\n        lines.append('</div>')\n        text = '\\n'.join(lines)\n\n        # add dependency\n        self.state.document.settings.record_dependencies.add(nb_path)\n        attributes['source'] = nb_path\n\n        # create notebook node\n        nb_node = notebook('', text, **attributes)\n        (nb_node.source, nb_node.line) = \\\n            self.state_machine.get_source_and_line(self.lineno)\n\n        return [nb_node]\n\n\nclass notebook(nodes.raw):\n    pass\n\n\ndef visit_notebook_node(self, node):\n    self.visit_raw(node)\n\n\ndef depart_notebook_node(self, node):\n    self.depart_raw(node)\n\n\ndef setup(app):\n    app.add_node(notebook,\n                 html=(visit_notebook_node, depart_notebook_node))\n\n    app.add_directive('notebook', Notebook)\n", "path": "docs/sphinxext/notebook_sphinxext.py"}, {"content": "# -*- coding: utf-8 -*-\n#\n# metasci documentation build configuration file, created by\n# sphinx-quickstart on Sun Feb  7 22:29:49 2010.\n#\n# This file is execfile()d with the current directory set to its containing dir.\n#\n# Note that not all possible configuration values are present in this\n# autogenerated file.\n#\n# All configuration values have a default; values that are commented out\n# serve to show the default.\n\nimport sys, os\n\n# Determine if we're on Read the Docs server\non_rtd = os.environ.get('READTHEDOCS', None) == 'True'\n\n# On Read the Docs, we need to mock a few third-party modules so we don't get\n# ImportErrors when building documentation\ntry:\n    from unittest.mock import MagicMock\nexcept ImportError:\n    from mock import Mock as MagicMock\n\n\nclass Mock(MagicMock):\n    @classmethod\n    def __getattr__(cls, name):\n        return Mock()\n\nMOCK_MODULES = ['numpy', 'h5py', 'pandas', 'opencg']\nsys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)\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.\nsys.path.insert(0, os.path.abspath('../sphinxext'))\nsys.path.insert(0, os.path.abspath('../..'))\n\n\n# -- General configuration -----------------------------------------------------\n\n# Add any Sphinx extension module names here, as strings. They can be extensions\n# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.\nextensions = ['sphinx.ext.autodoc',\n              'sphinx.ext.napoleon',\n              'sphinx.ext.mathjax',\n              'sphinx.ext.autosummary',\n              'sphinx_numfig',\n              'notebook_sphinxext']\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'\n\n# The encoding of source files.\n#source_encoding = 'utf-8'\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = u'OpenMC'\ncopyright = u'2011-2015, Massachusetts Institute of Technology'\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 = \"0.7\"\n# The full version, including alpha/beta/rc tags.\nrelease = \"0.7.1\"\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#language = None\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 documents that shouldn't be included in the build.\n#unused_docs = []\n\n# List of directories, relative to source directory, that shouldn't be searched\n# for source files.\nexclude_trees = []\n\n# The reST default role (used for this markup: `text`) to use for all documents.\n#default_role = None\n\n# If true, '()' will be appended to :func: etc. cross-reference text.\n#add_function_parentheses = True\n\n# If true, the current module name will be prepended to all description\n# unit titles (such as .. function::).\n#add_module_names = True\n\n# If true, sectionauthor and moduleauthor directives will be shown in the\n# output. They are ignored by default.\n#show_authors = False\n\n# The name of the Pygments (syntax highlighting) style to use.\n#pygments_style = 'sphinx'\n#pygments_style = 'friendly'\n#pygments_style = 'bw'\n#pygments_style = 'fruity'\n#pygments_style = 'manni'\npygments_style = 'tango'\n\n\n# A list of ignored prefixes for module index sorting.\n#modindex_common_prefix = []\n\n\n# -- Options for HTML output ---------------------------------------------------\n\n# The theme to use for HTML and HTML Help pages.  Major themes that come with\n# Sphinx are currently 'default' and 'sphinxdoc'.\nif on_rtd:\n    html_theme = 'default'\n    html_logo = '_images/openmc200px.png'\nelse:\n    html_theme = 'haiku'\n    html_theme_options = {'full_logo': True,\n                          'linkcolor': '#0c3762',\n                          'visitedlinkcolor': '#0c3762'}\n    html_logo = '_images/openmc.png'\n\n# Add any paths that contain custom themes here, relative to this directory.\n#html_theme_path = [\"_theme\"]\n\n# The name for this set of Sphinx documents.  If None, it defaults to\n# \"<project> v<release> documentation\".\nhtml_title = \"OpenMC Documentation\"\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 (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\".\n#html_static_path = ['_static']\n\n# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,\n# using the given strftime format.\n#html_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# Custom sidebar templates, maps document names to template names.\n#html_sidebars = {}\n\n# Additional templates that should be rendered to pages, maps page names to\n# template names.\n#html_additional_pages = {}\n\n# If false, no module index is generated.\n#html_use_modindex = True\n\n# If false, no index is generated.\n#html_use_index = True\n\n# If true, the index is split into individual pages for each letter.\n#html_split_index = False\n\n# If true, links to the reST sources are added to the pages.\n#html_show_sourcelink = True\n\n# If true, an OpenSearch description file will be output, and all pages will\n# contain a <link> tag referring to it.  The value of this option must be the\n# base URL from which the finished HTML is served.\n#html_use_opensearch = ''\n\n# If nonempty, this is the file name suffix for HTML files (e.g. \".xhtml\").\n#html_file_suffix = ''\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'openmcdoc'\n\n\n\n# -- Options for LaTeX output --------------------------------------------------\n\n# The paper size ('letter' or 'a4').\n#latex_paper_size = 'letter'\n\n# The font size ('10pt', '11pt' or '12pt').\n#latex_font_size = '10pt'\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title, author, documentclass [howto/manual]).\nlatex_documents = [\n  ('index', 'openmc.tex', u'OpenMC Documentation',\n   u'Massachusetts Institute of Technology', 'manual'),\n]\n\nlatex_elements = {\n'preamble': r\"\"\"\n\\usepackage{enumitem}\n\\usepackage{amsfonts}\n\\usepackage{amsmath}\n\\setlistdepth{99}\n\\usepackage{tikz}\n\\usetikzlibrary{shapes,snakes,shadows,arrows,calc,decorations.markings,patterns,fit,matrix,spy}\n\\usepackage{fixltx2e}\n\\hypersetup{bookmarksdepth=3}\n\\setcounter{tocdepth}{2}\n\\numberwithin{equation}{section}\n\"\"\",\n'printindex': r\"\"\n}\n\n# The name of an image file (relative to this directory) to place at the top of\n# the title page.\n#latex_logo = None\n\n# For \"manual\" documents, if this is true, then toplevel headings are parts,\n# not chapters.\n#latex_use_parts = False\n\n# Additional stuff for the LaTeX preamble.\n#latex_preamble = ''\n\n# Documents to append as an appendix to all manuals.\n#latex_appendices = []\n\n# If false, no module index is generated.\n#latex_use_modindex = True\n\n#Autodocumentation Flags\n#autodoc_member_order = \"groupwise\"\n#autoclass_content = \"both\"\n#autosummary_generate = []\n", "path": "docs/source/conf.py"}]}