Skip to content

Commit c2d636b

Browse files
committed
Add source link to examples
1 parent 50aad58 commit c2d636b

File tree

5 files changed

+22
-6
lines changed

5 files changed

+22
-6
lines changed

examples/custom.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,7 @@ def create():
3434
ltk.Text("For clarity, we marked the custom widget orange.")
3535
.css("margin-top", 20),
3636
ltk.H4("Tip: drag the card."),
37+
ltk.Link(href="https://github.com/laffra/ltk/blob/main/examples/custom.py")
38+
.attr("target", "_blank")
39+
.text("source")
3740
).attr("name", "Custom")

examples/helloworld.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55

66
def create():
77
return (
8-
ltk.VBox(ltk.Text("Hello World 🎉"))
9-
.css("padding", 100)
10-
.css("background-color", "orange")
11-
.css("font-size", 42)
12-
.attr("name", "Hello World")
8+
ltk.VBox(
9+
ltk.Text("Hello World 🎉")
10+
.css("padding", 100)
11+
.css("background-color", "orange")
12+
.css("font-size", 42),
13+
ltk.Link(href="https://github.com/laffra/ltk/blob/main/examples/helloworld.py")
14+
.attr("target", "_blank")
15+
.text("source")
16+
).attr("name", "Hello World")
1317
)

examples/table.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ def create():
4545
],
4646
).appendTo(container)
4747

48-
container.append(ltk.H4("Tip: resize the country column using the orange handle."))
48+
container.append(
49+
ltk.H4("Tip: resize the country column using the orange handle."),
50+
ltk.Link(href="https://github.com/laffra/ltk/blob/main/examples/table.py")
51+
.attr("target", "_blank")
52+
.text("source")
53+
)
4954

5055
return container
5156

examples/tictactoe.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ def create():
5757
for row in range(3)
5858
),
5959
ltk.H4("Tip: Click inside the squares."),
60+
ltk.Link(href="https://github.com/laffra/ltk/blob/main/examples/tictactoe.py")
61+
.attr("target", "_blank")
62+
.text("source")
6063
).attr("name", "Tic Tac Toe")
6164

6265
ltk.inject(__file__, "tictactoe.css")

ltk/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
from ltk.widgets import Button
4242
from ltk.widgets import Tabs
4343
from ltk.widgets import File
44+
from ltk.widgets import Link
4445
from ltk.widgets import Table
4546
from ltk.widgets import TableRow
4647
from ltk.widgets import TableHeader

0 commit comments

Comments
 (0)