jira-wiki-markup-1.5.1: Handle Jira wiki markup

Copyright | © 2019–2023 Albert Krewinkel
License | MIT
Maintainer | Albert Krewinkel <tarleb@zeitkraut.de>
Stability | alpha
Portability | portable
Safe Haskell | Safe-Inferred
Language | Haskell2010

Text.Jira.Markup

Description

Jira markup types.

Synopsis

- newtype Doc = Doc {
  - fromDoc :: [Block]
  }
- data Block
  - = Code Language [Parameter] Text
  - | Color ColorName [Block]
  - | BlockQuote [Block]
  - | Header Int [Inline]
  - | HorizontalRule
  - | List ListStyle [[Block]]
  - | NoFormat [Parameter] Text
  - | Panel [Parameter] [Block]
  - | Para [Inline]
  - | Table [Row]
- data Inline
  - = Anchor Text
  - | AutoLink URL
  - | Citation [Inline]
  - | ColorInline ColorName [Inline]
  - | Emoji Icon
  - | Entity Text
  - | Image [Parameter] URL
  - | Linebreak
  - | Link LinkType [Inline] URL
  - | Monospaced [Inline]
  - | Space
  - | SpecialChar Char
  - | Str Text
  - | Styled InlineStyle [Inline]
- data InlineStyle
  - = Emphasis
  - | Insert
  - | Strikeout
  - | Strong
  - | Subscript
  - | Superscript
- data LinkType
  - = Attachment
  - | Email
  - | External
  - | SmartCard
  - | SmartLink
  - | User
- data ListStyle
  - = CircleBullets
  - | SquareBullets
  - | Enumeration
- newtype URL = URL {
  - fromURL :: Text
  }
- newtype ColorName = ColorName Text
- data Icon
  - = IconSlightlySmiling
  - | IconFrowning
  - | IconTongue
  - | IconSmiling
  - | IconWinking
  - | IconThumbsUp
  - | IconThumbsDown
  - | IconInfo
  - | IconCheckmark
  - | IconX
  - | IconAttention
  - | IconPlus
  - | IconMinus
  - | IconQuestionmark
  - | IconOn
  - | IconOff
  - | IconStar
  - | IconStarRed
  - | IconStarGreen
  - | IconStarBlue
  - | IconStarYellow
  - | IconFlag
  - | IconFlagOff
- newtype Row = Row {
  - fromRow :: [Cell]
  }
- data Cell
  - = BodyCell [Block]
  - | HeaderCell [Block]
- newtype Language = Language Text
- data Parameter = Parameter {
  - parameterKey :: Text
  - parameterValue :: Text
  }
- normalizeInlines :: [Inline] -> [Inline]
- iconText :: Icon -> Text

# Documentation

newtype Doc Source #

Jira document

Constructors

Doc |

Fields

- fromDoc :: [Block]

#### Instances

Instances details

Show Doc Source # |
Instance details Defined in Text.Jira.Markup Methods showsPrec :: Int -> Doc -> ShowS Source # show :: Doc -> String Source # showList :: [Doc] -> ShowS Source #
Eq Doc Source # |
Instance details Defined in Text.Jira.Markup Methods (==) :: Doc -> Doc -> Bool Source # (/=) :: Doc -> Doc -> Bool Source #
Ord Doc Source # |
Instance details Defined in Text.Jira.Markup Methods compare :: Doc -> Doc -> Ordering Source # (<) :: Doc -> Doc -> Bool Source # (<=) :: Doc -> Doc -> Bool Source # (>) :: Doc -> Doc -> Bool Source # (>=) :: Doc -> Doc -> Bool Source # max :: Doc -> Doc -> Doc Source # min :: Doc -> Doc -> Doc Source #

data Block Source #

Blocks of text.

Constructors

Code Language [Parameter] Text | Code block with panel parameters
Color ColorName [Block] | text displayed in a specific color
BlockQuote [Block] | Block of quoted content
Header Int [Inline] | Header with level and text
HorizontalRule | horizontal ruler
List ListStyle [[Block]] | List
NoFormat [Parameter] Text | Unformatted text
Panel [Parameter] [Block] | Formatted panel
Para [Inline] | Paragraph of text
Table [Row] | Table

#### Instances

Instances details

