-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
36 lines (32 loc) · 817 Bytes
/
example.py
File metadata and controls
36 lines (32 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from Perry import component, pageView, styleGlobal, styles, serve, Composite
from Perry.components import Label
# Create our pages, we want them to inherit pageView behaviour
Homepage = component(pageView, _Inherit = True)
About = component(pageView, _Inherit = True)
# Create page contens
HomepageContents = (
# Our first hello world!
Label('Hello World!', 'h1'),
# Then we can place some other stuff
Label('Bye!', 'p')
)
# Assign page contents
Homepage <= {
'title': 'Home',
'path':'',
'style': styleGlobal(
styles.all['basic']
),
'DOM': pageView.DOM,
'components': HomepageContents
}
About <= {
'title': 'About',
'path':'about',
'style': styleGlobal(
styles.all['basic']
),
'DOM': Homepage
}
# Serve our pages as a composite collection
serve <= Composite(Homepage, About)