bergamasco 0.3.8 → 0.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/bergamasco/pandoc.rb +0 -8
- data/lib/bergamasco/version.rb +1 -1
- data/spec/pandoc_spec.rb +0 -10
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 400f38ed59f5b732866c952da0c79b5f1bd5d339
|
4
|
+
data.tar.gz: 42dcc0d7d4fa12d69415ac0bd8c3a6d8735f9bd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbfc6174b39dda4980a4213dc80a86a9014f24657831b37eef4e7026bc9231345b5cce7fdbbd69585a9ffc0232a9ef4745472ec3637029458ebc5dd0b1f1f0d3
|
7
|
+
data.tar.gz: a484fe56539a49d72ec177ae2d34e586941c47c59f51fc8ac7a94cdb3e567eec1aa395a29568b625f2191291e83bd9b03a47db165f04fb9abf8a0162cbba3e35
|
data/Gemfile.lock
CHANGED
data/lib/bergamasco/pandoc.rb
CHANGED
@@ -39,18 +39,10 @@ module Bergamasco
|
|
39
39
|
csl = File.expand_path("../jats.csl", __FILE__)
|
40
40
|
|
41
41
|
options = options.merge(template: template, to: to, csl: csl)
|
42
|
-
options = options.merge(metadata: options[:metadata]) if options[:metadata].present?
|
43
42
|
|
44
43
|
convert(text, options)
|
45
44
|
end
|
46
45
|
|
47
|
-
def self.write_jats(input_path, output_path, options={})
|
48
|
-
file = IO.read(input_path)
|
49
|
-
xml = convert_to_jats(file, options)
|
50
|
-
IO.write(output_path, xml)
|
51
|
-
output_path
|
52
|
-
end
|
53
|
-
|
54
46
|
def self.write_bibliograpy_to_yaml(bib_path, yaml_path)
|
55
47
|
yaml = `pandoc-citeproc --bib2yaml #{bib_path} 2>&1`
|
56
48
|
return nil if $?.exitstatus > 0
|
data/lib/bergamasco/version.rb
CHANGED
data/spec/pandoc_spec.rb
CHANGED
@@ -20,16 +20,6 @@ describe Bergamasco::Pandoc do
|
|
20
20
|
expect(article_id.values.first).to eq("doi")
|
21
21
|
end
|
22
22
|
|
23
|
-
it 'should write jats xml' do
|
24
|
-
input_path = fixture_path + 'cool-dois.html.md'
|
25
|
-
output_path = fixture_path + 'cool-dois.xml'
|
26
|
-
xml_path = subject.write_jats(input_path, output_path, skip_yaml_header: true, csl: 'spec/fixtures/apa.csl', bibliography: 'spec/fixtures/references.yaml')
|
27
|
-
doc = File.open(xml_path) { |f| Nokogiri::XML(f) }
|
28
|
-
article_id = doc.at_xpath("//article-id")
|
29
|
-
expect(article_id.text).to eq("10.5072/0000-03VC")
|
30
|
-
expect(article_id.values.first).to eq("doi")
|
31
|
-
end
|
32
|
-
|
33
23
|
it 'should write bibliography to yaml' do
|
34
24
|
bib_path = fixture_path + 'references.bib'
|
35
25
|
yaml_path = fixture_path + 'references.yaml'
|