Browse code

add BokehJS and fix jupyter_sphinx warning

Bas Nijholt authored on 17/09/2020 22:19:08
Showing 1 changed files
... ...
@@ -51,7 +51,7 @@ extensions = [
51 51
     "sphinx.ext.mathjax",
52 52
     "sphinx.ext.viewcode",
53 53
     "sphinx.ext.napoleon",
54
-    "jupyter_sphinx.execute",
54
+    "jupyter_sphinx",
55 55
     "sphinx_fontawesome",
56 56
     "m2r2",
57 57
 ]
... ...
@@ -142,7 +142,10 @@ intersphinx_mapping = {
142 142
     "loky": ("https://loky.readthedocs.io/en/stable/", None),
143 143
 }
144 144
 
145
-
145
+html_js_files = [
146
+    "https://cdn.bokeh.org/bokeh/release/bokeh-2.2.1.min.js",
147
+    "https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.2.1.min.js",
148
+]
146 149
 html_logo = "logo_docs.png"
147 150
 
148 151
 
Browse code

use m2r2 in Sphinx conf

Bas Nijholt authored on 07/08/2020 13:34:30
Showing 1 changed files
... ...
@@ -53,7 +53,7 @@ extensions = [
53 53
     "sphinx.ext.napoleon",
54 54
     "jupyter_sphinx.execute",
55 55
     "sphinx_fontawesome",
56
-    "m2r",
56
+    "m2r2",
57 57
 ]
58 58
 
59 59
 source_parsers = {}
Browse code

add loky to the intersphinx_mapping

Bas Nijholt authored on 09/04/2020 19:02:42
Showing 1 changed files
... ...
@@ -139,6 +139,7 @@ intersphinx_mapping = {
139 139
     "holoviews": ("https://holoviews.org/", None),
140 140
     "ipyparallel": ("https://ipyparallel.readthedocs.io/en/stable/", None),
141 141
     "scipy": ("https://docs.scipy.org/doc/scipy/reference", None),
142
+    "loky": ("https://loky.readthedocs.io/en/stable/", None),
142 143
 }
143 144
 
144 145
 
Browse code

app.add_stylesheet -> app.add_css_file (changed in Sphinx 1.8)

https://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.add_css_file

Bas Nijholt authored on 09/04/2020 13:27:59
Showing 1 changed files
... ...
@@ -146,4 +146,4 @@ html_logo = "logo_docs.png"
146 146
 
147 147
 
148 148
 def setup(app):
149
-    app.add_stylesheet("custom.css")  # For the `live_info` widget
149
+    app.add_css_file("custom.css")  # For the `live_info` widget
Browse code

remove css and js adding in conf.py

Bas Nijholt authored on 09/04/2020 09:30:42
Showing 1 changed files
... ...
@@ -142,23 +142,8 @@ intersphinx_mapping = {
142 142
 }
143 143
 
144 144
 
145
-def get_holoviews_js_css():
146
-    from holoviews.plotting import Renderer
147
-
148
-    dependencies = {**Renderer.core_dependencies, **Renderer.extra_dependencies}
149
-    required = ["jQueryUI"]  # require, jQuery, and underscore are added by sphinx
150
-    js = [url for name in required for url in dependencies[name].get("js", [])]
151
-    css = [url for name in required for url in dependencies[name].get("css", [])]
152
-    return js, css
153
-
154
-
155
-# js, css = get_holoviews_js_css()
156
-# html_context = {"holoviews_js_files": js}  # used in source/_templates/layout.html
157
-
158 145
 html_logo = "logo_docs.png"
159 146
 
160 147
 
161 148
 def setup(app):
162
-    # for url in css:
163
-    #     app.add_stylesheet(url)
164 149
     app.add_stylesheet("custom.css")  # For the `live_info` widget
Browse code

attempt to fix documentation

Bas Nijholt authored on 08/04/2020 18:14:56
Showing 1 changed files
... ...
@@ -152,13 +152,13 @@ def get_holoviews_js_css():
152 152
     return js, css
153 153
 
154 154
 
155
-js, css = get_holoviews_js_css()
156
-html_context = {"holoviews_js_files": js}  # used in source/_templates/layout.html
155
+# js, css = get_holoviews_js_css()
156
+# html_context = {"holoviews_js_files": js}  # used in source/_templates/layout.html
157 157
 
158 158
 html_logo = "logo_docs.png"
