package markdownish type Md struct { Atoms []Atom } type Atom interface { isMarkdownishAtom() } // type Header struct { // 1 to 6 Level int Whitespace string // TODO change to "Text []LineAtoms" Text string } func (_ *Header) isMarkdownishAtom() {} type Paragraph struct { LineAtoms []LineAtom } func (_ *Paragraph) isMarkdownishAtom() {} type LineAtom interface { isMarkdownishLineAtom() } type Text struct { Text string Code bool Italic, Bold bool /* TODO Heading, Quote int */ } func (_ *Text) isMarkdownishLineAtom() {} type Br struct {} func (_ *Br) isMarkdownishLineAtom() {} type Link struct { // Link should be a parsable URL (or an e-mail address) Text, Link, Title string } func (_ *Link) isMarkdownishLineAtom() {} // // e-mail quotes coincide syntactically with markdown blockquotes type Blockquote struct { Quoted []Atom } func (_ *Blockquote) isMarkdownishAtom() {} // TODO rename to "Codeblock" type Code struct { Lang string Text string } func (_ *Code) isMarkdownishAtom() {} /* TODO e-mail specific type Signature struct { Text string } func (_ *Signature) isMarkdownishAtom() {} */ /* TODO e-mail specific // TODO design type Attachment struct { // MIME media type with parameters; parse with mime.ParseMediaType Mediatype string Header textproto.MIMEHeader Inline bool Data []byte } func (_ *Attachment) isMarkdownishAtom() {} */