asciidoctor-bibliography 0.10.3 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/test-and-release.yml +47 -0
- data/README.adoc +7 -6
- data/Rakefile +1 -1
- data/asciidoctor-bibliography.gemspec +10 -10
- data/lib/asciidoctor-bibliography/asciidoctor/bibliographer_preprocessor.rb +7 -2
- data/lib/asciidoctor-bibliography/version.rb +1 -1
- data/lib/citeproc/ruby/formats/adoc.rb +3 -1
- data/spec/macros_spec.rb +5 -5
- data/spec/sanity_spec.rb +6 -6
- metadata +29 -29
- data/.travis.yml +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2dea03494679072cad900828875fc0cb3dc3eb3f0f4653170ed7ef7981fef4ff
|
4
|
+
data.tar.gz: 36d894f8e6a4920598977929397e05ae7e840403ba23fb0971de8b37163d0d5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 488fc4067b7fbbeb69eb511b2fcfc31fe181872e07706a472a070c3b5e9dbb1b635083feed330d9e61221f01bddf5d50104dbfe3a1068e89f7b629ec311e3886
|
7
|
+
data.tar.gz: 370215eaa5fb4b4d5714bf91c157a8ada4d932698c180f5b1aab0eb6880c9a57c2d459e51ca9a9d1362c36c01205c5fdad73c8083db6d7fa7ba2965399b84c50
|
@@ -0,0 +1,47 @@
|
|
1
|
+
name: test-and-release
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ main ]
|
6
|
+
tags: [ 'v*' ]
|
7
|
+
pull_request:
|
8
|
+
|
9
|
+
concurrency:
|
10
|
+
group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}'
|
11
|
+
cancel-in-progress: true
|
12
|
+
|
13
|
+
jobs:
|
14
|
+
test:
|
15
|
+
name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
|
16
|
+
runs-on: ${{ matrix.os }}
|
17
|
+
continue-on-error: false
|
18
|
+
strategy:
|
19
|
+
fail-fast: false
|
20
|
+
matrix:
|
21
|
+
ruby: [ '2.5', '2.6', '2.7', '3.0', '3.1' ]
|
22
|
+
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
23
|
+
|
24
|
+
steps:
|
25
|
+
- uses: actions/checkout@v3
|
26
|
+
|
27
|
+
- uses: ruby/setup-ruby@v1
|
28
|
+
with:
|
29
|
+
ruby-version: ${{ matrix.ruby }}
|
30
|
+
bundler-cache: true
|
31
|
+
|
32
|
+
- run: bundle exec rspec
|
33
|
+
|
34
|
+
release:
|
35
|
+
name: Release gem
|
36
|
+
needs: test
|
37
|
+
runs-on: ubuntu-latest
|
38
|
+
if: contains(github.ref, 'refs/tags/v')
|
39
|
+
steps:
|
40
|
+
- uses: actions/checkout@v3
|
41
|
+
- uses: ruby/setup-ruby@v1
|
42
|
+
with:
|
43
|
+
ruby-version: 2.7
|
44
|
+
bundler-cache: true
|
45
|
+
- uses: cadwallion/publish-rubygems-action@master
|
46
|
+
env:
|
47
|
+
RUBYGEMS_API_KEY: ${{secrets.RIBOSE_RUBYGEMS_API_KEY}}
|
data/README.adoc
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
= Citations and Bibliography the "asciidoctor-way"
|
2
2
|
|
3
|
-
asciidoctor-bibliography lets you handle citations and bibliography
|
4
|
-
http://asciidoctor.org/[asciidoctor]
|
3
|
+
asciidoctor-bibliography lets you handle citations and bibliography in
|
4
|
+
http://asciidoctor.org/[asciidoctor].
|
5
5
|
|
6
|
-
image:https://
|
7
|
-
image:https://img.shields.io/
|
6
|
+
image:https://github.com/riboseinc/asciidoctor-bibliography/actions/workflows/rspec.yml/badge.svg["Build Status", link="https://github.com/riboseinc/asciidoctor-bibliography/actions/workflows/test-and-release.yml"]
|
7
|
+
image:https://img.shields.io/gem/v/fontist.svg["Gem Version", link="https://rubygems.org/gems/fontist"]
|
8
|
+
image:https://img.shields.io/github/issues-pr-raw/riboseinc/asciidoctor-bibliography.svg["Pull Requests", link="https://github.com/riboseinc/asciidoctor-bibliography/pulls"]
|
8
9
|
image:https://codeclimate.com/github/riboseinc/asciidoctor-bibliography/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/riboseinc/asciidoctor-bibliography"]
|
9
10
|
|
10
11
|
|
@@ -424,11 +425,11 @@ copyright covering the contribution to use the contribution by all means.
|
|
424
425
|
|
425
426
|
Here are a few technical guidelines to follow:
|
426
427
|
|
427
|
-
1. Open an https://github.com/riboseinc/asciidoctor-bibliography/issues[
|
428
|
+
1. Open an https://github.com/riboseinc/asciidoctor-bibliography/issues[issue] to discuss a new feature.
|
428
429
|
2. Write tests to support your new feature.
|
429
430
|
3. Make sure the entire test suite passes locally and on CI.
|
430
431
|
4. Open a Pull Request.
|
431
|
-
5. https://github.com/thoughtbot/guides/tree/
|
432
|
+
5. https://github.com/thoughtbot/guides/tree/main/git#write-a-feature[Squash your commits] after receiving feedback.
|
432
433
|
6. Party!
|
433
434
|
|
434
435
|
== Credits
|
data/Rakefile
CHANGED
@@ -32,19 +32,19 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
|
32
32
|
spec.require_paths = ["lib"]
|
33
33
|
spec.files = `git ls-files`.split("\n")
|
34
34
|
spec.test_files = `git ls-files -- {spec}/*`.split("\n")
|
35
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 2.
|
35
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
|
36
36
|
|
37
37
|
spec.add_dependency "asciidoctor", ">= 1.5.6"
|
38
|
-
spec.add_dependency "bibtex-ruby", "~>
|
38
|
+
spec.add_dependency "bibtex-ruby", "~> 6.0.0"
|
39
39
|
spec.add_dependency "citeproc-ruby", "~> 1.1.7"
|
40
40
|
spec.add_dependency "csl-styles", "~> 1.0.1"
|
41
41
|
spec.add_dependency "latex-decode", "~> 0.2.2"
|
42
|
-
spec.add_dependency "nokogiri", "~> 1.8
|
43
|
-
|
44
|
-
spec.add_development_dependency "byebug"
|
45
|
-
spec.add_development_dependency "rake", "~> 12.3
|
46
|
-
spec.add_development_dependency "rspec", "~> 3.7
|
47
|
-
spec.add_development_dependency "rubocop"
|
48
|
-
spec.add_development_dependency "simplecov"
|
49
|
-
spec.add_development_dependency "yard"
|
42
|
+
spec.add_dependency "nokogiri", "~> 1.8"
|
43
|
+
|
44
|
+
spec.add_development_dependency "byebug"
|
45
|
+
spec.add_development_dependency "rake", "~> 12.3"
|
46
|
+
spec.add_development_dependency "rspec", "~> 3.7"
|
47
|
+
spec.add_development_dependency "rubocop"
|
48
|
+
spec.add_development_dependency "simplecov"
|
49
|
+
spec.add_development_dependency "yard"
|
50
50
|
end
|
@@ -79,10 +79,15 @@ module AsciidoctorBibliography
|
|
79
79
|
end
|
80
80
|
|
81
81
|
def glob_pattern(pattern_string, base_dir)
|
82
|
-
pattern_string.split
|
83
|
-
Dir.chdir(base_dir) { Dir.glob(pattern) }
|
82
|
+
pattern_string.split.map do |pattern|
|
83
|
+
Dir.chdir(base_dir) { Dir.glob(normalize_separator(pattern)) }
|
84
84
|
end.flatten
|
85
85
|
end
|
86
|
+
|
87
|
+
def normalize_separator(path)
|
88
|
+
return path if File::ALT_SEPARATOR.nil?
|
89
|
+
path.gsub(File::ALT_SEPARATOR, File::SEPARATOR)
|
90
|
+
end
|
86
91
|
end
|
87
92
|
end
|
88
93
|
end
|
@@ -40,7 +40,9 @@ module CiteProc
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def aligned_first_accessible?
|
43
|
-
!(node.root.is_a? CSL::Locale) &&
|
43
|
+
!(node.root.is_a? CSL::Locale) &&
|
44
|
+
node.root.respond_to?(:bibliography) &&
|
45
|
+
node.root.bibliography["second-field-align"]
|
44
46
|
end
|
45
47
|
end
|
46
48
|
end
|
data/spec/macros_spec.rb
CHANGED
@@ -4,12 +4,12 @@ require_relative "citation_helper"
|
|
4
4
|
|
5
5
|
describe "cite macro with apa style" do
|
6
6
|
it "formats a complex citation" do
|
7
|
-
expect(formatted_citation("cite:[Erdos65, prefix=see]+[Einstein35, page=41-43]",
|
7
|
+
expect(formatted_citation("cite:[Erdos65, prefix='see ']+[Einstein35, page=41-43]",
|
8
8
|
options: { "bibliography-style" => "apa",
|
9
9
|
"bibliography-database" => "database.bib",
|
10
10
|
"bibliography-hyperlinks" => "true" })).
|
11
|
-
to eq "(<<bibliography-default-Einstein35,Einstein
|
12
|
-
"<<bibliography-default-Erdos65,
|
11
|
+
to eq "(<<bibliography-default-Einstein35,Einstein et al., 1935, pp. 41-43>>; " +
|
12
|
+
"<<bibliography-default-Erdos65,see Erdős et al., 1965>>)"
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
@@ -19,7 +19,7 @@ describe "cite macro with arbitrary interpolated text" do
|
|
19
19
|
options: { "bibliography-style" => "apa",
|
20
20
|
"bibliography-database" => "database.bib",
|
21
21
|
"bibliography-hyperlinks" => "true" })).
|
22
|
-
to eq "(<<bibliography-default-Erdos65,foo Erdős
|
22
|
+
to eq "(<<bibliography-default-Erdos65,foo Erdős et al., 1965 bar>>)"
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -48,6 +48,6 @@ describe "cite macro using more than two keys" do
|
|
48
48
|
options: { "bibliography-style" => "apa",
|
49
49
|
"bibliography-database" => "database.bib",
|
50
50
|
"bibliography-hyperlinks" => "true" })).
|
51
|
-
to eq "(<<bibliography-default-Einstein35,Einstein
|
51
|
+
to eq "(<<bibliography-default-Einstein35,Einstein et al., 1935>>; <<bibliography-default-Erdos65,Erdős et al., 1965>>; <<bibliography-default-Lane12a,Lane, 2000>>; <<bibliography-default-Lane12b,Mane & Smith, 2000>>)"
|
52
52
|
end
|
53
53
|
end
|
data/spec/sanity_spec.rb
CHANGED
@@ -86,7 +86,7 @@ describe "asciidoctor integration" do
|
|
86
86
|
<p>Hello World. (<a href="#bibliography-default-Foo00">Bar, 2000</a>)</p>
|
87
87
|
</div>
|
88
88
|
<div class="paragraph">
|
89
|
-
<p><a id="bibliography-default-Foo00"></a>Bar, F. (2000). Title
|
89
|
+
<p><a id="bibliography-default-Foo00"></a>Bar, F. (2000). <em>Title</em>.</p>
|
90
90
|
</div>
|
91
91
|
</div>
|
92
92
|
BODY
|
@@ -119,7 +119,7 @@ describe "asciidoctor integration" do
|
|
119
119
|
<p>This is content from a nested file. (<a href="#bibliography-default-Foo00">Bar, 2000</a>)</p>
|
120
120
|
</div>
|
121
121
|
<div class="paragraph">
|
122
|
-
<p><a id="bibliography-default-Foo00"></a>Bar, F. (2000). Title
|
122
|
+
<p><a id="bibliography-default-Foo00"></a>Bar, F. (2000). <em>Title</em>.</p>
|
123
123
|
</div>
|
124
124
|
</div>
|
125
125
|
BODY
|
@@ -183,22 +183,22 @@ describe "asciidoctor integration" do
|
|
183
183
|
<div class="sect2">
|
184
184
|
<h3 id="_default">Default</h3>
|
185
185
|
<div class="paragraph">
|
186
|
-
<p><a id="bibliography-default-Foo00"></a>Bar, F. (2000). Title
|
186
|
+
<p><a id="bibliography-default-Foo00"></a>Bar, F. (2000). <em>Title</em>.</p>
|
187
187
|
</div>
|
188
188
|
</div>
|
189
189
|
<div class="sect2">
|
190
190
|
<h3 id="_first">First</h3>
|
191
191
|
<div class="paragraph">
|
192
|
-
<p><a id="bibliography-first-Foo00"></a>Bar, F. (2000). Title
|
192
|
+
<p><a id="bibliography-first-Foo00"></a>Bar, F. (2000). <em>Title</em>.</p>
|
193
193
|
</div>
|
194
194
|
<div class="paragraph">
|
195
|
-
<p><a id="bibliography-first-Qux00"></a>Zot, Q. (3000). Title
|
195
|
+
<p><a id="bibliography-first-Qux00"></a>Zot, Q. (3000). <em>Title</em>.</p>
|
196
196
|
</div>
|
197
197
|
</div>
|
198
198
|
<div class="sect2">
|
199
199
|
<h3 id="_last">Last</h3>
|
200
200
|
<div class="paragraph">
|
201
|
-
<p><a id="bibliography-last-Qux00"></a>Zot, Q. (3000). Title
|
201
|
+
<p><a id="bibliography-last-Qux00"></a>Zot, Q. (3000). <em>Title</em>.</p>
|
202
202
|
</div>
|
203
203
|
</div>
|
204
204
|
</div>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciidoctor-bibliography
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 6.0.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 6.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: citeproc-ruby
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,98 +86,98 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 1.8
|
89
|
+
version: '1.8'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 1.8
|
96
|
+
version: '1.8'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: byebug
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rake
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 12.3
|
117
|
+
version: '12.3'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 12.3
|
124
|
+
version: '12.3'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: rspec
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 3.7
|
131
|
+
version: '3.7'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 3.7
|
138
|
+
version: '3.7'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: rubocop
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- - "
|
143
|
+
- - ">="
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0
|
145
|
+
version: '0'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- - "
|
150
|
+
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0
|
152
|
+
version: '0'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: simplecov
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- - "
|
157
|
+
- - ">="
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 0
|
159
|
+
version: '0'
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- - "
|
164
|
+
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 0
|
166
|
+
version: '0'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: yard
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
|
-
- - "
|
171
|
+
- - ">="
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 0
|
173
|
+
version: '0'
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
|
-
- - "
|
178
|
+
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: 0
|
180
|
+
version: '0'
|
181
181
|
description: |
|
182
182
|
asciidoctor-bibliography lets you handle citations and bibliography the "asciidoctor-way"!
|
183
183
|
|
@@ -198,12 +198,12 @@ extensions: []
|
|
198
198
|
extra_rdoc_files: []
|
199
199
|
files:
|
200
200
|
- ".codeclimate.yml"
|
201
|
+
- ".github/workflows/test-and-release.yml"
|
201
202
|
- ".gitignore"
|
202
203
|
- ".hound.yml"
|
203
204
|
- ".oss-guides.rubocop.yml"
|
204
205
|
- ".rspec"
|
205
206
|
- ".rubocop.yml"
|
206
|
-
- ".travis.yml"
|
207
207
|
- Gemfile
|
208
208
|
- LICENSE.txt
|
209
209
|
- README.adoc
|
@@ -326,14 +326,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
326
326
|
requirements:
|
327
327
|
- - ">="
|
328
328
|
- !ruby/object:Gem::Version
|
329
|
-
version: 2.
|
329
|
+
version: 2.5.0
|
330
330
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
331
331
|
requirements:
|
332
332
|
- - ">="
|
333
333
|
- !ruby/object:Gem::Version
|
334
334
|
version: '0'
|
335
335
|
requirements: []
|
336
|
-
rubygems_version: 3.
|
336
|
+
rubygems_version: 3.3.7
|
337
337
|
signing_key:
|
338
338
|
specification_version: 4
|
339
339
|
summary: Citations and bibliography the "asciidoctor-way"
|
data/.travis.yml
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
sudo: false
|
2
|
-
language: ruby
|
3
|
-
rvm:
|
4
|
-
- 2.3
|
5
|
-
before_script:
|
6
|
-
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
7
|
-
- chmod +x ./cc-test-reporter
|
8
|
-
- ./cc-test-reporter before-build
|
9
|
-
script:
|
10
|
-
- bundle exec rspec
|
11
|
-
after_script:
|
12
|
-
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|