Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var MARCCodes = map[string]string{}/* 273 elements not displayed */
MARC Code List for Relators
https://www.loc.gov/marc/relators/relacode.html
var SchemeToOnix = map[string]string{
"ISBN-10": "02",
"GTIN-13": "03",
"UPC": "04",
"ISMN-10": "05",
"DOI": "06",
"LCCN": "13",
"GTIN-14": "14",
"ISBN-13": "15",
"Legal deposit number": "17",
"URN": "22",
"OCLC": "23",
"ISMN-13": "25",
"ISBN-A": "26",
"JP": "27",
"OLCC": "28",
}
Scheme to Onix CodeList 5 mapper. https://onix-codelists.io/codelist/5
Functions ¶
This section is empty.
Types ¶
type Author ¶
type Author struct { Role string `yaml:"role,omitempty"` Text string `yaml:"text"` FileAs string `yaml:"file-as,omitempty"` }
Author of publication.
func (*Author) UnmarshalYAML ¶
UnmarshalYAML implement yaml.Unmarshaler interface.
type Authors ¶
type Authors []Author
Authors is a list of Author.
func (Authors) MarshalYAML ¶
MarshalYAML implement yaml.Marshaler interface.
func (*Authors) UnmarshalYAML ¶
UnmarshalYAML implement yaml.Unmarshaler interface.
type Date ¶
type Date string
Date subscribe the publication date.
A string value in YYYY-MM-DD format. (Only the year is necessary.)
func (Date) MarshalYAML ¶
MarshalYAML implement yaml.Marshaler interface.
func (*Date) UnmarshalYAML ¶
UnmarshalYAML implement yaml.Unmarshaler interface.
type Identifier ¶
Identifier of publication.
Valid values for scheme are ISBN-10, GTIN-13, UPC, ISMN-10, DOI, LCCN, GTIN-14, ISBN-13, Legal deposit number, URN, OCLC, ISMN-13, ISBN-A, JP, OLCC.
func (Identifier) MarshalYAML ¶
func (id Identifier) MarshalYAML() (interface{}, error)
MarshalYAML implement yaml.Marshaler interface.
func (Identifier) Onix ¶
func (id Identifier) Onix() string
Onix return string with Onix CodeList 5: Product identifier type
func (*Identifier) UnmarshalYAML ¶
func (id *Identifier) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML implement yaml.Unmarshaler interface.
type Identifiers ¶
type Identifiers []Identifier
Identifiers describe array of Identifier
func (Identifiers) MarshalYAML ¶
func (ids Identifiers) MarshalYAML() (interface{}, error)
MarshalYAML implement yaml.Marshaler interface.
func (*Identifiers) UnmarshalYAML ¶
func (ids *Identifiers) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML implement yaml.Unmarshaler interface.
type Publication ¶
type Publication struct { Identifier Identifiers `yaml:"identifier"` Title Titles `yaml:"title"` Language string `yaml:"lang,omitempty"` // or legacy: language Date Date `yaml:"date,omitempty"` Creator Authors `yaml:"creator"` Contributor Authors `yaml:"contributor,omitempty"` Subject Strings `yaml:"subject,omitempty,flow"` Description string `yaml:"description,omitempty"` Type string `yaml:"type,omitempty"` Format string `yaml:"format,omitempty"` Publisher string `yaml:"publisher,omitempty"` Source string `yaml:"source,omitempty"` Relation string `yaml:"relation,omitempty"` Coverage string `yaml:"coverage,omitempty"` Rights string `yaml:"rights,omitempty"` BelongsToCollection string `yaml:"belongs-to-collection,omitempty"` // identifies the name of a collection to which the EPUB Publication belongs. GroupPosition string `yaml:"group-position,omitempty"` // indicates the numeric position in which the EPUB Publication belongs relative to other works belonging to the same belongs-to-collection field. CoverImage string `yaml:"cover-image,omitempty"` Stylesheets []string `yaml:"css,omitempty"` // or legacy: stylesheet // PageDirection IBooks *struct { Version Version `yaml:"version,omitempty"` SpecifiedFonts bool `yaml:"specified-fonts,omitempty"` } `yaml:"ibooks,omitempty"` Properties map[string]interface{} `yaml:",omitempty,inline"` }
Publication metadata.
func Load ¶
func Load(filename string) (*Publication, error)
Load return parsed publication metadata from file.
func Parse ¶
func Parse(data []byte) (*Publication, error)
Parse return parsed publication metadata.
func (Publication) EPUB ¶
func (p Publication) EPUB() (meta epub.Metadata)
EPUB return converted to EPUB3 Metadata data.
type Strings ¶
type Strings []string
Strings list of string.
func (Strings) MarshalYAML ¶
MarshalYAML implement yaml.Marshaler interface.
func (*Strings) UnmarshalYAML ¶
UnmarshalYAML implement yaml.Unmarshaler interface.
type Title ¶
type Title struct { Type string `yaml:",omitempty"` Text string `yaml:"text"` FileAs string `yaml:"file-as,omitempty"` }
Title of publication.
Valid values for type are main, subtitle, short, collection, edition, extended.
func (*Title) UnmarshalYAML ¶
UnmarshalYAML implement yaml.Unmarshaler interface.
type Titles ¶
type Titles []Title
Titles is a lis of Title.
func (Titles) MarshalYAML ¶
MarshalYAML implement yaml.Marshaler interface.
func (*Titles) UnmarshalYAML ¶
UnmarshalYAML implement yaml.Unmarshaler interface.
type Version ¶
type Version string
Version subscribe the publication version string.
func (Version) MarshalYAML ¶
MarshalYAML implement yaml.Marshaler interface.
func (*Version) UnmarshalYAML ¶
UnmarshalYAML implement yaml.Unmarshaler interface.