drasil-printers-0.1.10.0: A framework for code and document generation for scientific software - Printers SubPackage
Safe HaskellNone
LanguageHaskell2010

Language.Drasil.Printers

Synopsis

Formats

data Format Source #

Possible formats for printer output.

Constructors

TeX 
HTML 
JSON 

DOT

Types

data GraphInfo Source #

Holds all important and relevant information for generating a traceability graph. Includes nodes, graph edges, and node family information.

Constructors

GI 

Fields

data NodeFamily Source #

A node family contains a list of UIDs, their display labels, general subgraph label, and colour.

Constructors

NF 

Fields

  • nodeUIDs :: [UID]

    Node UIDs.

  • nodeLabels :: [Label]

    Display labels for nodes. We use the reference addresses from the UIDs.

  • nfLabel :: Label

    Individual subgraph labels. These labels do not show on the final generated pdf or png files.

  • nfColour :: Colour

    Gives the ability to change colours of bubbles within the graph.

Functions

outputDot :: FilePath -> GraphInfo -> IO () Source #

Creates the directory for output, gathers all individual graph output functions and calls them.

HTML

Printer

genHTML :: PrintingInformation -> String -> Document -> Doc Source #

Generate an HTML document from a Drasil Document.

Helpers

makeCSS :: Document -> Doc Source #

Generates the CSS selectors necessary for a document.

Markdown

Printer

makeMd :: [Doc] -> Doc Source #

Combines a list of sentences into a final Doc, also appends end note.

Section Printers

introInfo :: String -> [String] -> Doc Source #

Example title and purpose section.

verInfo :: String -> String -> Doc Source #

Language version section.

unsupOS :: Maybe String -> Doc Source #

Invalid Operating Systems section, does not display unless atleast 1 invalid OS.

regularSec :: Doc -> Doc -> Doc Source #

Constructs regular section section from header and message.

instDoc :: [String] -> Doc Source #

Instruction section, contains 3 paragraphs, Running, Building and Config Files. The Config file section is only displayed if there are configuration files.

extLibSec :: [(String, String)] -> [String] -> Doc Source #

External Libraries section. The inputs are a list of name and version pairs and a list of the corresponding version numbers, these are first combined into a list of triplets, and then each printed on a new line.

endNote :: [String] -> Doc Source #

End section.

Plain

Types

data Linearity Source #

Data is either linear or not.

Constructors

Linear 
Nonlinear 

Functions

sentenceDoc :: ChunkDB -> Stage -> Linearity -> Sentence -> Doc Source #

Create sentences for a document in Doc format.

exprDoc :: ChunkDB -> Stage -> Linearity -> Expr -> Doc Source #

Create expressions for a document in Doc format.

codeExprDoc :: ChunkDB -> Stage -> Linearity -> CodeExpr -> Doc Source #

Create code expressions for a document in Doc format.

symbolDoc :: Symbol -> Doc Source #

Create symbols for a document in Doc format.

unitDoc :: Linearity -> USymb -> Doc Source #

Helper for printing units in Doc format.

showSymb :: Symbol -> String Source #

Helper for printing Symbols

showHasSymbImpl :: HasSymbol x => x -> String Source #

Helper for printing a HasSymbol in Implementation Stage

TeX

genTeX :: Document -> PrintingInformation -> Doc Source #

Generates a LaTeX document.

Jupyter

genJSON :: PrintingInformation -> Document -> Doc Source #

Generate a python notebook document (using json).

Log

printAllDebugInfo :: PrintingInformation -> [Doc] Source #

Gathers all printing functions and creates the debugging tables from them.

Printing Information and Options

data PrintingInformation Source #

Printing information contains a database, a stage, and a printing configuration.

Instances

Instances details
HasPrintingOptions PrintingInformation Source #

Finds the notation used for the PrintingConfiguration within the PrintingInformation.

Instance details

Defined in Language.Drasil.Printing.PrintingInformation

piSys :: SystemInformation -> Stage -> PrintingConfiguration -> PrintingInformation Source #

Builds a document's printing information based on the system information.

class HasPrintingOptions c where Source #

Able to be printed.

Methods

getSetting :: Lens' c Notation Source #

Holds the printing notation.

data Notation Source #

Notation can be scientific or for engineering.

Constructors

Scientific 
Engineering 

defaultConfiguration :: PrintingConfiguration Source #

Default configuration is for engineering.