159 159
 
160 160
 
161 161
 def setup(app):
162
-    for url in css:
163
-        app.add_stylesheet(url)
162
+    # for url in css:
163
+    #     app.add_stylesheet(url)
164 164
     app.add_stylesheet("custom.css")  # For the `live_info` widget
Browse code

run pre-commit run --all

Bas Nijholt authored on 11/12/2019 14:00:39
Showing 1 changed files
... ...
@@ -1,4 +1,3 @@
1
-# -*- coding: utf-8 -*-
2 1
 #
3 2
 # Configuration file for the Sphinx documentation builder.
4 3
 #
... ...
@@ -18,12 +17,11 @@ import sys
18 17
 package_path = os.path.abspath("../..")
19 18
 # Insert into sys.path so that we can import adaptive here
20 19
 sys.path.insert(0, package_path)
21
-
22
-import adaptive  # noqa: E402
23
-
24 20
 # Insert into PYTHONPATH so that jupyter-sphinx will pick it up
25 21
 os.environ["PYTHONPATH"] = ":".join((package_path, os.environ.get("PYTHONPATH", "")))
26 22
 
23
+import adaptive  # noqa: E402, isort:skip
24
+
27 25
 # -- Project information -----------------------------------------------------
28 26
 
29 27
 project = "adaptive"
Browse code

jupyter_execute_disable_stderr=True to not make sphinx fail on a DeprecationWarning

Bas Nijholt authored on 29/07/2019 13:10:43
Showing 1 changed files
... ...
@@ -15,10 +15,15 @@
15 15
 import os
16 16
 import sys
17 17
 
18
-sys.path.insert(0, os.path.abspath("../.."))
18
+package_path = os.path.abspath("../..")
19
+# Insert into sys.path so that we can import adaptive here
20
+sys.path.insert(0, package_path)
19 21
 
20 22
 import adaptive  # noqa: E402
21 23
 
24
+# Insert into PYTHONPATH so that jupyter-sphinx will pick it up
25
+os.environ["PYTHONPATH"] = ":".join((package_path, os.environ.get("PYTHONPATH", "")))
26
+
22 27
 # -- Project information -----------------------------------------------------
23 28
 
24 29
 project = "adaptive"
... ...
@@ -88,6 +93,7 @@ jupyter_sphinx_thebelab_config = {
88 93
     "binderOptions": {"repo": "python-adaptive/adaptive"},
89 94
 }
90 95
 
96
+jupyter_execute_disable_stderr = True
91 97
 
92 98
 # -- Options for HTML output -------------------------------------------------
93 99
 
Browse code

add thebelab

Bas Nijholt authored on 10/07/2019 19:19:58
Showing 1 changed files
... ...
@@ -22,7 +22,7 @@ import adaptive  # noqa: E402
22 22
 # -- Project information -----------------------------------------------------
23 23
 
24 24
 project = "adaptive"
25
-copyright = "2018, Adaptive Authors"
25
+copyright = "2018-2019, Adaptive Authors"
26 26
 author = "Adaptive Authors"
27 27
 
28 28
 # The short X.Y version
... ...
@@ -83,6 +83,12 @@ exclude_patterns = []
83 83
 pygments_style = "sphinx"
84 84
 
85 85
 
86
+jupyter_sphinx_thebelab_config = {
87
+    "requestKernel": True,
88
+    "binderOptions": {"repo": "python-adaptive/adaptive"},
89
+}
90
+
91
+
86 92
 # -- Options for HTML output -------------------------------------------------
87 93
 
88 94
 # The theme to use for HTML and HTML Help pages.  See the documentation for
Browse code

fix all flake8 issues and run pre-commit filters

Bas Nijholt authored on 08/05/2019 02:26:15
Showing 1 changed files
... ...
@@ -14,16 +14,16 @@
14 14
 #
15 15
 import os
16 16
 import sys
17
-sys.path.insert(0, os.path.abspath('../..'))
18 17
 
19
-import adaptive
20
-import sphinx_fontawesome
18
+sys.path.insert(0, os.path.abspath("../.."))
19
+
20
+import adaptive  # noqa: E402
21 21
 
22 22
 # -- Project information -----------------------------------------------------
23 23
 
24
-project = 'adaptive'
25
-copyright = '2018, Adaptive Authors'
26
-author = 'Adaptive Authors'
24
+project = "adaptive"
25
+copyright = "2018, Adaptive Authors"
26
+author = "Adaptive Authors"
27 27
 
