1. Brian Mearns
  2. templ


Brian Mearns  committed fdaf928

More tutorial work.

  • Participants
  • Parent commits fd69444
  • Branches default

Comments (0)

Files changed (1)

File templ/tutorial.templ

View file
  • Ignore whitespace
                 "hello, {echo templ}!"
-            {section "Get Used to Curly Braces!" {'
+            {section "Get Used to Curly Braces" {'
 <<<Ok, still pretty boring, but at least now we're actually writing {templ} code. There's a couple important things to notice in
 this example. For one thing, the format for invoking a function may not be what you're used to in most other languages. {templ}
 the argument {code "\"hello, templ!\""}, just like we had before.>>>
-        }} % end section "...Processor"
+            {EXAMPLE-TEMPLATE "text"
+                {implode
+<<<Of course, we can continue nesting Lists as deeply as we want to come up with some truly obnoxious code like this:>>>
+                }
+                {implode
+<<<It's probably worth mentioning at this point that all of that whitespace I added this time around is irrelvant: {templ}
+requires a whitespace character to separate adjacent String elements in a List, but you are free to add as much additional
+whitespace as you'd like, it makes no difference to {templ}. This is helpful for structuring your code in a way that is
+somewhat easier to follow. You can see in the output below that all that whitespace hasn't changed anything:>>>
+                }
+    {glue
+        {glue h e \"l\"l\"o\"}
+        ,
+        \" \"
+        {glue 
+            {glue 
+                te mp 
+                {glue l e}
+            }
+            !
+        }
+    }
+            }
+            {p {'
+                {implode <<<A few general suggestions on formating your code:>>>}
+                {ul {'
+                    {implode                    
+<<<Keep the first element of a list (the one that specifies the executable to be invoked)
+on the same line as the opening curly brace, generally with no space separating it from the brace. This makes it much
+more obvious what is being invoked.>>>
+                    }
+                }}
+            }}
+        }} % end section "...Processing Routine"
     }} %end section "Introduction"