cabal-gild-1.3.1.0: Formats package descriptions.
Safe HaskellSafe-Inferred
LanguageHaskell2010

CabalGild.Unstable.Action.Render

Synopsis

Documentation

run :: Applicative m => ([Field (Position, [Comment p])], [Comment p]) -> m ByteString Source #

A wrapper around toByteString to allow this to be composed with other actions.

toByteString :: [Field (Position, [Comment p])] -> [Comment p] -> ByteString Source #

Renders the given fields and comments to a byte string.

fields :: Int -> [Field (Position, [Comment p])] -> Block Source #

Renders the given fields to a block at the given indentation level.

field :: Int -> Field (Position, [Comment p]) -> Block Source #

Renders the given field to a block at the given indentation level.

If a field only has one line and no comments, then it can be rendered all on one line.

sameRow :: (Position, cs) -> (Position, cs) -> Bool Source #

Returns true if the two positions are on the same row.

name :: Name a -> Chunk Source #

Renders the given name to a chunk.

fieldLines :: Int -> [FieldLine (p, [Comment q])] -> Block Source #

Renders the given field lines to a block at the given indentation level.

fieldLineC :: Int -> FieldLine (p, [Comment q]) -> Block Source #

Renders the given field line and its comments to a block at the given indentation level.

fieldLine :: Int -> FieldLine a -> Line Source #

Renders the given field line to a line at the given indentation level.

sectionArgs :: [SectionArg a] -> Chunk Source #

Renders the given section arguments to a chunk. Note that comments are ignored. In practice this isn't a problem because section arguments can't have comments attached anyway.

sectionArg :: SectionArg a -> Chunk Source #

Renders the given section argument to a chunk.

comments :: Int -> [Comment a] -> Block Source #

Renders the given comments to a block at the given indentation level.

comment :: Int -> Comment a -> Line Source #

Renders the given comment to a line at the given indentation level.