1. Before Starting
2. Project Setup
5. Living Room
** end of list **
Before jumping straight into complete tutorial, let's just ponder upon a few things first. Currently, there are a handful of popular web frameworks and libraries out there, with their fair shares of usage in the market. And each of them have a peculiar templating syntax. Many devs do feel that the syntax of one of the libraries is more intuitive compared to that of the others. Taking that into consideration, it's only fair that you delve into Maya's syntax first.
Just have a look into both HTML and Maya syntaxes. Hopefully, just by seeing and comparing them you would intuitively find a mapping pattern (from HTML to Maya).
<div
id="container"
class="parent-class card"
>
<h3>My Blog Title</h3>
<p
style="background-color: yellow;"
>
Highlighted Paragraph.
</p>
<p>Normal Paragraph.</p>
<ul>
Some list items
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<ul>
</div>
m.Div({
id: "container",
class: "parent-class card",
children: [
m.H3("My Blog Title"),
m.P({
style: "background-color: yellow;",
children: "Highlighted Paragraph.",
}),
m.P("Normal Paragraph."),
m.Ul([
"Some list items",
m.Li("Item 1"),
m.Li("Item 2"),
m.Li("Item 3"),
]),
],
})
You might still be confused about how to use this syntax. How to create components using this? How to use a component in the app? Or, how to create an app or a page in the app using this? Don't worry. As that will be covered in later chapters. For all other syntax rules, please check documentation here. The basic rules mentioned above is enough for now for getting started.