Taking standards to new lows.
option = string "option" >> ws >> OptionAnnotation <$> optionName <*> optionType <*> optionDefault
optionName = many1 (alphaNum <|> char ':') <* ws <?> "option name"
optionType = many1 alphaNum <* ws <?> "option type"
+ -- BUG: this is not optional, it would seem (see tests/fixtures/vim/options.vim)
optionDefault = optionMaybe word <?> "option default value"
plugin = string "plugin" >> ws >> PluginAnnotation <$> pluginName <*> plugInDescription
List ls -> nodes ls >>= nl
ListItem l -> fmap ("- " ++) (nodes l) >>= nl
MappingsAnnotation -> return "## Mappings\n\n"
+ -- TODO: handle OptionAnnotation
OptionsAnnotation -> return "## Options\n\n"
Paragraph p -> nodes p >>= nl >>= nl
Plaintext p -> return p