{-# OPTIONS_HADDOCK show-extensions #-} {-| Module : Text.BBCode Description : Main module exporting builder interface and types License : GPL-3 Stability : experimental Portability : GHC Usually you only need to import that module, which reexports most of the functionality. If you need 'lens' definitions for types, import "Text.BBCode.Lens" If you need interface to parsing, see "Text.BBCode.Parser" -} module Text.BBCode ( -- * Builder -- | Functions for constructing AST in a more elegant way than directly using type constructors. -- -- This wrappers are usually no more than partially applied data -- constructors. An exception to that is 'list' and 'listFlavor' functions, -- which adds 'listEl' before each element. This is implementation detail -- and shouldn't bother you unless you work with AST directly -- ** Void elements -- | Void elements' data constructors only specify the type of the -- element(e.g. 'HR', 'Clear', @...@), -- such element don't have any content unlike other types of elements. -- -- see 'ElVoid' nl , hr , br , clear , listEl -- ** Simple elements -- | Simple elements have contents, usually 'BBCode'. 'text' is not actually a -- simple element builder and included here just for convenience -- -- see 'ElSimple' , text , doc , docNL , bold , italic , underline , strikethrough , indent , nfo , oneline , code , pre , box , image , quote , spoiler , list -- ** Elements with an argument -- | Apart from having contents, following elements also have argument. It -- can indicate position, color, or something else. -- -- see 'ElArg' , boxAlign , imageAlign , quoteNamed , spoilerNamed , listFlavor , color , url , size , align , font -- * Types , BBCode (..) , El (..) , IsArgument (..) , ListFlavor (..) -- ** Alignment and position -- | There are three different position types because 'align', 'image', -- 'boxAlign' all have different sets of valid positions. You can notice -- that all these types have different number of valid positions. , AlignPosition (..) , ImagePosition (..) , BoxPosition (..) -- * Pretty-printer , pretty -- * Parser -- | A small part of "Text.BBCode.Parser". Dedicated module has an interface -- to parsing specific elements as well as different parser runners. -- -- These should be sufficient for parsing whole document. , bbcode , runParserMaybeEnv ) where import Text.BBCode.Internal.Builder import Text.BBCode.Internal.Parser (bbcode, runParserMaybeEnv) import Text.BBCode.Internal.Pretty import Text.BBCode.Internal.Types