@@ -69,7 +69,7 @@ equivalent values: `["hello", 1, 2, 3]`.
69
69
class's `new` method PyScript both signals and honours this difference.
70
70
71
71
72
- ### PyDom
72
+ ## PyDom
73
73
74
74
The Standard Web APIs are massive and not always very user-friendly. ` PyDom ` is a
75
75
Python modue that exposes the power of the web with an easy and idiomatic Pythonic
@@ -97,7 +97,7 @@ easy to learn, and other successful projects related the web as well (for isntan
97
97
We welcome feedback and suggestions.
98
98
99
99
100
- #### Core Concepts
100
+ ### Core Concepts
101
101
102
102
` Pydom ` builds on topic of very few and simple core concepts:
103
103
@@ -113,13 +113,13 @@ standard HTML DOM query selectors to [locate DOM elements](https://developer.moz
113
113
114
114
Following, we'll look into each one of these aspects a bit more in detail.
115
115
116
- #### Element
116
+ ### Element
117
117
118
118
` pydom ` ` Element ` is simply just an abstraction of a tranditional ` Element ` in a web page.
119
119
Every ` Element ` always maps to an underlying ` JavaScript ` ` Element ` in a web page. These 2
120
120
elements are always in sync and any change of state in one is reflect into the other.
121
121
122
- ##### Creating a new element
122
+ #### Creating a new element
123
123
124
124
New elements can be created by using the ` pydom.create ` method and passing the type of element
125
125
being crated. Here's an example of what it looks like:
@@ -149,7 +149,7 @@ pydom['#element-creation-example'][0].append(new_div)
149
149
150
150
For more details about ` pydom.create ` please refer to its reference documentation.
151
151
152
- ##### Setting the content of an element
152
+ #### Setting the content of an element
153
153
154
154
The Element interface offers 2 main ways to set an element content: the ` html ` and the
155
155
` content ` attributes:
@@ -163,7 +163,7 @@ any conversion.
163
163
In general, we suggest using ` content ` directly as it'll take care of most use cases without
164
164
requiring any extra logic from the user.
165
165
166
- ##### Changing the element style
166
+ #### Changing the element style
167
167
168
168
Elements have a ` style ` attribute that can be used to change the element style rules.
169
169
The style attribyte can be used as a dictionary and, to set a style rule for the element,
@@ -188,7 +188,7 @@ also offers a convenient `visible` property that can be use show/hide an element
188
188
new_p.style.visible = False
189
189
```
190
190
191
- ##### Other useful aspects of the Element API
191
+ #### Other useful aspects of the Element API
192
192
193
193
* ` append ` : method to append a new child to the element.
194
194
* ` children ` : list of the children of the element.
@@ -198,7 +198,7 @@ attached to any element.
198
198
* ` show_me ` : method to scroll the page to where the element is placed.
199
199
200
200
201
- #### ElementCollection
201
+ ### ElementCollection
202
202
203
203
Element Collections represent a collection of elements typically returned from a query. For instance:
204
204
@@ -220,7 +220,7 @@ for element in paragraphs[-2:]:
220
220
display(element.html)
221
221
```
222
222
223
- ##### Interacting with an ElementCollection
223
+ #### Interacting with an ElementCollection
224
224
225
225
Besides from allowing operations as an iterable object, ` ElementCollection ` objects also offer a few
226
226
convenient methods to directly interact with th elements in the collection. For instance, it's possible
0 commit comments