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

Language.Drasil.Printers

Synopsis

Formats

data DocType Source #

Document types include Software Requirements Specification and Website. Choosing SRS will generate both TeX and HTML files, while Website generates only as HTML. This also determines what folders the generated files will be placed into.

Constructors

SRS 
Website 
Lesson 

Instances

Instances details
Show DocType Source #

Shows the different types of documents.

Instance details

Defined in Language.Drasil.Format

data Format Source #

Possible formats for printer output.

Constructors

TeX 
HTML 
Jupyter 
MDBook 

Instances

Instances details
Show Format Source # 
Instance details

Defined in Language.Drasil.Format

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] -> Maybe String -> Maybe String -> Doc Source #

Example title, authors, and maybe 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] -> String -> (String, String) -> Doc Source #

Instruction section, contains 4 paragraphs, Running, Building, Input-Output 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 :: Int -> [String] -> Doc Source #

End section.

whatInfo :: Maybe String -> Maybe String -> Doc Source #

What section in generated README file, displays description and scope if not empty

Plain

Types

data SingleLine Source #

Data is either linear or not.

Constructors

OneLine 
MultiLine 

Functions

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

Create sentences for a document in Doc format.

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

Create expressions for a document in Doc format.

codeExprDoc :: ChunkDB -> Stage -> SingleLine -> 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 :: SingleLine -> 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

genJupyter :: PrintingInformation -> DocType -> Document -> Doc Source #

Generate a python notebook document (using json). build : build the SRS document in JSON format build': build the general Jupyter Notbook document

Markdown

genMDBook :: PrintingInformation -> Document -> [(Filename, Doc)] Source #

Generate a mdBook SRS

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

Prints the .toml config file for mdBook.

makeRequirements :: PrintingInformation -> Doc Source #

Prints the .csv file mapping the original filepaths of assets to the location mdBook uses.

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.