Skip to content

Commit 6d8ab0b

Browse files
committed
Wire in the APA additions and fix examples as needed.
1 parent af8c7d4 commit 6d8ab0b

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

lib/cff/formatter/apa_formatter.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ def self.format(model:, preferred_citation: true) # rubocop:disable Metrics/AbcS
3131
_, year = month_and_year_from_model(model)
3232
output << "(#{year})" unless year.empty?
3333

34-
version = "(Version #{model.version})" unless model.version.to_s.empty?
35-
output << "#{model.title} #{version}#{software_label(model)}"
34+
version = " (Version #{model.version})" unless model.version.to_s.empty?
35+
output << "#{model.title}#{version}#{software_label(model)}"
36+
output << publication_data_from_model(model)
3637
output << url(model)
3738

3839
output.reject(&:empty?).join('. ')

test/converted/complete.apa

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
van der Real Person, O. T., IV, & Entity Project Team Conference entity. (2017). Book Title (Version 0.0.1423-BETA). https://doi.org/10.5281/zenodo.1003150
1+
van der Real Person, O. T., IV, & Entity Project Team Conference entity. (2017). Book Title (Version 0.0.1423-BETA). PeerJ, 2(123), 123. https://doi.org/10.5281/zenodo.1003150

test/converted/smith-et-al.apa

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Smith, A. M., Katz, D. S., Niemeyer, K. E., & FORCE11 Software Citation Working Group (2016). Software citation principles. PeerJ Computer Science, 2(123), e86. https://doi.org/10.7717/peerj-cs.86
1+
Smith, A. M., Katz, D. S., Niemeyer, K. E., & FORCE11 Software Citation Working Group. (2016). Software citation principles. PeerJ Computer Science, 2(123), e86. https://doi.org/10.7717/peerj-cs.86

0 commit comments

Comments
 (0)