# .*html # # == About == # # MEL is the "Markdown Extensions Language" # It's a general metalanguage (I made) for adding custom syntax to Markdown (via awk) # The idea is it provides parsing for general constructs, and you only need to define # the names of those constructs and with what they get replaced with # # Slightly based on ftags, this system allows you to easily implement the following construts: # &(name ... &) Multiline "tag", everything inside is formatted by "name" # &{name ... &} In practice, it just replaces "&[name" and "&]" with the appropriate HTML # &[name ... &] All three can be used interchangeably, though it's preferrable if # you use the matching braces and semantically, in your "language" # square brackets are used for the largest components # curly for structural components and normal braces for styling # &:name Format/encapsulate everything until the end of the paragraph # &::name Format/encapsulate everything until the end of the line # &.name Insert standalone element as-is # # Though it's not decided (or implemented) yet, potentially there will also be: # &)-( Used to simplify cases of &(name1 ... &) &(name1 ... &) &(name1 ... &) # &}-{ into &(name1 ... &)-( ... &)-( ... &) # &]-[ Or maybe for special cases, where rather than doing something like # &{elementsList &(element1 ... &) &(element2 ... &) &} # you could simply do # &{elementsList ... &}-{ ... &}-{ ... &} # So it will surf as a separator between direct subelements BEGIN { usesMEL() newStack("mel") } function usesMEL() { MELOPEN = "o" MELCLOSE = "c" MELLINEOPEN = "lo" MELLINECLOSE = "lc" MELINSERT = "i" MELPARAGRAPH = "p" MELLINE = "l" } function printErr(message, column, columnPointer) { column = length($0) - length(lineCopy) + RSTART - 5 print "ERROR by MEL-parser.awk: " message " | Found in " FILENAME " at line " FNR " & column " column ":" > "/dev/stderr" columnPointer = "" for (i = 1; i < column; i++) columnPointer = columnPointer " " for (i = -5; i < RLENGTH; i++) columnPointer = columnPointer "^" print $0 "\n" columnPointer "\n" > "/dev/stderr" } melInsideCode && /```/ { melInsideCode = 0 } /```/ { melInsideCode = 1 } melInsideCode == 0 && /^[ \t]*(
|
|<\/p>)/, "") }