Skip to content

Commit 2f8de93

Browse files
committed
switch to furo, a simpler theme
the theme allows us to use more top level sections
1 parent 3994ec0 commit 2f8de93

33 files changed

+43
-111
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/content/index.html")
23+
return response.redirect("/docs/index.html")
2424

2525

2626
mount, element = multiview()

docs/source/exts/widget_example.py renamed to docs/source/_exts/widget_example.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import textwrap
21
from pathlib import Path
32

43
from sphinx.application import Sphinx
@@ -112,7 +111,7 @@ def _literal_include_js_lines(name, linenos):
112111

113112

114113
def _string_to_nested_lines(content):
115-
return StringList(textwrap.indent(content, " ").split("\n"))
114+
return StringList(content.split("\n"))
116115

117116

118117
def setup(app: Sphinx) -> None:

docs/source/conf.py

+7-17
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
sys.path.insert(0, str(here.parent.parent))
1919

2020
# extension path
21-
sys.path.insert(0, str(here / "exts"))
21+
sys.path.insert(0, str(here / "_exts"))
2222

2323

2424
# -- Project information -----------------------------------------------------
@@ -52,6 +52,7 @@
5252
"widget_example",
5353
"async_doctest",
5454
"sphinx_panels",
55+
"sphinx_copybutton",
5556
]
5657

5758
# Add any paths that contain templates here, relative to this directory.
@@ -64,7 +65,7 @@
6465
source_suffix = ".rst"
6566

6667
# The master toctree document.
67-
master_doc = "content/index"
68+
master_doc = "index"
6869

6970
# The language for content autogenerated by Sphinx. Refer to documentation
7071
# for a list of supported languages.
@@ -104,35 +105,24 @@
104105
# The theme to use for HTML and HTML Help pages. See the documentation for
105106
# a list of builtin themes.
106107
#
107-
html_theme = "pydata_sphinx_theme"
108+
html_theme = "furo"
109+
html_logo = "branding/idom-logo.png"
108110

109111
# Theme options are theme-specific and customize the look and feel of a theme
110112
# further. For a list of options available for each theme, see the
111113
# documentation.
112114
#
113-
html_theme_options = {
114-
"github_url": "https://github.com/idom-team/idom",
115-
"use_edit_page_button": True,
116-
"show_toc_level": 2,
117-
}
118-
119-
html_context = {
120-
"github_user": "idom-team",
121-
"github_repo": "idom",
122-
"github_version": "main",
123-
"doc_path": "docs/source",
124-
}
115+
# html_theme_options = {}
125116

126117
# Add any paths that contain custom static files (such as style sheets) here,
127118
# relative to this directory. They are copied after the builtin static files,
128119
# so a file named "default.css" will overwrite the builtin "default.css".
129-
html_static_path = ["static"]
120+
html_static_path = ["_static"]
130121

131122
# These paths are either relative to html_static_path
132123
# or fully qualified paths (eg. https://...)
133124
html_css_files = [
134125
"css/interactive-widget.css",
135-
"css/fix-code-linenos.css",
136126
]
137127

138128
# Custom sidebar templates, must be a dictionary that maps document names

docs/source/content/advanced-usage/index.rst

-14
This file was deleted.

docs/source/content/api-reference/index.rst

-10
This file was deleted.

docs/source/content/user-guide/index.rst

-13
This file was deleted.

docs/source/content/advanced-usage/core-concepts.rst renamed to docs/source/core-concepts.rst

-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ Core Concepts
44
This section covers core features of IDOM that are used in making
55
interactive interfaces.
66

7-
.. contents::
8-
:local:
9-
:depth: 1
10-
117

128
Pure Elements
139
-------------

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

+6-12
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
Javascript Modules
2-
==================
1+
Custom Javascript
2+
=================
33

44
.. note::
55

66
This is a recent feature of IDOM. If you have a problem following this tutorial
77
`post an issue <https://github.com/rmorshea/idom/issues>`__.
88

9-
.. contents::
10-
:local:
11-
:depth: 1
12-
139
While IDOM is a great tool for displaying HTML and responding to browser events with
1410
pure Python, there are other projects which already allow you to do this inside
1511
`Jupyter Notebooks <https://ipywidgets.readthedocs.io/en/latest/examples/Widget%20Basics.html>`__
@@ -19,11 +15,7 @@ The real power of IDOM comes from its ability to seemlessly leverage the existin
1915
ecosystem of
2016
`React components <https://reactjs.org/docs/components-and-props.html>`__.
2117

22-
So long as your library of interest is an
23-
`ES Module <https://hacks.mozilla.org/2018/03/es-modules-a-cartoon-deep-dive/>`__
24-
you could install using
25-
`Snowpack <https://www.snowpack.dev/>`__
26-
you can use it with IDOM
18+
So long as your library of interest can be installed NPM_, you can use it with IDOM
2719
You can even define your own Javascript modules which use these third party Javascript
2820
packages.
2921

