Copyright | (c) Ogma Project 2016 |
---|---|
License | MIT |
Stability | experimental |
Safe Haskell | Safe |
Language | Haskell2010 |
An abstract representation of an ogmarkup document.
Documentation
type Document a = [Section a] Source #
A ogmarkup document internal representation waiting to be used in order to generate an output.
A Section within an ogmarkup document is a sequence of paragraphs. It can be part of the story or an aside section like a letter, a song, etc. We make the distinction between the two cases because we want to be able to apply different style depending on the situation.
A Component is either a narrative text, a character's line of dialogue or a character's inner thought.
We also embed an error Component in case we fail to parse a valid component. This way, we can resume parsing when we meet a new paragraph.
A character's line of dialogue. A reply may contain a descriptive part, which is not part of what the character actually says or thinks. We call the latter a "with say" reply untill someone gives use a better name for it.
A nested formatted text
An Atom is the atomic component of a Ogmarkup document. It can be either a punctuation mark or a word, that is a string.
Note that, by construction, OpenQuote
and CloseQuote
are not valid
Mark
values here. Indeed, they are implicit with the Quote
constructor. This design allows the parser to enforce that an opened quote
needs to be closed.
Word a | A wrapped string |
Punctuation Mark | A punctuation mark |
Mostly in order to deal with typographic spaces, main punctuation marks are tokenized during the parsing of an Ogmarkup document.
Semicolon | The character |
Colon | The character |
Question | The character |
Exclamation | The character |
OpenQuote | The character |
CloseQuote | The character |
Dash | The character – or the sequence |
LongDash | The character — or the sequence |
Comma | The character |
Point | The character |
Hyphen | The character |
SuspensionPoints | Two or more |
Apostrophe | The characters |
Interrobang | The strange character |
Irony | The character |