diff --git a/3.-Variables.md b/3.-Variables.md new file mode 100644 index 0000000..77eae85 --- /dev/null +++ b/3.-Variables.md @@ -0,0 +1,43 @@ +Hylia introduces Variables, a core component in many code languages not present in HTML. +To create a variable, we can use the `` tag. +A `` tag is structured as follows: + +`CoolValue` + +Now how do we use these variables? + +We can use `{{VarName}}` to call them. That's the variable name wrapped in two curly brackets `{{ }}` + +Here is a basic Hylia file using them. + +```html + + + Hello Hylia! + + Hi! + +

Hello Hylia!

+

This is an example content.

+ {{testvar}} +
+
+``` +When the file is compiled, It replaces `{{testvar}}` with the value of the `testvar` variable. +Variables can contain tags, as long as they're oneliners: +`

Hello!

` + +``` + + + Hello Hylia! + +

Hello!

+ +

Hello Hylia!

+

This is an example content.

+ {{testvar}} +
+
+``` +Compiling this file will replace `{{testvar}}` with `

Hello!

` in the output. \ No newline at end of file