@@ -33,7 +25,7 @@ Installing React Components
3325

3426
.. note::
3527

36-
Be sure that you've installed `npm <https://www.npmjs.com/get-npm>`__.
28+
Be sure that you `install NPM`_ before continuing.
3729

3830
In this example we'll be using the ubiquitous React-based UI framework `Material UI`_
3931
which can be easily installed using the ``idom`` CLI:
@@ -95,3 +87,5 @@ under construction...
9587
.. =====
9688
9789
.. _Material UI: https://material-ui.com/
90+
.. _NPM: https://www.npmjs.com
91+
.. _install NPM: https://www.npmjs.com/get-npm

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

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
Examples
22
========
33

4-
.. contents::
5-
:local:
6-
:depth: 1
7-
84

95
Slideshow
106
---------
@@ -31,7 +27,7 @@ Try typing in the text box and pressing 'Enter' 📋
3127
The Game Snake
3228
--------------
3329

34-
Click to start playing and use WASD to move 🎮
30+
Click to start playing and use the arrow keys to move 🎮
3531

3632
Slow internet may cause inconsistent frame pacing 😅
3733

docs/source/examples/snake_game.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ def GameView():
3434

3535

3636
class Direction(enum.Enum):
37-
w = (0, -1)
38-
a = (-1, 0)
39-
s = (0, 1)
40-
d = (1, 0)
37+
ArrowUp = (0, -1)
38+
ArrowLeft = (-1, 0)
39+
ArrowDown = (0, 1)
40+
ArrowRight = (1, 0)
4141

4242

4343
@idom.element
4444
def GameLoop(grid_size, block_scale, set_game_state):
4545
# we `use_ref` here to capture the latest direction press without any delay
46-
direction = idom.hooks.use_ref(Direction.d.value)
46+
direction = idom.hooks.use_ref(Direction.ArrowRight.value)
4747

4848
snake, set_snake = idom.hooks.use_state([(grid_size // 2 - 1, grid_size // 2 - 1)])
4949
food, set_food = use_snake_food(grid_size, snake)

docs/source/content/advanced-usage/extra-features.rst renamed to docs/source/extra-features.rst

-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ Extra Features
33

44
Optionally installable features of IDOM.
55

6-
.. contents::
7-
:local:
8-
:depth: 1
9-
106
To install a **stable** set of features for IDOM simply run.
117

128
.. code-block::

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

+19-10
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
1-
IDOM |release|
2-
==============
3-
4-
.. image:: branding/idom-logo.png
5-
:height: 250px
1+
IDOM
2+
====
63

74
Libraries for defining and controlling interactive webpages with Python
85
3.7 and above.
96

107
.. toctree::
11-
:maxdepth: 1
12-
13-
user-guide/index
8+
:hidden:
9+
:caption: User Guide
10+
11+
installation
12+
getting-started
13+
life-cycle-hooks
14+
core-concepts
15+
custom-javascript
1416
examples
15-
advanced-usage/index
16-
api-reference/index
17+
18+
.. toctree::
19+
:hidden:
20+
:caption: Reference
21+
22+
GitHub <https://github.com/idom-team/idom>
23+
package-api
24+
specifications
25+
extra-features
1726

1827

1928
Early Days

docs/source/content/user-guide/installation.rst renamed to docs/source/installation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Installation
2121
2222
idom install some-js-package
2323
24-
For more info see the :ref:`Javascript Modules` section.
24+
For more info see the :ref:`Custom Javascript` section.
2525

2626
* - Extra Features
2727

docs/source/content/user-guide/life-cycle-hooks.rst renamed to docs/source/life-cycle-hooks.rst

-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ cases the :ref:`Basic Hooks` should be enough, however the remaining
1313
`In the future <https://github.com/idom-team/idom/issues/203>`_ they will be
1414
added, but if you have a particular need for a missing hook post an issue.
1515

16-
.. contents::
17-
:local:
18-
:depth: 2
19-
2016

2117
Basic Hooks
2218
===========

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

-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
Package API
22
===========
33

4-
.. contents::
5-
:local:
6-
:depth: 1
7-
84
.. module:: idom
95

106

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

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ created by `Nteract <https://nteract.io>`_ and which was built into
1010
for VDOM is fairly well established, it should not be relied until it's been fully
1111
adopted by the aforementioned organizations.
1212

13-
.. contents::
14-
:local:
15-
:depth: 1
16-
1713

1814
VDOM Mimetype
1915
-------------

requirements/docs.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
sphinx ==2.2.0
22
sphinx-autodoc-typehints ==1.7.0
3-
pydata-sphinx-theme ==0.4.1
3+
furo ==2020.10.13b12
44
sphinx-panels ==0.5.0
55
setuptools_scm
6+
sphinx-copybutton ==0.3.0

0 commit comments

Comments
 (0)