Skip to content

Commit 7849fb9

Browse files
committed
Add example notebooks for components, conditionals, expressions, looping, and static strings
2 parents 1fa1329 + 9ec0556 commit 7849fb9

File tree

10 files changed

+342
-90
lines changed

10 files changed

+342
-90
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,7 @@ clean-playground:
5151
.PHONY: check-jq
5252
check-jq:
5353
which jq || (echo "jq is not installed. Please install jq to continue." && exit 1)
54+
55+
convert-tdom-examples-to-ipynb:
56+
python tools/convert_py_to_ipynb.py
57+
@echo "Converted tdom examples to ipynb format."

content/components.ipynb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"id": "9304aabd",
7+
"metadata": {},
8+
"outputs": [],
9+
"source": [
10+
"\"\"\"Examples that show components.\"\"\""
11+
]
12+
}
13+
],
14+
"metadata": {
15+
"jupytext": {
16+
"cell_metadata_filter": "-all",
17+
"main_language": "python",
18+
"notebook_metadata_filter": "-all",
19+
"text_representation": {
20+
"extension": ".py",
21+
"format_name": "light"
22+
}
23+
}
24+
},
25+
"nbformat": 4,
26+
"nbformat_minor": 5
27+
}

content/conditionals.ipynb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"id": "5a3719e8",
7+
"metadata": {},
8+
"outputs": [],
9+
"source": [
10+
"\"\"\"Examples that show conditionals.\"\"\""
11+
]
12+
}
13+
],
14+
"metadata": {
15+
"jupytext": {
16+
"cell_metadata_filter": "-all",
17+
"main_language": "python",
18+
"notebook_metadata_filter": "-all",
19+
"text_representation": {
20+
"extension": ".py",
21+
"format_name": "light"
22+
}
23+
}
24+
},
25+
"nbformat": 4,
26+
"nbformat_minor": 5
27+
}

content/expressions.ipynb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"id": "17d48718",
7+
"metadata": {},
8+
"outputs": [],
9+
"source": [
10+
"\"\"\"Examples that show expressions.\"\"\""
11+
]
12+
}
13+
],
14+
"metadata": {
15+
"jupytext": {
16+
"cell_metadata_filter": "-all",
17+
"main_language": "python",
18+
"notebook_metadata_filter": "-all",
19+
"text_representation": {
20+
"extension": ".py",
21+
"format_name": "light"
22+
}
23+
}
24+
},
25+
"nbformat": 4,
26+
"nbformat_minor": 5
27+
}

content/looping.ipynb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"id": "9278e4bc",
7+
"metadata": {},
8+
"outputs": [],
9+
"source": [
10+
"\"\"\"Examples that show looping.\"\"\""
11+
]
12+
}
13+
],
14+
"metadata": {
15+
"jupytext": {
16+
"cell_metadata_filter": "-all",
17+
"main_language": "python",
18+
"notebook_metadata_filter": "-all",
19+
"text_representation": {
20+
"extension": ".py",
21+
"format_name": "light"
22+
}
23+
}
24+
},
25+
"nbformat": 4,
26+
"nbformat_minor": 5
27+
}

content/static_string.ipynb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"id": "e7487082",
7+
"metadata": {},
8+
"outputs": [],
9+
"source": [
10+
"\"\"\"Examples that show static strings.\"\"\""
11+
]
12+
}
13+
],
14+
"metadata": {
15+
"jupytext": {
16+
"cell_metadata_filter": "-all",
17+
"main_language": "python",
18+
"notebook_metadata_filter": "-all",
19+
"text_representation": {
20+
"extension": ".py",
21+
"format_name": "light"
22+
}
23+
}
24+
},
25+
"nbformat": 4,
26+
"nbformat_minor": 5
27+
}

content/variables.ipynb

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"id": "c647fe48",
7+
"metadata": {},
8+
"outputs": [],
9+
"source": [
10+
"\"\"\"Examples that show variables.\"\"\""
11+
]
12+
},
13+
{
14+
"cell_type": "code",
15+
"execution_count": null,
16+
"id": "f24f5def",
17+
"metadata": {},
18+
"outputs": [],
19+
"source": [
20+
"name = \"viewdom\""
21+
]
22+
}
23+
],
24+
"metadata": {
25+
"jupytext": {
26+
"cell_metadata_filter": "-all",
27+
"main_language": "python",
28+
"notebook_metadata_filter": "-all",
29+
"text_representation": {
30+
"extension": ".py",
31+
"format_name": "light"
32+
}
33+
}
34+
},
35+
"nbformat": 4,
36+
"nbformat_minor": 5
37+
}

0 commit comments

Comments
 (0)