Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Unison.Server.Doc.AsHtml
Description
Render Unison.Server.Doc and embedded source to Html
Synopsis
- data NamedLinkHref
- data EmbeddedSource
- embeddedSource :: Ref (UnisonHash, DisplayObject SyntaxText Src) -> Maybe EmbeddedSource
- inlineCode :: [Text] -> Html () -> Html ()
- codeBlock :: [Attribute] -> Html () -> Html ()
- normalizeHref :: Map Referent Name -> Doc -> NamedLinkHref
- data IsFolded
- foldedToHtml :: [Attribute] -> IsFolded -> Html ()
- foldedToHtmlSource :: Bool -> EmbeddedSource -> Html ()
- mergeWords :: Text -> [Doc] -> [Doc]
- toText :: Text -> Doc -> Text
- data SideContent
- = FrontMatterContent (Map Text [Text])
- | TooltipContent (Html ())
- newtype FrontMatterData = FrontMatterData (Map Text [Text])
- toHtml :: Map Referent Name -> Doc -> (FrontMatterData, Html ())
- h :: Nat -> Text -> Html () -> Html ()
- badge :: Html () -> Html ()
- textToClass :: Text -> Text
Documentation
data NamedLinkHref Source #
Constructors
Href Text | |
DocLinkHref Name | |
ReferenceHref Text | |
InvalidHref |
data EmbeddedSource Source #
Constructors
EmbeddedSource SyntaxText SyntaxText | |
Builtin SyntaxText |
normalizeHref :: Map Referent Name -> Doc -> NamedLinkHref Source #
foldedToHtmlSource :: Bool -> EmbeddedSource -> Html () Source #
mergeWords :: Text -> [Doc] -> [Doc] Source #
Merge adjacent Word elements in a list to 1 element with a string of words separated by space— useful for rendering to the dom without creating dom elements for each and every word in the doc, but instead rely on textNodes
toText :: Text -> Doc -> Text Source #
Merge down Doc to Text by merging Paragraphs and Words. Used for things like extract an src of an image. I.e something that has to be a Text and not a Doc
data SideContent Source #
Constructors
FrontMatterContent (Map Text [Text]) | |
TooltipContent (Html ()) |
newtype FrontMatterData Source #
Constructors
FrontMatterData (Map Text [Text]) |
h :: Nat -> Text -> Html () -> Html () Source #
Unison Doc allows endlessly deep section nesting with titles, but HTML only supports to h1-h6, so we clamp the sectionLevel when converting
textToClass :: Text -> Text Source #