require "hemingway/tag/tag_nodes" module Hemingway grammar Tag rule tag tag_start tag_type "{" sequence:( content )* "}" / tag_start vertical_space "{" vertical_height "}" / tag_start hfill spaces sequence:( !newline content )* / tag_start neatline end # All tag types will be responsible with implementing their own # html methods. This is because emph should map to a tag, # textbf should map to a tag, and so forth. rule tag_type "emph" / "texttt" / "textbf" / "textsc" end # I'm pretty annoyed at having to split this up into a different tag, # but it is kinda fundamentally different than an inline-style-type tag. # This tag is supposed to guarantee some vertical spacing, so fine. # The contents of the tag are now also a measurement of the size of the # vertical space so, yeah, different. rule vertical_space "vspace" end rule vertical_height height:[0-9]+ millimeter end rule millimeter "mm" end rule hfill "hfill" end rule neatline "neatline" end rule tag_start "\\" end rule tag_end "}" end end end