Documentation
¶
Overview ¶
Package csl provides a function to read CSL JSON and convert it to commonmeta.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CMToCSLMappings = map[string]string{
"Article": "article",
"JournalArticle": "article-journal",
"Book": "book",
"BookChapter": "chapter",
"Collection": "collection",
"Dataset": "dataset",
"Document": "document",
"Entry": "entry",
"Event": "event",
"Figure": "figure",
"Image": "graphic",
"LegalDocument": "legal_case",
"Manuscript": "manuscript",
"Map": "map",
"Audiovisual": "motion_picture",
"Patent": "patent",
"Performance": "performance",
"Journal": "periodical",
"PersonalCommunication": "personal_communication",
"Report": "report",
"Review": "review",
"Software": "software",
"Presentation": "speech",
"Standard": "standard",
"Dissertation": "thesis",
"WebPage": "webpage",
}
Functions ¶
func Read ¶ added in v0.2.1
func Read(content content) (commonmeta.Data, error)
Read reads CSL JSON and converts it to commonmeta.
func Write ¶ added in v0.2.4
func Write(data commonmeta.Data) ([]byte, []gojsonschema.ResultError)
Write writes CSL metadata.
func WriteAll ¶ added in v0.2.13
func WriteAll(list []commonmeta.Data) ([]byte, []gojsonschema.ResultError)
WriteAll writes a list of CSL metadata.
Types ¶
type CSL ¶ added in v0.2.4
type CSL struct {
ID string `json:"id"`
Type string `json:"type"`
Abstract string `json:"abstract,omitempty"`
Accessed map[string][][]int `json:"accessed,omitempty"`
Author []Author `json:"author,omitempty"`
ContainerTitle string `json:"container-title,omitempty"`
DOI string `json:"DOI,omitempty"`
ISSN string `json:"ISSN,omitempty"`
Issue string `json:"issue,omitempty"`
Issued map[string][][]int `json:"issued,omitempty"`
Keyword string `json:"keyword,omitempty"`
Language string `json:"language,omitempty"`
License string `json:"license,omitempty"`
Page string `json:"page,omitempty"`
Publisher string `json:"publisher,omitempty"`
Submitted map[string][][]int `json:"submitted,omitempty"`
Title string `json:"title,omitempty"`
URL string `json:"URL,omitempty"`
Version string `json:"version,omitempty"`
Volume string `json:"volume,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.