Expand description
A crate for parsing Bib(La)TeX files.
The main API entrypoint is the Bibliography
struct.
§Example
Finding out the author of a work.
let src = "@book{tolkien1937, author = {J. R. R. Tolkien}}";
let bibliography = Bibliography::parse(src).unwrap();
let entry = bibliography.get("tolkien1937").unwrap();
let author = entry.author().unwrap();
assert_eq!(author[0].name, "Tolkien");
Structs§
- Bibliography
- A fully parsed bibliography.
- Date
- A date or a range of dates and their certainty and exactness.
- Datetime
- Timezone-unaware date and time.
- Entry
- A bibliography entry containing chunk fields, which can be parsed into more specific types on demand.
- Pair
- The keys for fields and their values.
- Parse
Error - An error that might occur during initial parsing of the bibliography.
- Person
- An author, editor, or some other person affiliated with a cited work.
- RawBibliography
- A literal representation of a bibliography file, with abbreviations not yet resolved.
- RawEntry
- A raw extracted entry, with abbreviations not yet resolved.
- Report
- A report of the validity of an
Entry
. Can be obtained by callingEntry::verify
. - Spanned
- A value with the span it corresponds to in the source code.
- Time
- A potentially timezone aware time.
- Type
Error - An error that may occur while parsing the chunks in a field into a specific
Type
.
Enums§
- Chunk
- Represents one part of a field value.
- Date
Value - A single date or a range of dates.
- Editor
Type - Which role the according editor had.
- Entry
Type - Describes the type of a bibliographical entry.
- Gender
- Gender of the author or editor (if no author was specified).
- Pagination
- Defines the pagination scheme to use for formatting purposes.
- Parse
Error Kind - Error conditions that might occur during initial parsing of the bibliography.
- Permissive
Type - A value that could be either a typed value or a literal string.
- RawChunk
- A literal representation of a bibliography entry field.
- Retrieval
Error - Errors that can occur when retrieving a field of an
Entry
. - Time
Offset - A timezone offset.
- Token
- A token that can be encountered during parsing.
- Type
Error Kind - Error conditions that might occur while parsing the chunks in a field into a specific
Type
.
Traits§
- Chunks
Ext - Additional methods for chunk slices.
- Type
- Convert Bib(La)TeX data types from and to chunk slices.
Functions§
- parse_
colon - Parse a colon.
- parse_
hyphen - Parse a hyphen.