+ \post.title +
+ + Posted on \post.date by \post.author + ++ \post.content +
+diff --git a/README.md b/README.md new file mode 100644 index 0000000..49c5a2b --- /dev/null +++ b/README.md @@ -0,0 +1,58 @@ +# WL +WL is a powerful and flexible templating language for the web. + +Here's an example template in WL with a recursive comment view element: +```html +posts = [ + { + author: "UserA", + title: "I'm the first post", + content: "Sup everyone!", + comments: [ + { + author: "UserB", + content: "Hello! This is a comment!", + comments: [ + { + author: "UserA", + content: "Hello to you!", + comments: [] + } + ] + } + ] + } +] + +fun comment(c) +
\c.content
+ \for subc in c.comments: + comment(subc) ++ \post.content +
+\data.content
+ \for sub_comment in data.sub_comments: + comment(sub_comment) +