idris-0.9.15: Functional Programming Language with Dependent Types

Safe HaskellNone

Idris.Docstrings

Description

Wrapper around Markdown library

Synopsis

Documentation

data Docstring a Source

Representation of Idris's inline documentation. The type paramter represents the type of terms that are associated with code blocks.

Constructors

DocString Options (Blocks a) 

Instances

data Block a Source

Block-level elements.

Constructors

Para (Inlines a) 
Header Int (Inlines a) 
Blockquote (Blocks a) 
List Bool ListType [Blocks a] 
CodeBlock CodeAttr Text a 
HtmlBlock Text 
HRule 

Instances

Functor Block 
Foldable Block 
Traversable Block 
Show a => Show (Block a) 
Binary a => Binary (Block a) 
NFData a => NFData (Block a) 

data Inline a Source

Constructors

Str Text 
Space 
SoftBreak 
LineBreak 
Emph (Inlines a) 
Strong (Inlines a) 
Code Text a 
Link (Inlines a) Text Text 
Image (Inlines a) Text Text 
Entity Text 
RawHtml Text 

Instances

Functor Inline 
Foldable Inline 
Traversable Inline 
Show a => Show (Inline a) 
Binary a => Binary (Inline a) 
NFData a => NFData (Inline a) 

parseDocstring :: Text -> Docstring ()Source

Construct a docstring from a Text that contains Markdown-formatted docs

renderDocstring :: (a -> String -> Doc OutputAnnotation) -> Docstring a -> Doc OutputAnnotationSource

Convert a docstring to be shown by the pretty-printer

emptyDocstring :: Docstring aSource

The empty docstring

nullDocstring :: Docstring a -> BoolSource

Check whether a docstring is emtpy

noDocs :: (Docstring a, [(Name, Docstring a)])Source

Empty documentation for a definition

overview :: Docstring a -> Docstring aSource

Construct a docstring consisting of the first block-level element of the argument docstring, for use in summaries.

containsText :: Text -> Docstring a -> BoolSource

Does a string occur in the docstring?

annotCodeSource

Arguments

:: forall a b .  
=> (String -> b)

How to annotate code samples

-> Docstring a 
-> Docstring b 

Annotate the code samples in a docstring

data DocTerm Source

The various kinds of code samples that can be embedded in docs

Instances

renderDocTerm :: (Term -> Doc OutputAnnotation) -> (Term -> Term) -> DocTerm -> String -> Doc OutputAnnotationSource

Render a term in the documentation

checkDocstring :: forall a b. (String -> [String] -> String -> a -> b) -> Docstring a -> Docstring bSource

Run some kind of processing step over code in a Docstring. The code processor gets the language and annotations as parameters, along with the source and the original annotation.