evp 1.0.0-beta.2

Library to work with evidence packages (*.evp).
Documentation
MarkupFile = {
    SOI ~
    MarkupLine* ~
    EOI
}

MarkupLine = _{
	Heading6 |
    Heading5 |
    Heading4 |
    Heading3 |
    Heading2 |
    Heading1 |
    Table |
    Paragraph |
    Newline
}

Newline = {
    NEWLINE+
}

Heading1 = {
	"#" ~ " "? ~ Paragraph
}

Heading2 = {
	"##" ~ " "? ~ Paragraph
}

Heading3 = {
	"###" ~ " "? ~ Paragraph
}

Heading4 = {
	"####" ~ " "? ~ Paragraph
}

Heading5 = {
	"#####" ~ " "? ~ Paragraph
}

Heading6 = {
	"######" ~ " "? ~ Paragraph
}

Paragraph = _{
	TextContent+ ~ Newline?
}

TextContent = _{
	TextBold |
    TextItalic |
    TextMonospace |
    RawText
}

TextBold = {
	"**" ~ TextContent ~ "**"
}

TextItalic = {
	("_" ~ TextContent ~ "_") |
    ("*" ~ TextContent ~ "*")
}

TextMonospace = {
	"`" ~ TextContent ~ "`"
}

Table = {
	TableRow ~
    TableAlignmentRow ~
    TableRow*
}

TableRow = ${
	"|"? ~ TableCell ~ (!("|" ~ NEWLINE) ~ "|" ~ TableCell)+ ~ "|"? ~ NEWLINE
}

TableAlignmentRow = ${
	"|"? ~ TableAlignmentCell ~ (!("|" ~ NEWLINE) ~ "|" ~ TableAlignmentCell)+ ~ "|"? ~ NEWLINE
}

TableCell = ${
	TextContent*
}

TableAlignmentCell = @{
	":"? ~ "-"+ ~ ":"?
}

RawText = @{
    (
    	((EscapeChar ~ (EscapeChar | "_" | "**" | "*" | "`" | "|")) |
    	!("*" | "_" | "`" | "|" | NEWLINE)
    ) ~ ANY)+
}

EscapeChar = { "\\" }