-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Highlight source code using Pygments -- -- Highlight source code using Pygments http://pygments.org. This -- package depends on Pygments and its accompanying pygmentize -- script. @package hpygments @version 0.2.0 module Text.Highlighting.Pygments.Formatters type FormatterAlias = String data Formatter getAllFormatters :: IO [Formatter] -- | Similar to the get_formatter_by_name() function in Pygments getFormatterByName :: FormatterAlias -> IO (Maybe Formatter) formatterName :: Formatter -> String formatterAliases :: Formatter -> [FormatterAlias] htmlFormatter :: Formatter terminalFormatter :: Formatter instance Data.Aeson.Types.Class.ToJSON Text.Highlighting.Pygments.Formatters.Formatter instance Data.Aeson.Types.Class.FromJSON Text.Highlighting.Pygments.Formatters.Formatter instance GHC.Show.Show Text.Highlighting.Pygments.Formatters.Formatter instance GHC.Classes.Ord Text.Highlighting.Pygments.Formatters.Formatter instance GHC.Classes.Eq Text.Highlighting.Pygments.Formatters.Formatter module Text.Highlighting.Pygments.Lexers type LexerAlias = String data Lexer getAllLexers :: IO [Lexer] -- | Similar to the get_lexer_by_name() function in Pygments getLexerByName :: LexerAlias -> IO (Maybe Lexer) lexerName :: Lexer -> String lexerAliases :: Lexer -> [LexerAlias] lexerFileTypes :: Lexer -> [String] lexerMimeTypes :: Lexer -> [String] haskellLexer :: Lexer literateHaskellLexer :: Lexer -- | No highlighting textLexer :: Lexer instance Data.Aeson.Types.Class.ToJSON Text.Highlighting.Pygments.Lexers.Lexer instance Data.Aeson.Types.Class.FromJSON Text.Highlighting.Pygments.Lexers.Lexer instance GHC.Show.Show Text.Highlighting.Pygments.Lexers.Lexer instance GHC.Classes.Ord Text.Highlighting.Pygments.Lexers.Lexer instance GHC.Classes.Eq Text.Highlighting.Pygments.Lexers.Lexer -- | This library uses the pygmentize script that comes with -- Pygments to highlight code in many languages. For documentation on the -- various lexers, formatters, and options, see the Pygments -- documentation http://pygments.org/docs/. module Text.Highlighting.Pygments -- | Highlight code robustly. This function is more robust than the -- lower-level pygmentize function since this library forbids the -- construction of invalid Lexer and Formatter values. -- Invalid Options may still cause this function to raise an -- exception. highlight :: Lexer -> Formatter -> Options -> String -> IO String -- | Highlight code (less robustly) using the pygmentize script -- that comes with Pygments. Invalid values for LexerAlias, -- FormatterAlias, or Options will cause this function to -- raise an exception. pygmentize :: LexerAlias -> FormatterAlias -> Options -> String -> IO String -- | The lexer/formatter option (key, value) is passed to the -- pygmentize script via the command-line flag -P -- key=value. -- -- Examples: -- --
-- [("hl_lines", "16,23,42"), ("encoding", "utf-8"), ("anchorlines", "True")]
--
type Option = (String, String)
type Options = [Option]