Documentation
¶
Overview ¶
Package citation converts MARC 21 records to the RIS and BibTeX citation formats used by reference managers (Zotero, EndNote, Mendeley) and LaTeX.
Citations are a flat, lossy subset of a bibliographic record, so this is a one-way MARC->citation mapping, not a codec. The Writers implement codex.RecordWriter, so they plug into codex.Convert; both formats are self-delimiting (an RIS record ends with ER, a BibTeX entry is a complete @type{...} block), so no Close is needed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteBibTeXFile ¶
WriteBibTeXFile writes every record to the named file in BibTeX format.
func WriteRISFile ¶
WriteRISFile writes every record to the named file in RIS format.
Types ¶
type BibTeXWriter ¶
type BibTeXWriter struct {
// contains filtered or unexported fields
}
BibTeXWriter writes records as a sequence of BibTeX entries.
func NewBibTeXWriter ¶
func NewBibTeXWriter(w io.Writer) *BibTeXWriter
NewBibTeXWriter returns a Writer that writes BibTeX entries to w.
func (*BibTeXWriter) Write ¶
func (wr *BibTeXWriter) Write(r *codex.Record) error
type Entry ¶
type Entry struct {
Title string
Authors []string
Year string
Date string
Publisher string
Place string
Edition string
ISBN []string
ISSN []string
Keywords []string
Language string
Abstract string
URL []string
// contains filtered or unexported fields
}
Entry is the bibliographic information extracted from a record, shared by the RIS and BibTeX renderers.
func FromRecord ¶
func FromRecord(r *codex.Record) *Entry
FromRecord extracts citation fields from a MARC record in a single pass.
type RISWriter ¶
type RISWriter struct {
// contains filtered or unexported fields
}
RISWriter writes records as a sequence of RIS records.
func NewRISWriter ¶
NewRISWriter returns a Writer that writes RIS records to w.