morley-1.19.0: Developer tools for the Michelson Language
Safe HaskellSafe-Inferred
LanguageHaskell2010

Morley.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 Morley.Util.Markdown

Methods

fromString :: String -> Anchor #

ToAnchor Anchor Source # 
Instance details

Defined in Morley.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 DocItemId Source # 
Instance details

Defined in Morley.Michelson.Doc

ToAnchor Anchor Source # 
Instance details

Defined in Morley.Util.Markdown

ToAnchor Text Source # 
Instance details

Defined in Morley.Util.Markdown

Methods

toAnchor :: Text -> Anchor Source #

ToAnchor (DocItemRef d 'True) Source # 
Instance details

Defined in Morley.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 #{name} syntax.

Please note that we previously supported expressions inside interpolated splices. This is no longer the case. Only literal variable names can be used.

md is implemented in terms of iub, see Morley.Util.Interpolate for more information on how interpolation works.