-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Lua module wrapping Text.DocLayout. -- -- Lua module wrapping Text.DocLayout. @package hslua-module-doclayout @version 0.1.0 -- | Provides a Lua module which wraps DocLayout. The -- Doc' type is specialized to Text@. -- -- This module defines orphan instances for Doc Text. module Foreign.Lua.Module.DocLayout -- | Pushes the doclayout module to the Lua stack. pushModule :: Lua NumResults -- | Add the doclayout module under the given name to the table of -- preloaded packages. preloadModule :: String -> Lua () -- | Creates a Doc which is conditionally included only if -- it comes at the beginning of a line. after_break :: Text -> Lua (Doc Text) -- | Conditionally includes the given Doc unless it is -- followed by a blank space. before_non_blank :: Doc Text -> Lua (Doc Text) -- | Inserts a blank line unless one exists already. blankline :: Doc Text -- | Insert blank lines unless they exist already. blanklines :: Int -> Lua (Doc Text) -- | Puts a Doc in curly braces. braces :: Doc Text -> Lua (Doc Text) -- | Puts a Doc in square brackets. brackets :: Doc Text -> Lua (Doc Text) -- | Like lblock but aligned centered. cblock :: Int -> Doc Text -> Lua (Doc Text) -- | Chomps trailing blank space off of a Doc. chomp :: Doc Text -> Lua (Doc Text) -- | Concatenates a list of Docs. concat :: [Doc Text] -> Optional (Doc Text) -> Lua (Doc Text) -- | A carriage return. Does nothing if we're at the beginning of a line; -- otherwise inserts a newline. cr :: Doc Text -- | Wraps a Doc in double quotes double_quotes :: Doc Text -> Lua (Doc Text) -- | The empty document. empty :: Doc Text -- | Makes a Doc flush against the left margin. flush :: Doc Text -> Lua (Doc Text) -- | Creates a hanging indent. hang :: Int -> Doc Text -> Doc Text -> Lua (Doc Text) -- | Encloses a Doc inside a start and end -- Doc. inside :: Doc Text -> Doc Text -> Doc Text -> Lua (Doc Text) -- | Creates a block with the given width and content, aligned to the left. lblock :: Int -> Doc Text -> Lua (Doc Text) -- | Creates a Doc from a string. literal :: Text -> Lua (Doc Text) -- | Indents a Doc by the specified number of spaces. nest :: Int -> Doc Text -> Lua (Doc Text) -- | Removes leading blank lines from a Doc. nestle :: Doc Text -> Lua (Doc Text) -- | Makes a Doc non-reflowable. nowrap :: Doc Text -> Lua (Doc Text) -- | Puts a Doc in parentheses. parens :: Doc Text -> Lua (Doc Text) -- | 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). prefixed :: Text -> Doc Text -> Lua (Doc Text) -- | Wraps a Doc in single quotes. quotes :: Doc Text -> Lua (Doc Text) -- | Like lblock but aligned to the right. rblock :: Int -> Doc Text -> Lua (Doc Text) -- | A breaking (reflowable) space. space :: Doc Text vfill :: Text -> Lua (Doc Text) -- | Render a Doc. 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. render :: Doc Text -> Optional Int -> Lua Text -- | True iff the document is empty. is_empty :: Doc Text -> Lua Bool -- | Returns the height of a block or other Doc. height :: Doc Text -> Lua Int -- | Returns the minimal width of a Doc when reflowed at -- breakable spaces. min_offset :: Doc Text -> Lua Int -- | Returns the width of a Doc. offset :: Doc Text -> Lua Int -- | 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. real_length :: Text -> Lua Int -- | Returns the column that would be occupied by the last laid out -- character. update_column :: Doc Text -> Int -> Lua Int -- | Retrieve a Doc Text value from the Lua stack. Strings are -- converted to plain Doc values. peekDoc :: StackIndex -> Lua (Doc Text) -- | Push a Doc Text value to the Lua stack. pushDoc :: Doc Text -> Lua () instance Foreign.Lua.Types.Peekable.Peekable (Text.DocLayout.Doc Data.Text.Internal.Text) instance Foreign.Lua.Types.Pushable.Pushable (Text.DocLayout.Doc Data.Text.Internal.Text)