| Copyright | © 2020 Albert Krewinkel |
|---|---|
| License | MIT |
| Maintainer | Albert Krewinkel <albert+hslua@zeitkraut.de> |
| Stability | alpha |
| Portability | Requires GHC 8 or later. |
| Safe Haskell | None |
| Language | Haskell2010 |
Foreign.Lua.Module.DocLayout
Description
Synopsis
- pushModule :: Lua NumResults
- preloadModule :: String -> Lua ()
- description :: Text
- fields :: [Field]
- functions :: [(Text, HaskellFunction)]
- after_break :: HaskellFunction
- before_non_blank :: HaskellFunction
- blankline :: Field
- blanklines :: HaskellFunction
- braces :: HaskellFunction
- brackets :: HaskellFunction
- cblock :: HaskellFunction
- chomp :: HaskellFunction
- concat :: HaskellFunction
- cr :: Field
- double_quotes :: HaskellFunction
- empty :: Field
- flush :: HaskellFunction
- hang :: HaskellFunction
- inside :: HaskellFunction
- lblock :: HaskellFunction
- literal :: HaskellFunction
- nest :: HaskellFunction
- nestle :: HaskellFunction
- nowrap :: HaskellFunction
- parens :: HaskellFunction
- prefixed :: HaskellFunction
- quotes :: HaskellFunction
- rblock :: HaskellFunction
- space :: Field
- vfill :: HaskellFunction
- render :: HaskellFunction
- is_empty :: HaskellFunction
- height :: HaskellFunction
- min_offset :: HaskellFunction
- offset :: HaskellFunction
- real_length :: HaskellFunction
- update_column :: HaskellFunction
- peekDoc :: Peeker (Doc Text)
- pushDoc :: Pusher (Doc Text)
Module
pushModule :: Lua NumResults Source #
Pushes the doclayout module to the Lua stack.
preloadModule :: String -> Lua () Source #
Add the doclayout module under the given name to the table
of preloaded packages.
description :: Text Source #
Textual description of the "doclayout" module.
functions :: [(Text, HaskellFunction)] Source #
Exposed module functions.
Doc constructors and combinators
after_break :: HaskellFunction Source #
Creates a which is conditionally included only if it
comes at the beginning of a line.Doc
before_non_blank :: HaskellFunction Source #
Conditionally includes the given unless it is
followed by a blank space.Doc
blanklines :: HaskellFunction Source #
Insert blank lines unless they exist already.
braces :: HaskellFunction Source #
Puts a in curly braces.Doc
brackets :: HaskellFunction Source #
Puts a in square brackets.Doc
cblock :: HaskellFunction Source #
Like but aligned centered.lblock
chomp :: HaskellFunction Source #
Chomps trailing blank space off of a .Doc
concat :: HaskellFunction Source #
Concatenates a list of s.Doc
double_quotes :: HaskellFunction Source #
Wraps a in double quotesDoc
flush :: HaskellFunction Source #
Makes a flush against the left margin.Doc
hang :: HaskellFunction Source #
Creates a hanging indent.
lblock :: HaskellFunction Source #
Creates a block with the given width and content, aligned to the left.
literal :: HaskellFunction Source #
Creates a from a string.Doc
nest :: HaskellFunction Source #
Indents a by the specified number of spaces.Doc
nestle :: HaskellFunction Source #
Removes leading blank lines from a .Doc
nowrap :: HaskellFunction Source #
Makes a non-reflowable.Doc
parens :: HaskellFunction Source #
Puts a in parentheses.Doc
prefixed :: HaskellFunction Source #
Uses the specified string as a prefix for every line of the inside document (except the first, if not at the beginning of the line).
quotes :: HaskellFunction Source #
Wraps a in single quotes.Doc
rblock :: HaskellFunction Source #
Like but aligned to the right.rblock
vfill :: HaskellFunction Source #
An expandable border that, when placed next to a box, expands to the height of the box. Strings cycle through the list provided.
Rendering
render :: HaskellFunction Source #
Render a . The text is reflowed on breakable spaces
to match the given line length. Text is not reflowed if the
line length parameter is omitted or nil.Doc
Document Querying
is_empty :: HaskellFunction Source #
True iff the document is empty.
height :: HaskellFunction Source #
Returns the height of a block or other Doc.
min_offset :: HaskellFunction Source #
Returns the minimal width of a when reflowed at
breakable spaces.Doc
offset :: HaskellFunction Source #
Returns the width of a .Doc
real_length :: HaskellFunction Source #
Returns the real length of a string in a monospace font: 0 for a combining character, 1, for a regular character, 2 for an East Asian wide character.
update_column :: HaskellFunction Source #
Returns the column that would be occupied by the last laid out character.