28 28
 # The short X.Y version
29 29
 version = adaptive.__version__
... ...
@@ -41,31 +41,31 @@ release = adaptive.__version__
41 41
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
42 42
 # ones.
43 43
 extensions = [
44
-    'sphinx.ext.autodoc',
45
-    'sphinx.ext.autosummary',
46
-    'sphinx.ext.autosectionlabel',
47
-    'sphinx.ext.intersphinx',
48
-    'sphinx.ext.mathjax',
49
-    'sphinx.ext.viewcode',
50
-    'sphinx.ext.napoleon',
51
-    'jupyter_sphinx.execute',
52
-    'sphinx_fontawesome',
53
-    'm2r',
44
+    "sphinx.ext.autodoc",
45
+    "sphinx.ext.autosummary",
46
+    "sphinx.ext.autosectionlabel",
47
+    "sphinx.ext.intersphinx",
48
+    "sphinx.ext.mathjax",
49
+    "sphinx.ext.viewcode",
50
+    "sphinx.ext.napoleon",
51
+    "jupyter_sphinx.execute",
52
+    "sphinx_fontawesome",
53
+    "m2r",
54 54
 ]
55 55
 
56 56
 source_parsers = {}
57 57
 
58 58
 # Add any paths that contain templates here, relative to this directory.
59
-templates_path = ['_templates']
59
+templates_path = ["_templates"]
60 60
 
61 61
 # The suffix(es) of source filenames.
62 62
 # You can specify multiple suffix as a list of string:
63 63
 #
64
-source_suffix = ['.rst', '.md']
65
-#source_suffix = '.rst'
64
+source_suffix = [".rst", ".md"]
65
+# source_suffix = '.rst'
66 66
 
67 67
 # The master toctree document.
68
-master_doc = 'index'
68
+master_doc = "index"
69 69
 
70 70
 # The language for content autogenerated by Sphinx. Refer to documentation
71 71
 # for a list of supported languages.
... ...
@@ -80,7 +80,7 @@ language = None
80 80
 exclude_patterns = []
81 81
 
82 82
 # The name of the Pygments (syntax highlighting) style to use.
83
-pygments_style = 'sphinx'
83
+pygments_style = "sphinx"
84 84
 
85 85
 
86 86
 # -- Options for HTML output -------------------------------------------------
... ...
@@ -88,7 +88,7 @@ pygments_style = 'sphinx'
88 88
 # The theme to use for HTML and HTML Help pages.  See the documentation for
89 89
 # a list of builtin themes.
90 90
 #
91
-html_theme = 'sphinx_rtd_theme'
91
+html_theme = "sphinx_rtd_theme"
92 92
 
93 93
 
94 94
 # Theme options are theme-specific and customize the look and feel of a theme
... ...
@@ -100,7 +100,7 @@ html_theme = 'sphinx_rtd_theme'
100 100
 # Add any paths that contain custom static files (such as style sheets) here,
101 101
 # relative to this directory. They are copied after the builtin static files,
102 102
 # so a file named "default.css" will overwrite the builtin "default.css".
103
-html_static_path = ['_static']
103
+html_static_path = ["_static"]
104 104
 
105 105
 # Custom sidebar templates, must be a dictionary that maps document names
106 106
 # to template names.
... ...
@@ -116,39 +116,39 @@ html_static_path = ['_static']
116 116
 # -- Options for HTMLHelp output ---------------------------------------------
117 117
 
118 118
 # Output file base name for HTML help builder.
119
-htmlhelp_basename = 'adaptivedoc'
119
+htmlhelp_basename = "adaptivedoc"
120 120
 
121 121
 
122 122
 # -- Extension configuration -------------------------------------------------
123 123
 
124
-default_role = 'autolink'
124
+default_role = "autolink"
125 125
 
126 126
 intersphinx_mapping = {
127
-    'python': ('https://docs.python.org/3', None),
128
-    'distributed': ('https://distributed.readthedocs.io/en/stable/', None),
129
-    'holoviews': ('https://holoviews.org/', None),
130
-    'ipyparallel': ('https://ipyparallel.readthedocs.io/en/stable/', None),
131
-    'scipy': ('https://docs.scipy.org/doc/scipy/reference', None),
127
+    "python": ("https://docs.python.org/3", None),
128
+    "distributed": ("https://distributed.readthedocs.io/en/stable/", None),
129
+    "holoviews": ("https://holoviews.org/", None),
130
+    "ipyparallel": ("https://ipyparallel.readthedocs.io/en/stable/", None),
131
+    "scipy": ("https://docs.scipy.org/doc/scipy/reference", None),
132 132
 }