Show Block Source # |
Instance details Defined in Text.Jira.Markup Methods showsPrec :: Int -> Block -> ShowS Source # show :: Block -> String Source # showList :: [Block] -> ShowS Source #
Eq Block Source # |
Instance details Defined in Text.Jira.Markup Methods (==) :: Block -> Block -> Bool Source # (/=) :: Block -> Block -> Bool Source #
Ord Block Source # |
Instance details Defined in Text.Jira.Markup Methods compare :: Block -> Block -> Ordering Source # (<) :: Block -> Block -> Bool Source # (<=) :: Block -> Block -> Bool Source # (>) :: Block -> Block -> Bool Source # (>=) :: Block -> Block -> Bool Source # max :: Block -> Block -> Block Source # min :: Block -> Block -> Block Source #

data Inline Source #

Inline Jira markup elements.

Constructors

Anchor Text | anchor for internal links
AutoLink URL | URL which is also a link
Citation [Inline] | source of a citation
ColorInline ColorName [Inline] | colored inline text
Emoji Icon | emoticon
Entity Text | named or numeric HTML entity
Image [Parameter] URL | an image
Linebreak | hard linebreak
Link LinkType [Inline] URL | hyperlink with alias
Monospaced [Inline] | text rendered with monospaced font
Space | space between words
SpecialChar Char | single char with special meaning
Str Text | simple, markup-less string
Styled InlineStyle [Inline] | styled text

#### Instances

Instances details

Show Inline Source # |
Instance details Defined in Text.Jira.Markup Methods showsPrec :: Int -> Inline -> ShowS Source # show :: Inline -> String Source # showList :: [Inline] -> ShowS Source #
Eq Inline Source # |
Instance details Defined in Text.Jira.Markup Methods (==) :: Inline -> Inline -> Bool Source # (/=) :: Inline -> Inline -> Bool Source #
Ord Inline Source # |
Instance details Defined in Text.Jira.Markup Methods compare :: Inline -> Inline -> Ordering Source # (<) :: Inline -> Inline -> Bool Source # (<=) :: Inline -> Inline -> Bool Source # (>) :: Inline -> Inline -> Bool Source # (>=) :: Inline -> Inline -> Bool Source # max :: Inline -> Inline -> Inline Source # min :: Inline -> Inline -> Inline Source #

data InlineStyle Source #

Supported inline text effect styles.

Constructors

Emphasis | emphasized text
Insert | text marked as having been inserted
Strikeout | deleted (struk-out) text
Strong | strongly emphasized text
Subscript | subscript text
Superscript | superscript text

#### Instances

Instances details

Show InlineStyle Source # |
Instance details Defined in Text.Jira.Markup Methods showsPrec :: Int -> InlineStyle -> ShowS Source # show :: InlineStyle -> String Source # showList :: [InlineStyle] -> ShowS Source #
Eq InlineStyle Source # |
Instance details Defined in Text.Jira.Markup Methods (==) :: InlineStyle -> InlineStyle -> Bool Source # (/=) :: InlineStyle -> InlineStyle -> Bool Source #
Ord InlineStyle Source # |

Instance details

Defined in Text.Jira.Markup

Methods

compare :: InlineStyle -> InlineStyle -> Ordering Source #

(<) :: InlineStyle -> InlineStyle -> Bool Source #

(<=) :: InlineStyle -> InlineStyle -> Bool Source #

(>) :: InlineStyle -> InlineStyle -> Bool Source #

(>=) :: InlineStyle -> InlineStyle -> Bool Source #

max :: InlineStyle -> InlineStyle -> InlineStyle Source #

min :: InlineStyle -> InlineStyle -> InlineStyle Source #

data LinkType Source #

Type of a link.

Constructors

Attachment | link to an attachment
Email | link to an email address
External | external resource, like a website
SmartCard | smart-card link (external)
SmartLink | "smart" link with icon, short-name
User | link to a user

#### Instances

Instances details

Show LinkType Source # |
Instance details Defined in Text.Jira.Markup Methods showsPrec :: Int -> LinkType -> ShowS Source # show :: LinkType -> String Source # showList :: [LinkType] -> ShowS Source #
Eq LinkType Source # |
Instance details Defined in Text.Jira.Markup Methods (==) :: LinkType -> LinkType -> Bool Source # (/=) :: LinkType -> LinkType -> Bool Source #
Ord LinkType Source # |
Instance details Defined in Text.Jira.Markup Methods compare :: LinkType -> LinkType -> Ordering Source # (<) :: LinkType -> LinkType -> Bool Source # (<=) :: LinkType -> LinkType -> Bool Source # (>) :: LinkType -> LinkType -> Bool Source # (>=) :: LinkType -> LinkType -> Bool Source # max :: LinkType -> LinkType -> LinkType Source # min :: LinkType -> LinkType -> LinkType Source #

data ListStyle Source #

Style used for list items.

Constructors

CircleBullets | List with round bullets
SquareBullets | List with square bullets
Enumeration | Enumeration, i.e., numbered items

#### Instances

Instances details

Show ListStyle Source # |
Instance details Defined in Text.Jira.Markup Methods showsPrec :: Int -> ListStyle -> ShowS Source # show :: ListStyle -> String Source # showList :: [ListStyle] -> ShowS Source #
Eq ListStyle Source # |
Instance details Defined in Text.Jira.Markup Methods (==) :: ListStyle -> ListStyle -> Bool Source # (/=) :: ListStyle -> ListStyle -> Bool Source #
Ord ListStyle Source # |

Instance details

Defined in Text.Jira.Markup

Methods

compare :: ListStyle -> ListStyle -> Ordering Source #

(<) :: ListStyle -> ListStyle -> Bool Source #

(<=) :: ListStyle -> ListStyle -> Bool Source #

(>) :: ListStyle -> ListStyle -> Bool Source #

(>=) :: ListStyle -> ListStyle -> Bool Source #

max :: ListStyle -> ListStyle -> ListStyle Source #

min :: ListStyle -> ListStyle -> ListStyle Source #

newtype URL Source #

Unified resource location

Constructors

URL |

Fields

- fromURL :: Text

#### Instances

Instances details

Show URL Source # |
Instance details Defined in Text.Jira.Markup Methods showsPrec :: Int -> URL -> ShowS Source # show :: URL -> String Source # showList :: [URL] -> ShowS Source #
Eq URL Source # |
Instance details Defined in Text.Jira.Markup Methods (==) :: URL -> URL -> Bool Source # (/=) :: URL -> URL -> Bool Source #
Ord URL Source # |
Instance details Defined in Text.Jira.Markup Methods compare :: URL -> URL -> Ordering Source # (<) :: URL -> URL -> Bool Source # (<=) :: URL -> URL -> Bool Source # (>) :: URL -> URL -> Bool Source # (>=) :: URL -> URL -> Bool Source # max :: URL -> URL -> URL Source # min :: URL -> URL -> URL Source #

newtype ColorName Source #

Text color

Constructors

ColorName Text |

#### Instances

Instances details

Show ColorName Source # |
Instance details Defined in Text.Jira.Markup Methods showsPrec :: Int -> ColorName -> ShowS Source # show :: ColorName -> String Source # showList :: [ColorName] -> ShowS Source #
Eq ColorName Source # |
Instance details Defined in Text.Jira.Markup Methods (==) :: ColorName -> ColorName -> Bool Source # (/=) :: ColorName -> ColorName -> Bool Source #
Ord ColorName Source # |

Instance details

Defined in Text.Jira.Markup

Methods

compare :: ColorName -> ColorName -> Ordering Source #

(<) :: ColorName -> ColorName -> Bool Source #

(<=) :: ColorName -> ColorName -> Bool Source #

(>) :: ColorName -> ColorName -> Bool Source #

(>=) :: ColorName -> ColorName -> Bool Source #

max :: ColorName -> ColorName -> ColorName Source #

min :: ColorName -> ColorName -> ColorName Source #

data Icon Source #

Graphical emoticons

Constructors

IconSlightlySmiling |
IconFrowning |
IconTongue |
IconSmiling |
IconWinking |
IconThumbsUp |
IconThumbsDown |
IconInfo |
IconCheckmark |
IconX |
IconAttention |
IconPlus |
IconMinus |
IconQuestionmark |
IconOn |
IconOff |
IconStar |
IconStarRed |
IconStarGreen |
IconStarBlue |
IconStarYellow |
IconFlag |
IconFlagOff |

#### Instances

Instances details

Enum Icon Source # |
Instance details Defined in Text.Jira.Markup Methods succ :: Icon -> Icon Source # pred :: Icon -> Icon Source # toEnum :: Int -> Icon Source # fromEnum :: Icon -> Int Source # enumFrom :: Icon -> [Icon] Source # enumFromThen :: Icon -> Icon -> [Icon] Source # enumFromTo :: Icon -> Icon -> [Icon] Source # enumFromThenTo :: Icon -> Icon -> Icon -> [Icon] Source #
Show Icon Source # |
Instance details Defined in Text.Jira.Markup Methods showsPrec :: Int -> Icon -> ShowS Source # show :: Icon -> String Source # showList :: [Icon] -> ShowS Source #
Eq Icon Source # |
Instance details Defined in Text.Jira.Markup Methods (==) :: Icon -> Icon -> Bool Source # (/=) :: Icon -> Icon -> Bool Source #
Ord Icon Source # |
Instance details Defined in Text.Jira.Markup Methods compare :: Icon -> Icon -> Ordering Source # (<) :: Icon -> Icon -> Bool Source # (<=) :: Icon -> Icon -> Bool Source # (>) :: Icon -> Icon -> Bool Source # (>=) :: Icon -> Icon -> Bool Source # max :: Icon -> Icon -> Icon Source # min :: Icon -> Icon -> Icon Source #

newtype Row Source #

Table row, containing an arbitrary number of cells.

Constructors

Row |

Fields

- fromRow :: [Cell]

#### Instances

Instances details

Show Row Source # |
Instance details Defined in Text.Jira.Markup Methods showsPrec :: Int -> Row -> ShowS Source # show :: Row -> String Source # showList :: [Row] -> ShowS Source #
Eq Row Source # |
Instance details Defined in Text.Jira.Markup Methods (==) :: Row -> Row -> Bool Source # (/=) :: Row -> Row -> Bool Source #
Ord Row Source # |
Instance details Defined in Text.Jira.Markup Methods compare :: Row -> Row -> Ordering Source # (<) :: Row -> Row -> Bool Source # (<=) :: Row -> Row -> Bool Source # (>) :: Row -> Row -> Bool Source # (>=) :: Row -> Row -> Bool Source # max :: Row -> Row -> Row Source # min :: Row -> Row -> Row Source #

data Cell Source #

Table cell with block content

Constructors

BodyCell [Block] |
HeaderCell [Block] |

#### Instances

Instances details

Show Cell Source # |
Instance details Defined in Text.Jira.Markup Methods showsPrec :: Int -> Cell -> ShowS Source # show :: Cell -> String Source # showList :: [Cell] -> ShowS Source #
Eq Cell Source # |
Instance details Defined in Text.Jira.Markup Methods (==) :: Cell -> Cell -> Bool Source # (/=) :: Cell -> Cell -> Bool Source #
Ord Cell Source # |
Instance details Defined in Text.Jira.Markup Methods compare :: Cell -> Cell -> Ordering Source # (<) :: Cell -> Cell -> Bool Source # (<=) :: Cell -> Cell -> Bool Source # (>) :: Cell -> Cell -> Bool Source # (>=) :: Cell -> Cell -> Bool Source # max :: Cell -> Cell -> Cell Source # min :: Cell -> Cell -> Cell Source #

newtype Language Source #

Programming language used for syntax highlighting.

Constructors

Language Text |

#### Instances

Instances details

Show Language Source # |
Instance details Defined in Text.Jira.Markup Methods showsPrec :: Int -> Language -> ShowS Source # show :: Language -> String Source # showList :: [Language] -> ShowS Source #
Eq Language Source # |
Instance details Defined in Text.Jira.Markup Methods (==) :: Language -> Language -> Bool Source # (/=) :: Language -> Language -> Bool Source #
Ord Language Source # |
Instance details Defined in Text.Jira.Markup Methods compare :: Language -> Language -> Ordering Source # (<) :: Language -> Language -> Bool Source # (<=) :: Language -> Language -> Bool Source # (>) :: Language -> Language -> Bool Source # (>=) :: Language -> Language -> Bool Source # max :: Language -> Language -> Language Source # min :: Language -> Language -> Language Source #

data Parameter Source #

Panel parameter

Constructors

Parameter |

Fields

- parameterKey :: Text
- parameterValue :: Text

#### Instances

Instances details

Show Parameter Source # |
Instance details Defined in Text.Jira.Markup Methods showsPrec :: Int -> Parameter -> ShowS Source # show :: Parameter -> String Source # showList :: [Parameter] -> ShowS Source #
Eq Parameter Source # |
Instance details Defined in Text.Jira.Markup Methods (==) :: Parameter -> Parameter -> Bool Source # (/=) :: Parameter -> Parameter -> Bool Source #
Ord Parameter Source # |

Instance details

Defined in Text.Jira.Markup

Methods

compare :: Parameter -> Parameter -> Ordering Source #

(<) :: Parameter -> Parameter -> Bool Source #

(<=) :: Parameter -> Parameter -> Bool Source #

(>) :: Parameter -> Parameter -> Bool Source #

(>=) :: Parameter -> Parameter -> Bool Source #

max :: Parameter -> Parameter -> Parameter Source #

min :: Parameter -> Parameter -> Parameter Source #

normalizeInlines :: [Inline] -> [Inline] Source #

Normalize a list of inlines, merging elements where possible.

iconText :: Icon -> Text Source #

Gets the characters used to represent an emoji.