Language.PureScript.Docs.AsHtml

purescript-0.15.15: PureScript Programming Language Compiler

Safe Haskell | None
Language | Haskell2010

Language.PureScript.Docs.AsHtml

Description

Functions for rendering generated documentation from PureScript code as HTML.

Synopsis

- data HtmlOutput a = HtmlOutput {
  - htmlIndex :: [(Maybe Char, a)]
  - htmlModules :: [(ModuleName, HtmlOutputModule a)]
  }
- data HtmlOutputModule a = HtmlOutputModule {
  - htmlOutputModuleLocals :: a
  - htmlOutputModuleReExports :: [(InPackage ModuleName, a)]
  }
- data HtmlRenderContext = HtmlRenderContext {
  - buildDocLink :: Namespace -> Text -> ContainingModule -> Maybe DocLink
  - renderDocLink :: DocLink -> Text
  - renderSourceLink :: SourceSpan -> Maybe Text
  }
- nullRenderContext :: HtmlRenderContext
- packageAsHtml :: (InPackage ModuleName -> Maybe HtmlRenderContext) -> Package a -> HtmlOutput Html
- moduleAsHtml :: (InPackage ModuleName -> Maybe HtmlRenderContext) -> Module -> (ModuleName, HtmlOutputModule Html)
- makeFragment :: Namespace -> Text -> Text
- renderMarkdown :: Text -> Html

# Documentation

data HtmlOutput a #

Constructors

HtmlOutput |
Fields htmlIndex :: [(Maybe Char, a)] htmlModules :: [(ModuleName, HtmlOutputModule a)]

#### Instances

Instances details

Functor HtmlOutput # |
Instance details Defined in Language.PureScript.Docs.AsHtml Methods fmap :: (a -> b) -> HtmlOutput a -> HtmlOutput b # (<$) :: a -> HtmlOutput b -> HtmlOutput a #
Show a => Show (HtmlOutput a) # |
Instance details Defined in Language.PureScript.Docs.AsHtml Methods showsPrec :: Int -> HtmlOutput a -> ShowS # show :: HtmlOutput a -> String # showList :: [HtmlOutput a] -> ShowS #

data HtmlOutputModule a #

Constructors

HtmlOutputModule |
Fields htmlOutputModuleLocals :: a htmlOutputModuleReExports :: [(InPackage ModuleName, a)]

#### Instances

Instances details

Functor HtmlOutputModule # |
Instance details Defined in Language.PureScript.Docs.AsHtml Methods fmap :: (a -> b) -> HtmlOutputModule a -> HtmlOutputModule b # (<$) :: a -> HtmlOutputModule b -> HtmlOutputModule a #
Show a => Show (HtmlOutputModule a) # |
Instance details Defined in Language.PureScript.Docs.AsHtml Methods showsPrec :: Int -> HtmlOutputModule a -> ShowS # show :: HtmlOutputModule a -> String # showList :: [HtmlOutputModule a] -> ShowS #

data HtmlRenderContext #

Constructors

HtmlRenderContext |
Fields buildDocLink :: Namespace -> Text -> ContainingModule -> Maybe DocLink renderDocLink :: DocLink -> Text renderSourceLink :: SourceSpan -> Maybe Text

nullRenderContext :: HtmlRenderContext #

An HtmlRenderContext for when you don't want to render any links.

packageAsHtml :: (InPackage ModuleName -> Maybe HtmlRenderContext) -> Package a -> HtmlOutput Html #

moduleAsHtml :: (InPackage ModuleName -> Maybe HtmlRenderContext) -> Module -> (ModuleName, HtmlOutputModule Html) #

makeFragment :: Namespace -> Text -> Text #

renderMarkdown :: Text -> Html #

Render Markdown to HTML. Safe for untrusted input. Relative links are | removed.