| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Simplex.Chat.Markdown
Synopsis
- data Markdown
- data Format
- = Bold
- | Italic
- | StrikeThrough
- | Snippet
- | Secret
- | Colored {
- color :: FormatColor
- | Uri
- | HyperLink { }
- | SimplexLink {
- showText :: Maybe Text
- linkType :: SimplexLinkType
- simplexUri :: AConnectionLink
- smpHosts :: NonEmpty Text
- | Command {
- commandStr :: Text
- | Mention {
- memberName :: Text
- | Phone
- | Unknown {
- json :: Value
- mentionedNames :: MarkdownList -> [Text]
- data SimplexLinkType
- colored :: Color -> Format
- markdown :: Format -> Text -> Markdown
- newtype FormatColor = FormatColor Color
- data FormattedText = FormattedText {}
- type MarkdownList = [FormattedText]
- data ParsedMarkdown = ParsedMarkdown {
- formattedText :: Maybe MarkdownList
- unmarked :: Text -> Markdown
- parseMaybeMarkdownList :: Text -> Maybe MarkdownList
- parseMarkdownList :: Text -> MarkdownList
- markdownToList :: Markdown -> MarkdownList
- parseMarkdown :: Text -> Markdown
- isSimplexLink :: Format -> Bool
- markdownP :: Parser Markdown
- parseUri :: ByteString -> Either Text URI
- sanitizeUri :: Bool -> URI -> Maybe URI
- markdownText :: FormattedText -> Text
- displayNameTextP :: Parser Text
- displayNameTextP_ :: Parser (Text, Text)
- commandTextP :: Parser (Text, Text)
- viewName :: Text -> Text
Documentation
Constructors
| Bold | |
| Italic | |
| StrikeThrough | |
| Snippet | |
| Secret | |
| Colored | |
Fields
| |
| Uri | |
| HyperLink | |
| SimplexLink | |
Fields
| |
| Command | |
Fields
| |
| Mention | |
Fields
| |
| Phone | |
| Unknown | |
Fields
| |
Instances
| FromJSON Format Source # | |
Defined in Simplex.Chat.Markdown Methods parseJSON :: Value -> Parser Format parseJSONList :: Value -> Parser [Format] omittedField :: Maybe Format | |
| ToJSON Format Source # | |
Defined in Simplex.Chat.Markdown Methods toEncoding :: Format -> Encoding toJSONList :: [Format] -> Value toEncodingList :: [Format] -> Encoding | |
| Show Format Source # | |
| Eq Format Source # | |
mentionedNames :: MarkdownList -> [Text] Source #
data SimplexLinkType Source #
Constructors
| XLContact | |
| XLInvitation | |
| XLGroup | |
| XLChannel | |
| XLRelay |
Instances
| FromJSON SimplexLinkType Source # | |
Defined in Simplex.Chat.Markdown Methods parseJSON :: Value -> Parser SimplexLinkType parseJSONList :: Value -> Parser [SimplexLinkType] omittedField :: Maybe SimplexLinkType | |
| ToJSON SimplexLinkType Source # | |
Defined in Simplex.Chat.Markdown Methods toJSON :: SimplexLinkType -> Value toEncoding :: SimplexLinkType -> Encoding toJSONList :: [SimplexLinkType] -> Value toEncodingList :: [SimplexLinkType] -> Encoding omitField :: SimplexLinkType -> Bool | |
| Show SimplexLinkType Source # | |
Defined in Simplex.Chat.Markdown Methods showsPrec :: Int -> SimplexLinkType -> ShowS show :: SimplexLinkType -> String showList :: [SimplexLinkType] -> ShowS | |
| Eq SimplexLinkType Source # | |
Defined in Simplex.Chat.Markdown Methods (==) :: SimplexLinkType -> SimplexLinkType -> Bool (/=) :: SimplexLinkType -> SimplexLinkType -> Bool | |
newtype FormatColor Source #
Constructors
| FormatColor Color |
Instances
| FromJSON FormatColor Source # | |
Defined in Simplex.Chat.Markdown Methods parseJSON :: Value -> Parser FormatColor parseJSONList :: Value -> Parser [FormatColor] omittedField :: Maybe FormatColor | |
| ToJSON FormatColor Source # | |
Defined in Simplex.Chat.Markdown Methods toJSON :: FormatColor -> Value toEncoding :: FormatColor -> Encoding toJSONList :: [FormatColor] -> Value toEncodingList :: [FormatColor] -> Encoding omitField :: FormatColor -> Bool | |
| Show FormatColor Source # | |
Defined in Simplex.Chat.Markdown Methods showsPrec :: Int -> FormatColor -> ShowS show :: FormatColor -> String showList :: [FormatColor] -> ShowS | |
| Eq FormatColor Source # | |
Defined in Simplex.Chat.Markdown | |
data FormattedText Source #
Constructors
| FormattedText | |
Instances
| FromJSON FormattedText Source # | |
Defined in Simplex.Chat.Markdown Methods parseJSON :: Value -> Parser FormattedText parseJSONList :: Value -> Parser [FormattedText] omittedField :: Maybe FormattedText | |
| ToJSON FormattedText Source # | |
Defined in Simplex.Chat.Markdown Methods toJSON :: FormattedText -> Value toEncoding :: FormattedText -> Encoding toJSONList :: [FormattedText] -> Value toEncodingList :: [FormattedText] -> Encoding omitField :: FormattedText -> Bool | |
| IsString FormattedText Source # | |
Defined in Simplex.Chat.Markdown Methods fromString :: String -> FormattedText | |
| Show FormattedText Source # | |
Defined in Simplex.Chat.Markdown Methods showsPrec :: Int -> FormattedText -> ShowS show :: FormattedText -> String showList :: [FormattedText] -> ShowS | |
| Eq FormattedText Source # | |
Defined in Simplex.Chat.Markdown | |
type MarkdownList = [FormattedText] Source #
data ParsedMarkdown Source #
Constructors
| ParsedMarkdown | |
Fields
| |
Instances
| ToJSON ParsedMarkdown Source # | |
Defined in Simplex.Chat.Markdown Methods toJSON :: ParsedMarkdown -> Value toEncoding :: ParsedMarkdown -> Encoding toJSONList :: [ParsedMarkdown] -> Value toEncodingList :: [ParsedMarkdown] -> Encoding omitField :: ParsedMarkdown -> Bool | |
parseMaybeMarkdownList :: Text -> Maybe MarkdownList Source #
parseMarkdownList :: Text -> MarkdownList Source #
parseMarkdown :: Text -> Markdown Source #
isSimplexLink :: Format -> Bool Source #
page name: lowercase latin in snake-case or hyphen-case, allowing for sinlge leading or trailing hyphen or underscore.
sanitizeUri :: Bool -> URI -> Maybe URI Source #
markdownText :: FormattedText -> Text Source #
displayNameTextP :: Parser Text Source #
displayNameTextP_ :: Parser (Text, Text) Source #
commandTextP :: Parser (Text, Text) Source #