Skip to content

Commit 4d8d3ac

Browse files
committed
more docs
1 parent e452243 commit 4d8d3ac

File tree

6 files changed

+31
-21
lines changed

6 files changed

+31
-21
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ or create a
2020
[pull request](https://github.com/rmorshea/idom/pulls). Thanks in advance!
2121

2222
<h3>
23-
<a href="https://mybinder.org/v2/gh/rmorshea/idom/master?filepath=examples%2Fintroduction.ipynb">
23+
<a href="https://mybinder.org/v2/gh/rmorshea/idom/master?filepath=notebooks%2Fintroduction.ipynb">
2424
Try it Now
2525
<img alt="Binder" valign="bottom" height="25px"
2626
src="https://mybinder.org/badge_logo.svg"

docs/source/api.rst

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,38 +53,31 @@ Sanic Servers
5353
Useful Tools
5454
------------
5555

56-
.. automodule:: idom.tools
56+
.. automodule:: idom.utils
5757
:members:
5858

5959

60-
Common Widgets
60+
Jupyter Widget
6161
--------------
6262

63-
.. automodule:: idom.widgets.common
63+
.. automodule:: idom.widgets.jupyter
6464
:members:
6565

6666

67-
Display Utilities
68-
-----------------
67+
HTML Widgets
68+
------------
6969

70-
.. automodule:: idom.widgets.display
70+
.. automodule:: idom.widgets.html
7171
:members:
72+
:undoc-members:
7273

73-
74-
Input Helper
74+
Widget Tools
7575
------------
7676

77-
.. automodule:: idom.widgets.inputs
77+
.. automodule:: idom.widgets.utils
7878
:members:
7979

8080

81-
HTML Nodes
82-
----------
83-
84-
.. automodule:: idom.widgets.html
85-
:members:
86-
:undoc-members:
87-
8881
Dialect
8982
-------
9083

docs/source/examples.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Simply install your javascript library of choice using the ``idom`` CLI:
135135
136136
idom install victory
137137
138-
Then import the module with :class:`idom.widgets.utils.Module`:
138+
Then import the module with :class:`~idom.widgets.utils.Module`:
139139

140140
.. literalinclude:: examples/victory_chart.py
141141

@@ -167,7 +167,7 @@ Source of ``chart.js``:
167167
Shared Client Views
168168
-------------------
169169

170-
This example requires the :ref:`idom.server.sanic.SharedClientState` server. Be sure to
170+
This example requires the :ref:`~idom.server.sanic.SharedClientStateServer`. Be sure to
171171
replace it in your boilerplate code before going further! Once you've done this we can
172172
just re-display our :ref:`Slideshow` example using the new server. Now all we need to do
173173
is connect to the server with a couple clients to see that their views are synced. This

docs/source/getting-started.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Since it's likely a lot to take in at once, we'll break it down piece by piece:
3838
3939
The ``idom.element`` decorator creates an :ref:`Element <Stateful Element>` constructor
4040
whose render function is defined by the `asynchronous function`_ below it. To create
41-
an :class:`idom.core.element.Element` instance we call ``Slideshow()`` with the same
41+
an :class:`~idom.core.element.Element` instance we call ``Slideshow()`` with the same
4242
arguments as its render function. The render function of an Element returns a data
4343
structure that depicts a user interface, or in more technical terms a Document Object
4444
Model (DOM). We call this structural representation of the DOM a `Virtual DOM`__ (VDOM)

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,4 @@ cause the widget to change 🖱️
9292
.. _pull request: https://github.com/rmorshea/idom/pulls
9393
.. _IDOM Sandbox: https://idom-sandbox.herokuapp.com
9494
.. |launch-binder| image:: https://mybinder.org/badge_logo.svg
95-
:target: https://mybinder.org/v2/gh/rmorshea/idom/master?filepath=examples%2Fintroduction.ipynb
95+
:target: https://mybinder.org/v2/gh/rmorshea/idom/master?filepath=notebooks%2Fintroduction.ipynb

idom/widgets/html.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ def image(
1515
value: Union[str, bytes] = "",
1616
attributes: Optional[Dict[str, Any]] = None,
1717
) -> VdomDict:
18+
"""Utility for constructing an image from a string or bytes
19+
20+
The source value will automatically be encoded to base64
21+
"""
1822
if format == "svg":
1923
format = "svg+xml"
2024

@@ -38,6 +42,7 @@ async def Input(
3842
cast: Optional[Callable[[str], Any]] = None,
3943
ignore_empty: bool = True,
4044
) -> VdomDict:
45+
"""Utility for making an ``<input/>`` with a callback"""
4146
attrs = attributes or {}
4247
value, set_value = idom.hooks.use_state(value)
4348

@@ -55,6 +60,14 @@ async def on_change(event: Dict[str, Any]) -> None:
5560

5661

5762
class Html:
63+
"""Utility for making basic HTML elements
64+
65+
Many basic elements already have constructors, however accessing an attribute
66+
of any name on this object will return a constructor for an element with the
67+
same ``tagName``.
68+
69+
All constructors return :class:`~idom.core.vdom.VdomDict`.
70+
"""
5871

5972
__call__ = staticmethod(component)
6073

@@ -158,3 +171,7 @@ def __getattr__(self, tag: str) -> VdomDictConstructor:
158171

159172

160173
html = Html()
174+
"""Holds pre-made constructors for basic HTML elements
175+
176+
See :class:`Html` for more info.
177+
"""

0 commit comments

Comments
 (0)