Skip to content

Instantly share code, notes, and snippets.

@thepeak99
Last active October 21, 2015 14:27
Show Gist options
  • Save thepeak99/4538a6d77bba3e32a619 to your computer and use it in GitHub Desktop.
Save thepeak99/4538a6d77bba3e32a619 to your computer and use it in GitHub Desktop.
Hash Templating Language

#Hash templating language

##Rules:

  • Non-alphanumeric characters denote end of variable/statement
  • Hashes (#) need escaping should they be needed in text, they are escaped by simply writing two hashes (##)
  • Conditions are Python expressions, hence valid Python code
  • Loops are in loops in Python, hence valid Python code too

Grammar

#var: replace var

#?(condition)#yes#no: If condition is true, show yes if not show no

#@(item in list)#item: Loop, print val iterating through list

#(block): A block, used to include several variables in a single loop or if sentence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment