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.Printer

Description

Generate Jira wiki markup text from an abstract syntax tree.

Synopsis

- pretty :: Doc -> Text
- renderBlock :: Block -> JiraPrinter Text
- renderInline :: Inline -> Text
- prettyBlocks :: [Block] -> Text
- prettyInlines :: [Inline] -> Text
- type JiraPrinter a = Reader PrinterState a
- data PrinterState = PrinterState {
  - stateInTable :: Bool
  - stateListLevel :: Text
  }
- startState :: PrinterState
- withDefault :: JiraPrinter a -> a

# Documentation

pretty :: Doc -> Text Source #

Render Jira document as Jira wiki formatted text.

renderBlock :: Block -> JiraPrinter Text Source #

Render a block as Jira wiki format.

renderInline :: Inline -> Text Source #

Renders a single inline item as Jira markup.

prettyBlocks :: [Block] -> Text Source #

Render a list of Jira blocks as Jira wiki formatted text.

prettyInlines :: [Inline] -> Text Source #

Renders a list of Jira inline markup elements.

type JiraPrinter a = Reader PrinterState a Source #

data PrinterState Source #

Internal state used by the printer.

Constructors

PrinterState |

Fields

- stateInTable :: Bool
- stateListLevel :: Text

startState :: PrinterState Source #

Default start state of the printer.

withDefault :: JiraPrinter a -> a Source #

Run with default state.