Skip to content

Commit 59b1921

Browse files
committed
minor improvements to landing page
1 parent 019f742 commit 59b1921

File tree

10 files changed

+118
-68
lines changed

10 files changed

+118
-68
lines changed

docs/Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ RUN pip install --upgrade pip
1818
# Install IDOM
1919
# ------------
2020
ADD requirements ./requirements
21-
ADD .git ./.git
2221
ADD src ./src
2322
ADD scripts ./scripts
2423
ADD setup.py ./

docs/source/_custom_js/src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function mountWidgetExample(
2828
}
2929

3030
const enableWidgetButton = document.createElement("button");
31-
enableWidgetButton.appendChild(document.createTextNode("Enable Widget"));
31+
enableWidgetButton.appendChild(document.createTextNode("Activate"));
3232
enableWidgetButton.setAttribute("class", "enable-widget-button");
3333

3434
enableWidgetButton.addEventListener("click", () =>

docs/source/_examples/hello_world.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from idom import component, html, run
2+
3+
4+
@component
5+
def App():
6+
return html.h1("Hello world!")
7+
8+
9+
run(App)

docs/source/_exts/widget_example.py

+18-9
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@ class WidgetExample(SphinxDirective):
1919

2020
option_spec = {
2121
"linenos": directives.flag,
22-
"live-example-is-default-tab": directives.flag,
22+
"result-is-default-tab": directives.flag,
23+
"activate-result": directives.flag,
2324
}
2425

2526
def run(self):
2627
example_name = self.arguments[0]
2728
show_linenos = "linenos" in self.options
29+
live_example_is_default_tab = "result-is-default-tab" in self.options
30+
activate_result = "activate-result" in self.options
2831

2932
py_ex_path = examples / f"{example_name}.py"
3033
if not py_ex_path.exists():
@@ -34,26 +37,32 @@ def run(self):
3437
)
3538

