morley-1.12.0: Developer tools for the Michelson Language
Safe HaskellNone
LanguageHaskell2010

Util.Markdown

Description

A small Markdown eDSL.

Synopsis

Documentation

type Markdown = Builder Source #

A piece of markdown document.

This is opposed to Text type, which in turn is not supposed to contain markup elements.

newtype HeaderLevel Source #

Level of header, starting from 1.

Constructors

HeaderLevel Int 

newtype Anchor Source #

Anchor with given text.

Constructors

Anchor 

Fields

Instances

Instances details
IsString Anchor Source # 
Instance details

Defined in Util.Markdown

Methods

fromString :: String -> Anchor #

ToAnchor Anchor Source # 
Instance details

Defined in Util.Markdown

class ToAnchor anchor where Source #

Picking anchor for various things.

What you want here is potentially adding some prefix to ensure anchors uniqueness. It is not necessary to preprocess the text to fit anchor format - that will happen when the anchor is embedded into Markdown.

Methods

toAnchor :: anchor -> Anchor Source #

Instances

Instances details
ToAnchor Text Source # 
Instance details

Defined in Util.Markdown

Methods

toAnchor :: Text -> Anchor Source #

ToAnchor Anchor Source # 
Instance details

Defined in Util.Markdown

ToAnchor DocItemId Source # 
Instance details

Defined in Michelson.Doc

ToAnchor (DocItemRef d 'True) Source # 
Instance details

Defined in Michelson.Doc

mdToc :: ToAnchor anchor => HeaderLevel -> Markdown -> anchor -> Markdown Source #

mdLocalRef :: ToAnchor anchor => Markdown -> anchor -> Markdown Source #

mdEscapeAnchor :: ToAnchor anchor => anchor -> Markdown Source #

Turn text into valid anchor. Human-readability is not preserved.

mdAnchor :: ToAnchor anchor => anchor -> Markdown Source #

mdSpoiler :: Markdown -> Markdown -> Markdown Source #

Text which is hidden until clicked.

md :: QuasiQuoter Source #

Quasi quoter for Markdown.

This supports interpolation via #{expression} syntax.