Skip to content

Commit

Permalink
improve writing citationlist in crossrefxml
Browse files Browse the repository at this point in the history
  • Loading branch information
mfenner committed May 17, 2024
1 parent 1a000be commit e7c9b56
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var versionCmd = &cobra.Command{
Short: "Print the version number of commonmeta",
Long: `All software has versions. This is commonmeta's`,
Run: func(cmd *cobra.Command, args []string) {
cmd.Println("Commonmeta v0.3.18 -- HEAD")
cmd.Println("Commonmeta v0.3.19 -- HEAD")
},
}

Expand Down
14 changes: 5 additions & 9 deletions crossrefxml/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,17 +303,13 @@ func Convert(data commonmeta.Data) (Body, error) {
citationList := CitationList{}
if len(data.References) > 0 {
for _, v := range data.References {
var doi DOI
d, _ := doiutils.ValidateDOI(v.ID)
if d != "" {
doi = DOI{
Text: d,
}
}
if d != "" || v.Unstructured == "" {
if d != "" || v.Unstructured != "" {
citationList.Citation = append(citationList.Citation, Citation{
Key: v.Key,
DOI: &doi,
Key: v.Key,
DOI: &DOI{
Text: d,
},
ArticleTitle: v.Title,
CYear: v.PublicationYear,
UnstructedCitation: v.Unstructured,
Expand Down

0 comments on commit e7c9b56

Please sign in to comment.