hydra-kernel-0.18.0: src/main/haskell/Hydra/Core/Markdown.hs
-- Note: this is an automatically generated file. Do not edit.
-- | A Markdown document model, used as the target representation for generated documentation
module Hydra.Core.Markdown where
import qualified Hydra.Core.Model as Model
import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)
import qualified Data.Scientific as Sci
import Data.Void
-- | A block-level Markdown element
data Block =
-- | A fenced code block
BlockCodeBlock CodeBlock |
-- | An ordered or unordered list
BlockList List |
-- | A paragraph of inline content
BlockParagraph Paragraph |
-- | Raw, verbatim passthrough content (e.g. an HTML comment), emitted with no escaping or reformatting. Used for constructs the rest of the Block union cannot represent, such as the generated-file notice banner at the top of a generated page.
BlockRaw String |
-- | A heading followed by its own block content, nested to form a document outline
BlockSection Section |
-- | A table
BlockTable Table
deriving (Eq, Ord, Read, Show)
_Block = Model.Name "hydra.core.markdown.Block"
_Block_codeBlock = Model.Name "codeBlock"
_Block_list = Model.Name "list"
_Block_paragraph = Model.Name "paragraph"
_Block_raw = Model.Name "raw"
_Block_section = Model.Name "section"
_Block_table = Model.Name "table"
-- | A fenced code block
data CodeBlock =
CodeBlock {
-- | The optional language tag used for syntax highlighting, e.g. "haskell"
codeBlockLanguage :: (Maybe String),
-- | The literal text content of the code block
codeBlockContent :: String}
deriving (Eq, Ord, Read, Show)
_CodeBlock = Model.Name "hydra.core.markdown.CodeBlock"
_CodeBlock_language = Model.Name "language"
_CodeBlock_content = Model.Name "content"
-- | A complete Markdown document
data Document =
Document {
-- | The document's top-level title, rendered as an H1 heading
documentTitle :: String,
-- | The block-level content of the document, following the title
documentContent :: [Block]}
deriving (Eq, Ord, Read, Show)
_Document = Model.Name "hydra.core.markdown.Document"
_Document_title = Model.Name "title"
_Document_content = Model.Name "content"
-- | A section heading
data Heading =
Heading {
-- | The heading level, where 1 corresponds to an H1 heading; levels increase with nesting depth
headingLevel :: Int,
-- | The inline content of the heading
headingContent :: [Inline],
-- | An optional explicit anchor identifier for linking directly to this heading. Headings can usually derive an anchor from their rendered text, but an explicit anchor is provided for cases (e.g. renderer-specific slug rules) where that derivation is ambiguous or undesired.
headingAnchor :: (Maybe String)}
deriving (Eq, Ord, Read, Show)
_Heading = Model.Name "hydra.core.markdown.Heading"
_Heading_level = Model.Name "level"
_Heading_content = Model.Name "content"
_Heading_anchor = Model.Name "anchor"
-- | An inline Markdown element
data Inline =
-- | An inline code span
InlineCode String |
-- | Emphasized (italicized) text
InlineEmphasis [Inline] |
-- | A hyperlink
InlineLink Link |
-- | Strongly emphasized (bolded) text
InlineStrong [Inline] |
-- | A raw text fragment
InlineText String
deriving (Eq, Ord, Read, Show)
_Inline = Model.Name "hydra.core.markdown.Inline"
_Inline_code = Model.Name "code"
_Inline_emphasis = Model.Name "emphasis"
_Inline_link = Model.Name "link"
_Inline_strong = Model.Name "strong"
_Inline_text = Model.Name "text"
-- | A hyperlink
data Link =
Link {
-- | The visible link text
linkText :: [Inline],
-- | The link target, either a URL or a relative path
linkTarget :: String}
deriving (Eq, Ord, Read, Show)
_Link = Model.Name "hydra.core.markdown.Link"
_Link_text = Model.Name "text"
_Link_target = Model.Name "target"
-- | An ordered or unordered list
data List =
List {
-- | Whether the list is numbered (ordered) rather than bulleted (unordered)
listOrdered :: Bool,
-- | The items of the list
listItems :: [ListItem]}
deriving (Eq, Ord, Read, Show)
_List = Model.Name "hydra.core.markdown.List"
_List_ordered = Model.Name "ordered"
_List_items = Model.Name "items"
-- | A single item of a list
newtype ListItem =
ListItem {
unListItem :: [Block]}
deriving (Eq, Ord, Read, Show)
_ListItem = Model.Name "hydra.core.markdown.ListItem"
-- | A paragraph of inline content
data Paragraph =
Paragraph {
-- | The inline content of the paragraph
paragraphContent :: [Inline],
-- | An optional explicit anchor identifier for linking directly to this paragraph. Needed for elements such as rendered provisions, which are bold-led prose within a paragraph rather than a heading, so they carry no heading-derived anchor of their own.
paragraphAnchor :: (Maybe String)}
deriving (Eq, Ord, Read, Show)
_Paragraph = Model.Name "hydra.core.markdown.Paragraph"
_Paragraph_content = Model.Name "content"
_Paragraph_anchor = Model.Name "anchor"
-- | A heading followed by its own block content, nested to form a document outline
data Section =
Section {
-- | The section's heading
sectionHeading :: Heading,
-- | The block-level content of the section, following the heading
sectionContent :: [Block],
-- | An optional explicit anchor identifier for linking directly to this section, distinct from the heading's own anchor (a section's anchor identifies the section as a whole; a heading's identifies the heading line specifically).
sectionAnchor :: (Maybe String)}
deriving (Eq, Ord, Read, Show)
_Section = Model.Name "hydra.core.markdown.Section"
_Section_heading = Model.Name "heading"
_Section_content = Model.Name "content"
_Section_anchor = Model.Name "anchor"
-- | A table, consisting of a header row and any number of data rows
data Table =
Table {
-- | The header row of the table
tableHeader :: TableRow,
-- | The data rows of the table
tableRows :: [TableRow]}
deriving (Eq, Ord, Read, Show)
_Table = Model.Name "hydra.core.markdown.Table"
_Table_header = Model.Name "header"
_Table_rows = Model.Name "rows"
-- | A single cell of a table row
newtype TableCell =
TableCell {
unTableCell :: [Inline]}
deriving (Eq, Ord, Read, Show)
_TableCell = Model.Name "hydra.core.markdown.TableCell"
-- | A single row of a table
newtype TableRow =
TableRow {
unTableRow :: [TableCell]}
deriving (Eq, Ord, Read, Show)
_TableRow = Model.Name "hydra.core.markdown.TableRow"