dhall-docs-1.0.11: Generate HTML docs from a dhall package
Safe HaskellSafe-Inferred
LanguageHaskell2010

Dhall.Docs.Core

Description

Contains all the functions that generate documentation

We should always try to do as little work as possible in an IO context. To do so, just wrap your function in IO if you need to do I/O operations, and make pure functions receive that IO result as an input

Synopsis

Core functionality

generateDocs Source #

Arguments

:: Path Abs Dir

Input directory

-> Path Abs Dir

Link to be created to the generated documentation

-> Maybe Text

Base import URL

-> Text

Package name, used in some HTML titles

-> CharacterSet

Output encoding

-> IO () 

Generate all of the docs for a package. This function does all the `IO ()` related tasks to call generateDocsPure

generateDocsPure Source #

Arguments

:: Maybe Text

Base import URL

-> Text

Package name

-> CharacterSet

Output encoding

-> [(Path Rel File, ByteString)]

(Input file, contents)

-> GeneratedDocs [(Path Rel File, Text)] 

Generates all the documentation of dhall package in a pure way i.e. without an IO context. This let you generate documentation from a list of dhall-files without saving them to the filesystem.

If you want the IO version of this function, check generateDocs

data GeneratedDocs a Source #

The result of the doc-generator pure component

Constructors

GeneratedDocs [DocsGenWarning] a 

Instances

Instances details
Applicative GeneratedDocs Source # 
Instance details

Defined in Dhall.Docs.Core

Functor GeneratedDocs Source # 
Instance details

Defined in Dhall.Docs.Core

Methods

fmap :: (a -> b) -> GeneratedDocs a -> GeneratedDocs b #

(<$) :: a -> GeneratedDocs b -> GeneratedDocs a #

Monad GeneratedDocs Source # 
Instance details

Defined in Dhall.Docs.Core

Show a => Show (GeneratedDocs a) Source # 
Instance details

Defined in Dhall.Docs.Core

Comment parsing

parseComments :: String -> Text -> [DhallComment 'RawComment] Source #

Parse all comments in a text fragment

data DhallDocsText Source #

Extracted text from a valid dhall-docs comment

Instances

Instances details
Show DhallDocsText Source # 
Instance details

Defined in Dhall.Docs.Comment

parseSingleDhallDocsComment :: String -> Text -> Maybe (Either [CommentParseError] DhallDocsText) Source #

Returns Nothing when DhallDocsComment was parsed or no error was detected