3639
labeled_tab_items = {
37-
"Python Code": _literal_include_py(
40+
"python": _literal_include_py(
3841
name=example_name,
3942
linenos=show_linenos,
4043
),
41-
"Live Example": _interactive_widget(
44+
"result": _interactive_widget(
4245
name=example_name,
43-
with_activate_button="live-example-is-default-tab" not in self.options,
46+
with_activate_button=not activate_result,
4447
),
4548
}
4649

50+
labeled_tab_titles = {
51+
"python": "Python",
52+
"javascript": "Javascript",
53+
"result": "▶️ Result",
54+
}
55+
4756
if (examples / f"{example_name}.js").exists():
48-
labeled_tab_items["Javascript Code"] = _literal_include_js(
57+
labeled_tab_items["javascript"] = _literal_include_js(
4958
name=example_name,
5059
linenos=show_linenos,
5160
)
5261

5362
tab_label_order = (
54-
["Live Example", "Python Code", "Javascript Code"]
55-
if "live-example-is-default-tab" in self.options
56-
else ["Python Code", "Javascript Code", "Live Example"]
63+
["result", "python", "javascript"]
64+
if live_example_is_default_tab
65+
else ["python", "javascript", "result"]
5766
)
5867

5968
return TabSetDirective(
@@ -62,7 +71,7 @@ def run(self):
6271
{},
6372
_make_tab_items(
6473
[
65-
(label, labeled_tab_items[label])
74+
(labeled_tab_titles[label], labeled_tab_items[label])
6675
for label in tab_label_order
6776
if label in labeled_tab_items
6877
]

docs/source/_static/css/larger-headings.css

+1-9
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@ h3,
44
h4,
55
h5,
66
h6 {
7-
margin-top: 2em !important;
7+
margin-top: 1.5em !important;
88
font-weight: 900 !important;
99
}
10-
11-
h2 {
12-
font-size: 1.8em !important;
13-
}
14-
15-
h3 {
16-
font-size: 1.4em !important;
17-
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.widget-container h1,
2+
.widget-container h2,
3+
.widget-container h3,
4+
.widget-container h4,
5+
.widget-container h5,
6+
.widget-container h6 {
7+
margin: 0 !important;
8+
}

docs/source/_static/custom.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2005,7 +2005,7 @@ function mountWidgetExample(
20052005
}
20062006

20072007
const enableWidgetButton = document.createElement("button");
2008-
enableWidgetButton.appendChild(document.createTextNode("Enable Widget"));
2008+
enableWidgetButton.appendChild(document.createTextNode("Activate"));
20092009
enableWidgetButton.setAttribute("class", "enable-widget-button");
20102010

20112011
enableWidgetButton.addEventListener("click", () =>

docs/source/index.md

-36
This file was deleted.

docs/source/index.rst

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
IDOM
2+
====
3+
4+
.. toctree::
5+
:hidden:
6+
:caption: User Guide
7+
8+
getting-started/index
9+
creating-interfaces/index
10+
adding-interactivity/index
11+
managing-state/index
12+
escape-hatches/index
13+
14+
.. toctree::
15+
:hidden:
16+
:caption: Other Resources
17+
18+
understanding-idom/index
19+
contributing/index
20+
reference-material/index
21+
22+
.. toctree::
23+
:hidden:
24+
:caption: External Links
25+
26+
Source Code <https://github.com/idom-team/idom>
27+
Community <https://github.com/idom-team/idom/discussions>
28+
Issues <https://github.com/idom-team/idom/issues>
29+
30+
31+
IDOM is a powerful Python web framework for building **interactive websites without
32+
needing a single line of Javascript**. It does this by breaking down complex
33+
applications into nestable and reusable chunks of code called
34+
:ref:`"components" <Your First Component>` that allow you to focus on what your
35+
application does rather then how it does it.
36+
37+
IDOM is also ecosystem independent. It can be added to existing applications built on a
38+
variety of sync and async web servers, as well as integrate with other frameworks like
39+
Django, Jupyter, and Plotly Dash. Not only does this mean you're free to choose what
40+
technology stack to run on, but on top of that, you can run the exact same components
41+
wherever you need them. For example, you can take a component originally developed in a
42+
Jupyter Notebook and embed it in your production application without changing anything
43+
about the component itself.
44+
45+
46+
At a Glance
47+
-----------
48+
49+
To get you acquainted with IDOM, take a look at the tiny "hello world" application
50+
below:
51+
52+
.. example:: hello_world
53+
:activate-result:
54+
55+
.. note::
56+
57+
Try clicking the **▶️ Result** tab to see what this displays!
58+

docs/source/reference-material/gallery.rst

+22-11
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ Slideshow
77
Try clicking the image 🖱️
88

99
.. example:: slideshow
10-
:live-example-is-default-tab:
10+
:result-is-default-tab:
11+
:activate-result:
1112

1213

1314
Click Counter
1415
-------------
1516

1617
.. example:: click_count
17-
:live-example-is-default-tab:
18+
:result-is-default-tab:
19+
:activate-result:
1820

1921

2022
To Do List
@@ -23,7 +25,8 @@ To Do List
2325
Try typing in the text box and pressing 'Enter' 📋
2426

2527
.. example:: todo
26-
:live-example-is-default-tab:
28+
:result-is-default-tab:
29+
:activate-result:
2730

2831

2932
The Game Snake
@@ -34,7 +37,8 @@ Click to start playing and use the arrow keys to move 🎮
3437
Slow internet may cause inconsistent frame pacing 😅
3538

3639
.. example:: snake_game
37-
:live-example-is-default-tab:
40+
:result-is-default-tab:
41+
:activate-result:
3842

3943

4044
Matplotlib Plot
@@ -43,7 +47,8 @@ Matplotlib Plot
4347
Pick the polynomial coefficients (separate each coefficient by a space) 🔢:
4448

4549
.. example:: matplotlib_plot
46-
:live-example-is-default-tab:
50+
:result-is-default-tab:
51+
:activate-result:
4752

4853

4954
Simple Dashboard
@@ -52,7 +57,8 @@ Simple Dashboard
5257
Try interacting with the sliders 📈
5358

5459
.. example:: simple_dashboard
55-
:live-example-is-default-tab:
60+
:result-is-default-tab:
61+
:activate-result:
5662

5763

5864
Dynamically Loaded React Components
@@ -62,7 +68,8 @@ This method is not recommended for use in production applications, but it's grea
6268
you're experimenting:
6369

6470
.. example:: victory_chart
65-
:live-example-is-default-tab:
71+
:result-is-default-tab:
72+
:activate-result:
6673

6774

6875
Define Javascript Modules
@@ -71,7 +78,8 @@ Define Javascript Modules
7178
Shows a very simple chart implemented in vanilla Javascript:
7279

7380
.. example:: super_simple_chart
74-
:live-example-is-default-tab:
81+
:result-is-default-tab:
82+
:activate-result:
7583

7684

7785
Material UI Button
@@ -80,7 +88,8 @@ Material UI Button
8088
Click the button to change the indicator 👇
8189

8290
.. example:: material_ui_switch
83-
:live-example-is-default-tab:
91+
:result-is-default-tab:
92+
:activate-result:
8493

8594

8695
Pigeon Maps
@@ -89,7 +98,8 @@ Pigeon Maps
8998
Click the map to create pinned location 📍:
9099

91100
.. example:: pigeon_maps
92-
:live-example-is-default-tab:
101+
:result-is-default-tab:
102+
:activate-result:
93103

94104

95105
Cytoscape Network Graph
@@ -98,7 +108,8 @@ Cytoscape Network Graph
98108
You can move the nodes in the graph 🕸️:
99109

100110
.. example:: network_graph
101-
:live-example-is-default-tab:
111+
:result-is-default-tab:
112+
:activate-result:
102113

103114

104115
.. Links

0 commit comments

Comments
 (0)