133 133
 
134 134
 
135 135
 def get_holoviews_js_css():
136 136
     from holoviews.plotting import Renderer
137
-    dependencies = {**Renderer.core_dependencies,
138
-                    **Renderer.extra_dependencies}
139
-    required = ['jQueryUI']  # require, jQuery, and underscore are added by sphinx
140
-    js = [url for name in required for url in dependencies[name].get('js', [])]
141
-    css = [url for name in required for url in dependencies[name].get('css', [])]
137
+
138
+    dependencies = {**Renderer.core_dependencies, **Renderer.extra_dependencies}
139
+    required = ["jQueryUI"]  # require, jQuery, and underscore are added by sphinx
140
+    js = [url for name in required for url in dependencies[name].get("js", [])]
141
+    css = [url for name in required for url in dependencies[name].get("css", [])]
142 142
     return js, css
143 143
 
144 144
 
145 145
 js, css = get_holoviews_js_css()
146
-html_context = {'holoviews_js_files': js}  # used in source/_templates/layout.html
146
+html_context = {"holoviews_js_files": js}  # used in source/_templates/layout.html
147 147
 
148
-html_logo = 'logo_docs.png'
148
+html_logo = "logo_docs.png"
149 149
 
150 150
 
151 151
 def setup(app):
152 152
     for url in css:
153 153
         app.add_stylesheet(url)
154
-    app.add_stylesheet('custom.css')  # For the `live_info` widget
154
+    app.add_stylesheet("custom.css")  # For the `live_info` widget
Browse code

use logo in the documentation

Bas Nijholt authored on 21/03/2019 10:29:05
Showing 1 changed files
... ...
@@ -145,6 +145,8 @@ def get_holoviews_js_css():
145 145
 js, css = get_holoviews_js_css()
146 146
 html_context = {'holoviews_js_files': js}  # used in source/_templates/layout.html
147 147
 
148
+html_logo = 'logo_docs.png'
149
+
148 150
 
149 151
 def setup(app):
150 152
     for url in css:
Browse code

do not remove JS added by Sphinx

Bas Nijholt authored on 20/03/2019 11:34:42
Showing 1 changed files
... ...
@@ -136,28 +136,17 @@ def get_holoviews_js_css():
136 136
     from holoviews.plotting import Renderer
137 137
     dependencies = {**Renderer.core_dependencies,
138 138
                     **Renderer.extra_dependencies}
139
-    required = ['jQuery', 'jQueryUI', 'underscore', 'require']
139
+    required = ['jQueryUI']  # require, jQuery, and underscore are added by sphinx
140 140
     js = [url for name in required for url in dependencies[name].get('js', [])]
141 141
     css = [url for name in required for url in dependencies[name].get('css', [])]
142 142
     return js, css
143 143
 
144 144
 
145 145
 js, css = get_holoviews_js_css()
146
-html_context = {'holoviews_js_files': js}
147
-
148
-
149
-def remove_jquery_and_underscore(app):
150
-    # We need to remove the jquery and underscore file that are
151
-    # added by default because we already add it in the <head> tag.
152
-    remove = lambda x: not any(js in x for js in ['jquery', 'underscore'])
153
-    if hasattr(app.builder, 'script_files'):
154
-        app.builder.script_files = [x for x in app.builder.script_files
155
-                                    if remove(x)]
146
+html_context = {'holoviews_js_files': js}  # used in source/_templates/layout.html
156 147
 
157 148
 
158 149
 def setup(app):
159 150
     for url in css:
160 151
         app.add_stylesheet(url)
161
-
162 152
     app.add_stylesheet('custom.css')  # For the `live_info` widget
163
-    app.connect('builder-inited', remove_jquery_and_underscore)
Browse code

remove the jquery and underscore that is added by sphinx

Closes #118

Bas Nijholt authored on 22/10/2018 12:12:17
Showing 1 changed files
... ...
@@ -50,7 +50,7 @@ extensions = [
50 50
     'sphinx.ext.napoleon',
51 51
     'jupyter_sphinx.execute',
52 52
     'sphinx_fontawesome',
53
-    'm2r'
53
+    'm2r',
54 54
 ]
