-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Parse, format and processing BibTeX files
--   
--   This package allows parsing, formatting and processing of BibTeX
--   files. BibTeX files are databases for literature for the natbib
--   package of the LaTeX typesetting system.
--   
--   The package contains two examples:
--   
--   <ul>
--   <li>The first example demonstrates the BibTeX parser by generating a
--   publication overview from a <tt>.bib</tt> file.</li>
--   <li>The second example demonstrates the BibTeX generation by producing
--   a large <tt>.bib</tt> file from the tar archive that cabal-install
--   downloads to your local cabal directory.</li>
--   </ul>
--   
--   Both examples will be build as stand-alone executable when running
--   
--   <pre>
--   cabal install -fbuildExamples bibtex
--   </pre>
--   
--   For the first example see the <tt>publications</tt> directory of this
--   package. You can start the program and build an example document by
--   running
--   
--   <pre>
--   make pubs
--   </pre>
--   
--   Technically the program generates a list of custom <tt>\nocite</tt>
--   commands for the LaTeX package <tt>multibib</tt>. You can add the
--   custom bibtex field <tt>subtype</tt> to BibTeX entries for more
--   detailed categorization of an entry. See
--   "publications/publications.bib" for examples.
--   
--   The second example can be executed using
--   
--   <pre>
--   make hackbib
--   </pre>
--   
--   The file <tt>hackage.bib</tt> is written to the <tt>hackage</tt>
--   subdirectory. The <tt>hackage-bibtex</tt> program reads an
--   uncompressed tar archive from standard input and writes the result
--   bibliography file to standard output.
--   
--   Note that <tt>hackage.bib</tt> exceeds some limits of standard BibTeX
--   and LaTeX: There are currently much more than 5000 versions of
--   packages, the maximum my BibTeX can handle at once. That is, you can
--   use the bibliography file, but you cannot cite all entries with
--   <tt>\nocite*</tt>. If there are more than 26 uploads by the same
--   author in a year, the BibTeX style <tt>alpha</tt> generates
--   identifiers including curly braces which interacts badly with LaTeX's
--   handling of them. If you reduce the Bibliography file to 5000 entries
--   and try to generate an overview of all entries with <tt>\nocite</tt>,
--   then <tt>pdflatex</tt> hits its limits:
--   
--   <pre>
--   TeX capacity exceeded, sorry [save size=5000]
--   </pre>
@package bibtex
@version 0.1.0.6

module Text.BibTeX.Entry
data T
Cons :: String -> String -> [(String, String)] -> T
[entryType] :: T -> String
[identifier] :: T -> String
[fields] :: T -> [(String, String)]

-- | Convert the name style "Surname, First name" into "First name
--   Surname".
flipName :: String -> String
lowerCaseFieldNames :: T -> T
instance GHC.Show.Show Text.BibTeX.Entry.T

module Text.BibTeX.Format
entry :: T -> String
enumerate :: [String] -> String
authorList :: [String] -> String
commaSepList :: [String] -> String
sepList :: Char -> [String] -> String


-- | The parsers in this module also skip trailing spaces.
module Text.BibTeX.Parse

-- | Beware that this and all other parsers do not accept leading spaces,
--   cf. <a>skippingSpace</a>. That is when encountering leading white
--   spaces the parser will just return an empty list. If you want to parse
--   a file that contains entirely of BibTeX data you better call
--   <tt>skippingLeadingSpace file</tt> instead. However, the <tt>file</tt>
--   parser is more combinable and can be used for files that contain both
--   BibTeX and other data or it can be used for automated filetype
--   checking.
file :: Parser [T]
comment :: Parser String

-- | Parse a BibTeX entry like
--   
--   <pre>
--   @article{author2010title,
--     author = {Firstname Surname},
--     title = {Title},
--     year = 2010,
--     month = jul,
--   }
--   </pre>
--   
--   .
entry :: Parser T

-- | Parse an assignment like
--   
--   <pre>
--   author = {Firstname Surname}
--   </pre>
--   
--   .
assignment :: Parser (String, String)

-- | Parse a value like
--   
--   <pre>
--   jul
--   </pre>
--   
--   or
--   
--   <pre>
--   2010
--   </pre>
--   
--   or
--   
--   <pre>
--   {Firstname Surname}
--   </pre>
--   
--   or
--   
--   <pre>
--   "Firstname Surname"
--   </pre>
--   
--   .
value :: Parser String

-- | Parse a sequence of <a>texBlock</a>s until the occurrence of a closing
--   character. The closing character is not part of the result.
texSequence :: Char -> Parser String

-- | Parse a single character like <tt>a</tt>, a LaTeX macro call like
--   <tt>\alpha</tt> or a block enclosed in curly braces like
--   <tt>{\"{a}bc}</tt>.
texBlock :: Char -> Parser String
identifier :: CharParser st String

-- | Parse a name of a BibTeX entry like <tt>author2010title</tt>.
bibIdentifier :: Parser String

-- | Extends a parser, such that all trailing spaces are skipped. It might
--   be more comfortable to skip all leading spaces, but parser written
--   that way are hard to combine. This is so, since if you run two parsers
--   in parallel and both of them expect leading spaces, then the parser
--   combinator does not know which one of the parallel parsers to choose.
--   
--   See also: <a>lexeme</a>.
skippingSpace :: Parser a -> Parser a
skippingLeadingSpace :: Parser a -> Parser a

-- | Split a string at the commas and remove leading spaces.
splitCommaSepList :: String -> [String]

-- | Split a string containing a list of authors in BibTeX notation.
splitAuthorList :: String -> [String]
splitSepList :: Char -> String -> [String]
