prosidy-1.6.0.2: A simple language for writing documents.
Copyright(c) James Alexander Feldman-Crough 2019
LicenseMPL-2.0
Maintaineralex@fldcr.com
Safe HaskellTrustworthy
LanguageHaskell2010

Prosidy.Parse

Description

 
Synopsis

Parsing Prosidy types from Text

parseDocument :: FilePath -> Text -> Either Failure Document Source #

Parses a Prosidy Document from its source.

The FilePath parameter is only used for error reporting.

parseDocumentMetadata :: FilePath -> Text -> Either Failure Metadata Source #

Parses a Prosidy document's header Metadata from source, stopping when the header ends.

The FilePath parameter is only used for error reporting.

Reading & parsing Prosidy files

readDocument :: FilePath -> IO Document Source #

Reads a Prosidy Document from the given FilePath.

Errors will be thrown as exceptions. Use parseDocument for a pure implementation.

readDocumentMetadata :: FilePath -> IO Metadata Source #

Reads a Prosidy document's Metadata header from the given FilePath.

Errors will be thrown as exceptions. Use parseDocumentMetadata for a pure implementation.

Errors

newtype Failure Source #

A parsing error.

Instances

Instances details
Show Failure Source # 
Instance details

Defined in Prosidy.Parse

Exception Failure Source # 
Instance details

Defined in Prosidy.Parse

prettyFailure :: Failure -> String Source #

Pretty-print a Failure into a message acceptable for displaying to users.