Skip to content

ugent-library/bibtex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Reference

ugent-library/bibtex

Robust (as in forgiving) Golang BibTeX parser

Examples

p := bibtex.NewParser(os.Stdin)
for {
    e, err := p.Next()
    if err != nil {
        log.Fatal(err)
    }
    if e == nil {
        break
    }
    
    fmt.Printf("bibtex entry: %s", e.Raw)
    fmt.Printf("type: %s", e.Type)
    fmt.Printf("key: %s", e.Key)
    for _, f := range e.Fields {
        fmt.Printf("field %s: %s", f.Name, f.Value)
    }
    for _, a := range e.Authors {
        fmt.Printf("author: %s", a)
    }
    for _, a := range e.Editors {
        fmt.Printf("editor: %s", a)
    }
}

Releases

No releases published

Packages

No packages published

Languages