Skip to content

Commit 684e323

Browse files
committed
added core concepts and beginning of the Element section
1 parent 1079d16 commit 684e323

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

docs/user-guide.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -933,23 +933,43 @@ It does not aim to replace the regular Web [Javascript] API nor to be as wide an
933933
feature parity. On the contrary, it's intentionally small and focused on the most popular
934934
use cases while still providing [a backdoor] access to the full JS API.
935935

936-
937936
`Pydom` draws inspiration from popular Python APIs/Libraries known to be friendly and
938937
easy to learn, and other successful projects related the web as well (for isntance,
939938
`JQuery` was a good source of inspiration).
940939

940+
!!! warning
941+
942+
PyDom is currently a work in progress.
943+
944+
We welcome feedback and suggestions.
945+
946+
941947
#### Core Concepts
942948

949+
`Pydom` builds on topic of very few and simple core concepts:
943950

951+
* __`Element`:__ any component that is part of a web page. This is a rough abstraction of an
952+
[HTMLElement](https://developer.mozilla.org/en-US/docs/Glossary/Element). In general,
953+
`pydom` elements always map to an underlying `HTML` `Element` in a we page
954+
* __`ElementCollection`:__ a collection of one or more `Elements`. It is a rough abstraction
955+
of a [HTMLCollection](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCollection).
956+
* __Querying:__ a method to query elements on a page based on a
957+
[selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_selectors). Pydom supports
958+
standard HTML DOM query selectors to [locate DOM elements](https://developer.mozilla.org/en-US/docs/Web/API/Document_object_model/Locating_DOM_elements_using_selectors) as other native `JavaScript` methods like
959+
`querySelector` or `querySelectorAll`.
944960

945-
The PyDom API is extensively described and demonstrated
946-
[on this PyScript page](https://fpliger.pyscriptapps.com/pyweb/latest/pydom.html).
961+
Following, we'll look into each one of these aspects a bit more in detail.
947962

948-
!!! warning
963+
##### Element
949964

950-
PyDom is currently a work in progress.
965+
`pydom` `Element` is simply just an abstraction of a tranditional `Element` in a web page.
966+
Every `Element` always maps to an underlying `JavaScript` `Element` in a web page. These 2
967+
elements are always in sync and any change of state in one is reflect into the other.
968+
969+
__ADD DIAGRAM HERE__
970+
971+
###### Creating a new element
951972

952-
We welcome feedback and suggestions.
953973

954974

955975

0 commit comments

Comments
 (0)