55 55
 
56 56
 source_parsers = {}
... ...
@@ -136,7 +136,7 @@ def get_holoviews_js_css():
136 136
     from holoviews.plotting import Renderer
137 137
     dependencies = {**Renderer.core_dependencies,
138 138
                     **Renderer.extra_dependencies}
139
-    required = ['jQuery', 'jQueryUI', 'require']
139
+    required = ['jQuery', 'jQueryUI', 'underscore', 'require']
140 140
     js = [url for name in required for url in dependencies[name].get('js', [])]
141 141
     css = [url for name in required for url in dependencies[name].get('css', [])]
142 142
     return js, css
... ...
@@ -146,9 +146,18 @@ js, css = get_holoviews_js_css()
146 146
 html_context = {'holoviews_js_files': js}
147 147
 
148 148
 
149
+def remove_jquery_and_underscore(app):
150
+    # We need to remove the jquery and underscore file that are
151
+    # added by default because we already add it in the <head> tag.
152
+    remove = lambda x: not any(js in x for js in ['jquery', 'underscore'])
153
+    if hasattr(app.builder, 'script_files'):
154
+        app.builder.script_files = [x for x in app.builder.script_files
155
+                                    if remove(x)]
156
+
157
+
149 158
 def setup(app):
150 159
     for url in css:
151 160
         app.add_stylesheet(url)
152 161
 
153 162
     app.add_stylesheet('custom.css')  # For the `live_info` widget
154
-    app.add_javascript("https://unpkg.com/@jupyter-widgets/html-manager@0.14.4/dist/embed-amd.js")
163
+    app.connect('builder-inited', remove_jquery_and_underscore)
Browse code

load jQuery before jQueryUI to correctly display the ipywidgets

See https://stackoverflow.com/a/24946631/3447047

Bas Nijholt authored on 20/10/2018 15:24:20
Showing 1 changed files
... ...
@@ -136,7 +136,7 @@ def get_holoviews_js_css():
136 136
     from holoviews.plotting import Renderer
137 137
     dependencies = {**Renderer.core_dependencies,
138 138
                     **Renderer.extra_dependencies}
139
-    required = ['jQueryUI', 'jQuery', 'require']
139
+    required = ['jQuery', 'jQueryUI', 'require']
140 140
     js = [url for name in required for url in dependencies[name].get('js', [])]
141 141
     css = [url for name in required for url in dependencies[name].get('css', [])]
142 142
     return js, css
Browse code

documentation improvements

