Skip to content

Commit 7847839

Browse files
committed
switch to the pydata sphinx theme
1 parent de5b043 commit 7847839

28 files changed

+66
-27
lines changed

docs/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
@app.route("/")
2222
async def forward_to_index(request):
23-
return response.redirect("/docs/index.html")
23+
return response.redirect("/docs/content/index.html")
2424

2525

2626
mount, element = multiview()

docs/source/conf.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
source_suffix = ".rst"
6565

6666
# The master toctree document.
67-
master_doc = "index"
67+
master_doc = "content/index"
6868

6969
# The language for content autogenerated by Sphinx. Refer to documentation
7070
# for a list of supported languages.
@@ -95,7 +95,7 @@
9595
# The theme to use for HTML and HTML Help pages. See the documentation for
9696
# a list of builtin themes.
9797
#
98-
html_theme = "sphinx_rtd_theme"
98+
html_theme = "pydata_sphinx_theme"
9999

100100
# Theme options are theme-specific and customize the look and feel of a theme
101101
# further. For a list of options available for each theme, see the
@@ -110,7 +110,11 @@
110110

111111
# These paths are either relative to html_static_path
112112
# or fully qualified paths (eg. https://...)
113-
html_css_files = ["css/interactive-widget.css"]
113+
html_css_files = [
114+
"css/interactive-widget.css",
115+
"css/custom-max-width.css",
116+
"css/fix-code-linenos.css",
117+
]
114118

115119
# Custom sidebar templates, must be a dictionary that maps document names
116120
# to template names.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Advanced Usage
2+
==============
3+
4+
Explains the high level abstractions of IDOM like layouts, distpatchers and servers as
5+
well as more advanced features that allow you to import existing or custom javascript
6+
into your IDOM views. If you're just getting started check out the :ref:`User Guide`
7+
first before you dive in here.
8+
9+
.. toctree::
10+
:maxdepth: 1
11+
12+
core-concepts
13+
javascript-modules
14+
extra-features

docs/source/javascript-modules.rst renamed to docs/source/content/advanced-usage/javascript-modules.rst

+2-6
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,8 @@ hook in a module of your own making on the fly. As before, we'll be using a
7777
parameter which is a file-like object. In the following example we'll use Victory again,
7878
but this time we'll add a callback to it. Unfortunately we can't just pass it in
7979
:ref:`like we did before <Passing Props To Components>` because Victory's event API
80-
is a bit more complex so we've implemented a quick wrapper for it in a file ``chart.js``.
81-
82-
.. literalinclude:: examples/custom_chart.js
83-
:language: javascript
84-
85-
Which we can read in as a ``source`` to :class:`~idom.widgets.utils.Module`:
80+
is a bit more complex so we've implemented a quick wrapper for it in a file ``chart.js``
81+
which we can read in as a ``source`` to :class:`~idom.widgets.utils.Module`:
8682

8783
Click the bars to trigger an event 👇
8884

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
API Reference
2+
=============
3+
4+
Detailed explanations of classes, functions, and protocols used by IDOM.
5+
6+
.. toctree::
7+
:maxdepth: 1
8+
9+
package-api
10+
specifications

docs/source/api.rst renamed to docs/source/content/api-reference/package-api.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
API
2-
===
1+
Package API
2+
===========
33

44
.. contents::
55
:local:
File renamed without changes.

docs/source/index.rst renamed to docs/source/content/index.rst

+3-8
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,10 @@ Libraries for defining and controlling interactive webpages with Python
1010
.. toctree::
1111
:maxdepth: 1
1212

13-
installation
14-
getting-started
15-
core-concepts
16-
life-cycle-hooks
17-
javascript-modules
18-
specifications
19-
extra-features
13+
user-guide/index
2014
examples
21-
api
15+
advanced-usage/index
16+
api-reference/index
2217

2318

2419
Early Days

docs/source/getting-started.rst renamed to docs/source/content/user-guide/getting-started.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Let's look at the example that you may have seen
99

1010
Since it's likely a lot to take in at once, we'll break it down piece by piece:
1111

12-
.. literalinclude:: examples/slideshow.py
12+
.. literalinclude:: /examples/slideshow.py
1313
:lineno-start: 4
1414
:lines: 4-5
1515
:linenos:
@@ -25,7 +25,7 @@ will return a VDOM representing an image which, when clicked, will change.
2525

2626
__ https://reactjs.org/docs/faq-internals.html#what-is-the-virtual-dom
2727

28-
.. literalinclude:: examples/slideshow.py
28+
.. literalinclude:: /examples/slideshow.py
2929
:lineno-start: 6
3030
:lines: 6
3131
:linenos:
@@ -41,7 +41,7 @@ that let's you update that value. In the case of ``Slideshow`` the value of the
4141
function allow us to change it. The one required argument of ``use_state`` is the
4242
*initial* state value.
4343

44-
.. literalinclude:: examples/slideshow.py
44+
.. literalinclude:: /examples/slideshow.py
4545
:lineno-start: 8
4646
:lines: 8,9
4747
:linenos:
@@ -61,7 +61,7 @@ again, and its new result will be displayed.
6161

6262
__ https://reactjs.org/docs/events.html
6363

64-
.. literalinclude:: examples/slideshow.py
64+
.. literalinclude:: /examples/slideshow.py
6565
:lineno-start: 11
6666
:lines: 11-16
6767
:linenos:
@@ -73,7 +73,7 @@ can respond to it. We've also added a little bit of CSS styling to the image so
7373
when the cursor hoverse over the image it will become a pointer so it appears clickable.
7474
The returned model conforms to the `VDOM mimetype specification`_.
7575

76-
.. literalinclude:: examples/slideshow.py
76+
.. literalinclude:: /examples/slideshow.py
7777
:lineno-start: 20
7878
:lines: 20
7979
:linenos:
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
User Guide
2+
==========
3+
4+
This guide is intended as an introductory overview of IDOM and explains how to install
5+
and make use of its most important features. For detailed usage and reference
6+
documentation see the :ref:`Advanced Usage` or :ref:`API Reference` sections respectively.
7+
8+
.. toctree::
9+
:maxdepth: 1
10+
11+
installation
12+
getting-started
13+
life-cycle-hooks
14+
examples

docs/source/exts/widget_example.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def _literal_include_js_lines(name, linenos):
105105

106106

107107
_literal_include_template = """
108-
.. literalinclude:: examples/{name}.{ext}
108+
.. literalinclude:: /examples/{name}.{ext}
109109
:language: {language}
110110
{linenos}
111111
"""
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.container-xl {
2+
max-width: 1400px !important;
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
td.linenos pre {
2+
padding: 10px !important;
3+
}

requirements/docs.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
sphinx ==2.2.0
22
sphinx-autodoc-typehints ==1.7.0
3-
sphinx-rtd-theme ==0.4.3
3+
pydata-sphinx-theme ==0.4.1
44
sphinx-panels ==0.5.0
55
setuptools_scm

sys

Whitespace-only changes.

0 commit comments

Comments
 (0)