txt2html

Converts plaintext to HTML
git clone git://src.gearsix.net/txt2html
Log | Files | Refs | Atom | README

ast.txt (572B)


      1 
      2 ast
      3 ===
      4 
      5 pseudo regex to help remember the syntax rules.
      6 
      7 \u = unicode character (note utf-x currently just using std c ascii support)
      8 \t = horizintal tab
      9 \n = newline
     10 {x} = see rule x, 'x' must be the name of a rule or it's just regex syntax
     11 
     12 node{
     13 	"\n\n"              = close open tag
     14 	"\u."               = ol,li,{list}
     15 	"[*-] "             = ul,li,{list}
     16 	"\t\u+"             = pre/
     17 	"\u\n={3,}\n"       = h1/
     18 	"\u\n-{3,}\n"       = h2/
     19 	"\u(\u|\n|\t)+\n\n" = p/
     20 }
     21 
     22 list{
     23 	"\n\n"     = '/li','/ol'
     24 	"\n\u."    = '/li','li'
     25 	"\n\u[^.]" = (hardbreaks) ? 'br/' : ' '
     26 }