Documentation
¶
Index ¶
- func ExportBibtex(citations []Citation)
- func ExportJson(citations []Citation)
- type Citation
- func (self *Citation) CopyFile(file string) string
- func (self *Citation) GetAuthorCitekey() string
- func (self *Citation) GetAuthorTui() string
- func (self *Citation) GetAuthorsSql(citAuthors []CitationAuthor) string
- func (self *Citation) GetCiteKey() string
- func (self *Citation) GetTitle() string
- func (self *Citation) GetYear() string
- func (self Citation) Print()
- type CitationAuthor
- type CitationShort
- type Client
- type ClientType
- type Crossref
- type CrossrefFields
- type Datacite
- type DataciteFields
- type DatePart
- type ResourceLink
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Citation ¶
type Citation struct { Address string // address Author []CitationAuthor Booktitle string // booktitle Chapter string // chapter Citekey string // citekey (generated) Doi string // doi Editor []CitationAuthor File string // appended file Howpublished string // how published Institution string // institution Id int // database id (generated) Isbn string // isbn Issn string // issn Journal string // journal name Number string // issue number Organization string // organization Pages string // pages Publisher string // publisher ResourceType string // needs to be converted to bibtex entry type Series string // series School string // school Title string // title Url string // doi url UrlDate string // access date (generated) Volume string // volume Year string // year }
the organized form of a citation
func ParseFromBibtex ¶
tries to parse a bibtex string to []Citation assumes a reasonably well formatted bibtex file https://www.bibtex.com/g/bibtex-format/
func (*Citation) GetAuthorCitekey ¶
returns author abbreviation for citekey
func (*Citation) GetAuthorTui ¶
returns short author string for TUI either:
family name (if one author), family and family (2 authors), family et al. (more authors)
func (*Citation) GetAuthorsSql ¶
func (self *Citation) GetAuthorsSql(citAuthors []CitationAuthor) string
returns authors as delimited string for the sql database
type CitationAuthor ¶
an author's family and given name
func ParseAuthorsSql ¶
func ParseAuthorsSql(authors string) []CitationAuthor
parses authors delimited string to []CitationAuthor
type CitationShort ¶
'short' citations for json export
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
crossref / datacite api
type ClientType ¶
type ClientType int
which api to choose
const ( CrossRefClient ClientType = 0 DataCiteClient ClientType = 1 )
type Crossref ¶ added in v0.0.2
type Crossref struct { Status string `json:"status"` MessageType string `json:"message-type"` MessageVersion string `json:"message-version"` Message CrossrefFields `json:"message"` }
type CrossrefFields ¶ added in v0.0.2
type CrossrefFields struct { Author []CitationAuthor `json:"author"` ContainerTitle []string `json:"container-title"` DOI string `json:"DOI"` Editor []CitationAuthor `json:"editor"` ISBN []string `json:"ISBN"` ISSN []string `json:"ISSN"` Issue string `json:"issue"` Link []ResourceLink `json:"link"` Page string `json:"page"` Publisher string `json:"publisher"` Title []string `json:"title"` Type string `json:"type"` URL string `json:"URL"` Volume string `json:"volume"` Published DatePart `json:"published"` }
type Datacite ¶ added in v0.0.2
type Datacite struct { Data struct { Attributes DataciteFields `json:"attributes"` } `json:"data"` }
type DataciteFields ¶ added in v0.0.2
type DataciteFields struct { Author []CitationAuthor `json:"author"` Container string `json:"container-title"` Doi string `json:"doi"` Identifier string `json:"identifier"` Publisher string `json:"publisher"` Title string `json:"title"` Type string `json:"resource-type-id"` Url string `json:"url"` Year string `json:"published"` }
type ResourceLink ¶ added in v0.0.2
type ResourceLink struct {
URL string `json:"URL"`
}
Click to show internal directories.
Click to hide internal directories.