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

Language.Drasil.HTML.Helpers

Description

Helper functions for creating HTML printers (specifically, HTML tag wrappers).

Synopsis

Documentation

data BibFormatter Source #

Data type that carries functions that vary for bib printing

Constructors

BibFormatter 

Fields

html :: Doc -> Doc Source #

HTML tag wrapper.

headTag :: Doc -> Doc Source #

Head tag wrapper.

body :: Doc -> Doc Source #

Body tag wrapper.

title :: Doc -> Doc Source #

Title tag wrapper.

paragraph :: Doc -> Doc Source #

Paragraph tag wrapper.

code :: Doc -> Doc Source #

Code tag wrapper.

tr :: Doc -> Doc Source #

Table row tag wrapper.

th :: Doc -> Doc Source #

Table header tag wrapper.

td :: Doc -> Doc Source #

Table cell tag wrapper.

figure :: Doc -> Doc Source #

Figure tag wrapper.

figcaption :: Doc -> Doc Source #

Figcaption tag wrapper.

li :: Doc -> Doc Source #

List tag wrapper.

pa :: Doc -> Doc Source #

Paragraph in list tag wrapper.

ba :: Doc -> Doc Source #

Bring attention to element wrapper.

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

Ordered list tag wrapper.

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

Unordered list tag wrapper.

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

Table tag wrapper.

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

Image tag wrapper.

h :: Int -> Doc -> Doc Source #

Helper for HTML headers.

data Variation Source #

HTML attribute selector.

Constructors

Class 
Id 
Align 

Instances

Instances details
Show Variation Source # 
Instance details

Defined in Language.Drasil.HTML.Helpers

Eq Variation Source # 
Instance details

Defined in Language.Drasil.HTML.Helpers

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

General Class wrapper function and formats the document space with cat.

wrap' :: String -> [String] -> Doc -> Doc Source #

General wrapper function and formats the document space with hcat.

wrapGen' :: ([Doc] -> Doc) -> Variation -> String -> Doc -> [String] -> Doc -> Doc Source #

Helper for wrapping HTML tags. The fourth argument provides class names for the CSS.

wrapGen :: Variation -> String -> Doc -> [String] -> Doc -> Doc Source #

General wrapper that formats the document space nicely.

tagL :: String -> Variation -> Doc -> Doc Source #

Helper for creating a left HTML tag with a single attribute.

tagR :: String -> Doc Source #

Helper for creating a right HTML closing tag.

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

Helper for wrapping attributes in a tag.

  • The first argument is tag name.
  • The Space in the pair is the attribute name,
  • The Doc is the value for different attributes.

caption :: Doc -> Doc Source #

Helper for setting up captions.

refwrap :: Doc -> Doc -> Doc Source #

Helper for wrapping divisions or sections.

reflink :: String -> Doc -> Doc Source #

Helper for setting up links to references.

reflinkInfo :: String -> Doc -> Doc -> Doc Source #

Helper for setting up links to references with additional information.

reflinkURI :: String -> Doc -> Doc Source #

Helper for setting up links to external URIs.

image :: Doc -> Maybe Doc -> MaxWidthPercent -> Doc Source #

Helper for setting up figures.

em :: Doc -> Doc Source #

Emphasis (italics) tag.

sup :: Doc -> Doc Source #

Superscript tag.

sub :: Doc -> Doc Source #

Subscript tag.

bold :: Doc -> Doc Source #

Bold tag.

articleTitle :: Doc -> Doc Source #

Title header.

author :: Doc -> Doc Source #

Author header.

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

Div tag wrapper.

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

Span tag wrapper.

indent :: Doc -> Doc Source #

Indent the Document by 2 positions.

makeCases :: [(Expr, Expr)] -> (Expr -> Doc) -> Doc Source #

Create and markup fractions fraction :: Doc -> Doc -> Doc fraction a b = divTag ["fraction"] (spanTag ["fup"] a $$ spanTag ["fdn"] b)

Build case expressions.