2015-07-06 16:27:49     cblgh   i was looking at one of your repos before bed
2015-07-06 16:28:45     cblgh   and then i dreamt about GRESHUNKELs
2015-07-06 16:29:02     cblgh   in which they were watermelon sized croissants, with layers of chocolate
2015-07-06 16:29:07     cblgh   and cost 4.2k SEK
2015-07-06 16:29:10     cblgh   why wally
			
lykkin | xbox syntax is the only reason i use greshunkel over other templating languages
			

GRESHUNKEL is a templating language. And a static site generator. It's actually three different templating languages. I guess technically theres a fourth version as well which we use for docstring generation. It's complicated. Here, just have this table comparing the features of each implementation:

When you're done looking at it and being confused, you can check out specifics and more in-depth documentation over here.

Static Site Generator (Python) shithouse.tv variant (Lua) 38-Moths Official (C)
Variable Interpolation xXx @VARIABLE_NAME xXx* xXx VARIABLE_NAME xXx** xXx @VARIABLE_NAME xXx
Arrays/Loops
xXx LOOP i items xXx
...
xXx BBL xXx
***
xXx LOOP i items xXx
...
xXx BBL xXx
*****
Filter Functions yYy filter_function ... yYy XxX filter_func ... XxX****
Template Inheritance xXx PARENT=templates/base.html xXx
Blocks
xXx BLOCK_NAME xXx
...
xXx TTYL xXx
Partial templates (inclusion)
xXx SCREAM _include.html xXx
Sub-objects (Dictionaries) xXx sub_object$name xXx xXx @sub_object.name xXx
Array Indexing xXx sub_object$0 xXx
Looping through sub-objects
xXx LOOP param sub_object$params xXx
******
"Unless" operator
yYy unless [not] MUSIC_SRC yYy
xXx UNLESSS <NOT> @variable xXx
...
xXx ENDLESS xXx

Caveats:

  • * Variables are interpolated differently inside of loops. I don't remember how at the moment, but they are.
  • ** If a variable doesn't exist in this variant, the whole line is not rendered. This is important.
  • *** Loops do a bunch of weird stuff to syntax. Sometimes things will work, and sometimes they won't. It's a chance to experiment!
  • **** Notice that the Xs are alternated here, not to be confused with variable interpolation.
  • ***** I don't think you can do loops inside of loops in this version. I don't remember.
  • ****** This only works if the name of the variable you're looping through on the sub-object is called 'params'.