Bas Nijholt authored on 19/10/2018 14:19:42
Showing 1 changed files
... ...
@@ -43,6 +43,7 @@ release = adaptive.__version__
43 43
 extensions = [
44 44
     'sphinx.ext.autodoc',
45 45
     'sphinx.ext.autosummary',
46
+    'sphinx.ext.autosectionlabel',
46 47
     'sphinx.ext.intersphinx',
47 48
     'sphinx.ext.mathjax',
48 49
     'sphinx.ext.viewcode',
Browse code

add the authors to the documentation

and remove the code to find the complete author list from git because
our CI job will ensure that all the contributors will be included
in that file.

Bas Nijholt authored on 19/10/2018 13:56:19
Showing 1 changed files
... ...
@@ -49,6 +49,7 @@ extensions = [
49 49
     'sphinx.ext.napoleon',
50 50
     'jupyter_sphinx.execute',
51 51
     'sphinx_fontawesome',
52
+    'm2r'
52 53
 ]
53 54
 
54 55
 source_parsers = {}
Browse code

fix live_info css

Bas Nijholt authored on 19/10/2018 13:24:42
Showing 1 changed files
... ...
@@ -148,4 +148,5 @@ def setup(app):
148 148
     for url in css:
149 149
         app.add_stylesheet(url)
150 150
 
151
+    app.add_stylesheet('custom.css')  # For the `live_info` widget
151 152
     app.add_javascript("https://unpkg.com/@jupyter-widgets/html-manager@0.14.4/dist/embed-amd.js")
Browse code

make the examples in the docs use actual HoloViews

Bas Nijholt authored on 18/10/2018 15:43:00
Showing 1 changed files
... ...
@@ -17,7 +17,7 @@ import sys
17 17
 sys.path.insert(0, os.path.abspath('../..'))
18 18
 
19 19
 import adaptive
20
-
20
+import sphinx_fontawesome
21 21
 
22 22
 # -- Project information -----------------------------------------------------
23 23
 
... ...
@@ -48,6 +48,7 @@ extensions = [
48 48
     'sphinx.ext.viewcode',
49 49
     'sphinx.ext.napoleon',
50 50
     'jupyter_sphinx.execute',
51
+    'sphinx_fontawesome',
51 52
 ]
52 53
 
53 54
 source_parsers = {}
Browse code

simplify holoviews js and css

Bas Nijholt authored on 18/10/2018 00:48:22
Showing 1 changed files
... ...
@@ -87,6 +87,7 @@ pygments_style = 'sphinx'
87 87
 #
88 88
 html_theme = 'sphinx_rtd_theme'
89 89
 
90
+
90 91
 # Theme options are theme-specific and customize the look and feel of a theme
91 92
 # further.  For a list of options available for each theme, see the
92 93
 # documentation.
... ...
@@ -128,38 +129,22 @@ intersphinx_mapping = {
128 129
 }
129 130
 
130 131
 
131
-# -- Add Holoviews js and css ------------------------------------------------
132
-
133
-def setup(app):
132
+def get_holoviews_js_css():
134 133
     from holoviews.plotting import Renderer
134
+    dependencies = {**Renderer.core_dependencies,
135
+                    **Renderer.extra_dependencies}
136
+    required = ['jQueryUI', 'jQuery', 'require']
137
+    js = [url for name in required for url in dependencies[name].get('js', [])]
138
+    css = [url for name in required for url in dependencies[name].get('css', [])]
139
+    return js, css
135 140
 
136
-    hv_js, hv_css = Renderer.html_assets(
137
-        extras=False, backends=[], script=True)
138
-
139
-    fname_css = 'holoviews.css'
140
-    fname_js = 'holoviews.js'
141
-    static_dir = 'source/_static'
142 141
 
143
-    os.makedirs(static_dir, exist_ok=True)
142
+js, css = get_holoviews_js_css()
143
+html_context = {'holoviews_js_files': js}
144 144
 
145
-    with open(f'{static_dir}/{fname_css}', 'w') as f:
146
-        hv_css = hv_css.split('<style>')[1].replace('</style>', '')
147
-        f.write(hv_css)
148 145
 
149
-    with open(f'{static_dir}/{fname_js}', 'w') as f:
150
-        f.write(hv_js)
151
-
152
-    app.add_stylesheet(fname_css)
153
-    app.add_javascript(fname_js)
154
-
155
-    dependencies = {**Renderer.core_dependencies, **Renderer.extra_dependencies}
156
-    for name, type_url in dependencies.items():
157
-        if name in ['bootstrap']:
158
-            continue
159
-
160
-        for url in type_url.get('js', []):
161
-            app.add_javascript(url)
162
-        for url in type_url.get('css', []):
163
-            app.add_stylesheet(url)
146
+def setup(app):
147
+    for url in css:
148
+        app.add_stylesheet(url)
164 149
 
165 150
     app.add_javascript("https://unpkg.com/@jupyter-widgets/html-manager@0.14.4/dist/embed-amd.js")
Browse code

add tutorials

Bas Nijholt authored on 17/10/2018 13:30:10
Showing 1 changed files
... ...
@@ -47,6 +47,7 @@ extensions = [
47 47
     'sphinx.ext.mathjax',
48 48
     'sphinx.ext.viewcode',
49 49
     'sphinx.ext.napoleon',
50
+    'jupyter_sphinx.execute',
50 51
 ]
51 52
 
52 53
 source_parsers = {}
... ...
@@ -113,13 +114,52 @@ html_static_path = ['_static']
113 114
 # Output file base name for HTML help builder.
114 115
 htmlhelp_basename = 'adaptivedoc'
115 116
 
117
+
116 118
 # -- Extension configuration -------------------------------------------------
117 119
 
118 120
 default_role = 'autolink'
119 121
 
120
-intersphinx_mapping = {'python': ('https://docs.python.org/3', None),
121
-                       'distributed': ('https://distributed.readthedocs.io/en/stable/', None),
122
-                       'holoviews': ('https://holoviews.org/', None),
123
-                       'ipyparallel': ('https://ipyparallel.readthedocs.io/en/stable/', None),
124
-                       'scipy': ('https://docs.scipy.org/doc/scipy/reference', None),
122
+intersphinx_mapping = {
123
+    'python': ('https://docs.python.org/3', None),
124
+    'distributed': ('https://distributed.readthedocs.io/en/stable/', None),
125
+    'holoviews': ('https://holoviews.org/', None),
126
+    'ipyparallel': ('https://ipyparallel.readthedocs.io/en/stable/', None),
127
+    'scipy': ('https://docs.scipy.org/doc/scipy/reference', None),
125 128
 }
129
+
130
+
131
+# -- Add Holoviews js and css ------------------------------------------------
132
+
133
+def setup(app):
134
+    from holoviews.plotting import Renderer
135
+
136
+    hv_js, hv_css = Renderer.html_assets(
137
+        extras=False, backends=[], script=True)
138
+
139
+    fname_css = 'holoviews.css'
140
+    fname_js = 'holoviews.js'
141
+    static_dir = 'source/_static'
142
+
143
+    os.makedirs(static_dir, exist_ok=True)
144
+
145
+    with open(f'{static_dir}/{fname_css}', 'w') as f:
146
+        hv_css = hv_css.split('<style>')[1].replace('</style>', '')
147
+        f.write(hv_css)
148
+
149
+    with open(f'{static_dir}/{fname_js}', 'w') as f:
150
+        f.write(hv_js)
151
+
152
+    app.add_stylesheet(fname_css)
153
+    app.add_javascript(fname_js)
154
+
155
+    dependencies = {**Renderer.core_dependencies, **Renderer.extra_dependencies}
156
+    for name, type_url in dependencies.items():
157
+        if name in ['bootstrap']:
158
+            continue
159
+
160
+        for url in type_url.get('js', []):
161
+            app.add_javascript(url)
162
+        for url in type_url.get('css', []):
163
+            app.add_stylesheet(url)
164
+
165
+    app.add_javascript("https://unpkg.com/@jupyter-widgets/html-manager@0.14.4/dist/embed-amd.js")
Browse code

add doc files

Bas Nijholt authored on 16/10/2018 18:10:12
Showing 1 changed files
... ...
@@ -42,14 +42,14 @@ release = adaptive.__version__
42 42
 # ones.
43 43
 extensions = [
44 44
     'sphinx.ext.autodoc',
45
+    'sphinx.ext.autosummary',
46
+    'sphinx.ext.intersphinx',
45 47
     'sphinx.ext.mathjax',
46 48
     'sphinx.ext.viewcode',
47 49
     'sphinx.ext.napoleon',
48 50
 ]
49 51
 
50
-source_parsers = {
51
-   '.md': 'recommonmark.parser.CommonMarkParser',
52
-}
52
+source_parsers = {}
53 53
 
54 54
 # Add any paths that contain templates here, relative to this directory.
55 55
 templates_path = ['_templates']
... ...
@@ -114,3 +114,12 @@ html_static_path = ['_static']
114 114
 htmlhelp_basename = 'adaptivedoc'
115 115
 
116 116
 # -- Extension configuration -------------------------------------------------
117
+
118
+default_role = 'autolink'
119
+
120
+intersphinx_mapping = {'python': ('https://docs.python.org/3', None),
121
+                       'distributed': ('https://distributed.readthedocs.io/en/stable/', None),
122
+                       'holoviews': ('https://holoviews.org/', None),
123
+                       'ipyparallel': ('https://ipyparallel.readthedocs.io/en/stable/', None),
124
+                       'scipy': ('https://docs.scipy.org/doc/scipy/reference', None),
125
+}
Browse code

add markdown parser to documentation building

Also replace index.rst with a verbatim copy of the readme (for now).

Joseph Weston authored on 09/10/2018 13:58:00 • Bas Nijholt committed on 16/10/2018 18:12:39
Showing 1 changed files
... ...
@@ -47,14 +47,18 @@ extensions = [
47 47
     'sphinx.ext.napoleon',
48 48
 ]
49 49
 
50
+source_parsers = {
51
+   '.md': 'recommonmark.parser.CommonMarkParser',
52
+}
53
+
50 54
 # Add any paths that contain templates here, relative to this directory.
51 55
 templates_path = ['_templates']
52 56
 
53 57
 # The suffix(es) of source filenames.
54 58
 # You can specify multiple suffix as a list of string:
55 59
 #
56
-# source_suffix = ['.rst', '.md']
57
-source_suffix = '.rst'
60
+source_suffix = ['.rst', '.md']
61
+#source_suffix = '.rst'
58 62
 
59 63
 # The master toctree document.
60 64
 master_doc = 'index'
Browse code

add barebones documentation pages

Joseph Weston authored on 20/08/2018 17:11:01 • Bas Nijholt committed on 16/10/2018 18:12:39
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,112 @@
1
+# -*- coding: utf-8 -*-
2
+#
3
+# Configuration file for the Sphinx documentation builder.
4
+#
5
+# This file does only contain a selection of the most common options. For a
6
+# full list see the documentation:
7
+# http://www.sphinx-doc.org/en/master/config
8
+
9
+# -- Path setup --------------------------------------------------------------
10
+
11
+# If extensions (or modules to document with autodoc) are in another directory,
12
+# add these directories to sys.path here. If the directory is relative to the
13
+# documentation root, use os.path.abspath to make it absolute, like shown here.
14
+#
15
+import os
16
+import sys
17
+sys.path.insert(0, os.path.abspath('../..'))
18
+
19
+import adaptive
20
+
21
+
22
+# -- Project information -----------------------------------------------------
23
+
24
+project = 'adaptive'
25
+copyright = '2018, Adaptive Authors'
26
+author = 'Adaptive Authors'
27
+
28
+# The short X.Y version
29
+version = adaptive.__version__
30
+# The full version, including alpha/beta/rc tags
31
+release = adaptive.__version__
32
+
33
+
34
+# -- General configuration ---------------------------------------------------
35
+
36
+# If your documentation needs a minimal Sphinx version, state it here.
37
+#
38
+# needs_sphinx = '1.0'
39
+
40
+# Add any Sphinx extension module names here, as strings. They can be
41
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
42
+# ones.
43
+extensions = [
44
+    'sphinx.ext.autodoc',
45
+    'sphinx.ext.mathjax',
46
+    'sphinx.ext.viewcode',
47
+    'sphinx.ext.napoleon',
48
+]
49
+
50
+# Add any paths that contain templates here, relative to this directory.
51
+templates_path = ['_templates']
52
+
53
+# The suffix(es) of source filenames.
54
+# You can specify multiple suffix as a list of string:
55
+#
56
+# source_suffix = ['.rst', '.md']
57
+source_suffix = '.rst'
58
+
59
+# The master toctree document.
60
+master_doc = 'index'
61
+
62
+# The language for content autogenerated by Sphinx. Refer to documentation
63
+# for a list of supported languages.
64
+#
65
+# This is also used if you do content translation via gettext catalogs.
66
+# Usually you set "language" from the command line for these cases.
67
+language = None
68
+
69
+# List of patterns, relative to source directory, that match files and
70
+# directories to ignore when looking for source files.
71
+# This pattern also affects html_static_path and html_extra_path .
72
+exclude_patterns = []
73
+
74
+# The name of the Pygments (syntax highlighting) style to use.
75
+pygments_style = 'sphinx'
76
+
77
+
78
+# -- Options for HTML output -------------------------------------------------
79
+
80
+# The theme to use for HTML and HTML Help pages.  See the documentation for
81
+# a list of builtin themes.
82
+#
83
+html_theme = 'sphinx_rtd_theme'
84
+
85
+# Theme options are theme-specific and customize the look and feel of a theme
86
+# further.  For a list of options available for each theme, see the
87
+# documentation.
88
+#
89
+# html_theme_options = {}
90
+
91
+# Add any paths that contain custom static files (such as style sheets) here,
92
+# relative to this directory. They are copied after the builtin static files,
93
+# so a file named "default.css" will overwrite the builtin "default.css".
94
+html_static_path = ['_static']
95
+
96
+# Custom sidebar templates, must be a dictionary that maps document names
97
+# to template names.
98
+#
99
+# The default sidebars (for documents that don't match any pattern) are
100
+# defined by theme itself.  Builtin themes are using these templates by
101
+# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
102
+# 'searchbox.html']``.
103
+#
104
+# html_sidebars = {}
105
+
106
+
107
+# -- Options for HTMLHelp output ---------------------------------------------
108
+
109
+# Output file base name for HTML help builder.
110
+htmlhelp_basename = 'adaptivedoc'
111
+
112
+# -- Extension configuration -------------------------------------------------