openapi3-code-generator-0.2.0.0: OpenAPI3 Haskell Client Code Generator
Safe HaskellSafe-Inferred
LanguageHaskell2010

OpenAPI.Generate.Doc

Description

Utility functions for Doc manipulation

Synopsis

Documentation

typeAliasModule :: String Source #

The name of the module which contains all type aliases which would be in their own module otherwise

emptyDoc :: Applicative f => f Doc Source #

Empty document inside an Applicative (typically Q)

appendDoc :: Applicative f => f Doc -> f Doc -> f Doc Source #

Append a Doc to another inside an Applicative (typically Q)

generateHaddockComment :: [Text] -> Doc Source #

Generate a Haddock comment with multiple lines

escapeText :: Text -> Text Source #

Escape text for use in Haddock comment

breakOnTokens :: [Text] -> Doc -> Doc Source #

Add line breaks to a Doc at all occurrences of the passed tokens (removes all other line breaks).

sideComments :: [Text] -> Doc Source #

Convert a list of lines to side comments

zipCodeAndComments :: [Text] -> [Text] -> Doc Source #

Intertwine code lines with comment lines

The code lines should have one more line (the first line is not commented)

sideBySide :: Doc -> Doc -> Doc Source #

Place two documents side-by-side, aligned at the top line

If one of the documents is longer than the other, the shorter one is extended with empty lines.

Example usage:

>>> show $ sideBySide (text "a") (text "b" $$ text "c")
a b
c

addOperationsModuleHeader :: String -> String -> String -> Doc -> Doc Source #

Add the module header to a module of an operation

addSecuritySchemesModuleHeader :: String -> Doc -> Doc Source #

Add the module header to the security scheme module

addConfigurationModuleHeader :: String -> Doc -> Doc Source #

Add the module header to the configuration module

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

Create a Doc containing a module which imports other modules and re-exports them

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

Add the module header to a module of a model