Skip to content

Commit 0eb17f3

Browse files
committed
minor improvements to landing page
1 parent 019f742 commit 0eb17f3

File tree

17 files changed

+187
-75
lines changed

17 files changed

+187
-75
lines changed

docs/Dockerfile

Lines changed: 0 additions & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 9 additions & 0 deletions
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(f"Hello, World!")
7+
8+
9+
run(App)

docs/source/_exts/widget_example.py

Lines changed: 18 additions & 9 deletions
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

Lines changed: 1 addition & 9 deletions
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-
}
Lines changed: 8 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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", () =>
539 KB
Loading
1.96 MB
Loading

docs/source/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
"patched_html_translator",
6666
"widget_example",
6767
"build_custom_js",
68-
"myst_parser",
6968
]
7069

7170
# Add any paths that contain templates here, relative to this directory.

0 commit comments

Comments
 (0)