asciidoctor-bibliography 0.10.1 → 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/citation.rb +7 -1
- data/lib/asciidoctor-bibliography/options.rb +7 -7
- data/lib/asciidoctor-bibliography/version.rb +1 -1
- data/lib/citeproc/ruby/formats/adoc.rb +3 -1
- data/spec/csl/styles/tex_citet_numeric_spec.rb +7 -7
- data/spec/csl/styles/tex_citets_numeric_spec.rb +7 -7
- data/spec/integration_spec.rb +32 -0
- data/spec/macros_spec.rb +5 -5
- data/spec/sanity_spec.rb +39 -6
- metadata +30 -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
|
@@ -124,7 +124,7 @@ module AsciidoctorBibliography
|
|
124
124
|
# NOTE: this handles custom citation text (slight overkill but easy to extend)
|
125
125
|
# NOTE: escaping ] is necessary to safely nest macros (e.g. citing in a footnote)
|
126
126
|
(citation_item.text || "{cite}").
|
127
|
-
sub("{cite}", Regexp.last_match[:citation]
|
127
|
+
sub("{cite}", escape_square_brackets(Regexp.last_match[:citation]))
|
128
128
|
end
|
129
129
|
end
|
130
130
|
end
|
@@ -170,5 +170,11 @@ module AsciidoctorBibliography
|
|
170
170
|
def xref_id(*fragments)
|
171
171
|
fragments.compact.join("-")
|
172
172
|
end
|
173
|
+
|
174
|
+
private
|
175
|
+
|
176
|
+
def escape_square_brackets(string)
|
177
|
+
string.gsub("[", "[").gsub("]", "]")
|
178
|
+
end
|
173
179
|
end
|
174
180
|
end
|
@@ -30,14 +30,14 @@ module AsciidoctorBibliography
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def self.get_header_attributes_hash(reader)
|
33
|
-
#
|
34
|
-
#
|
33
|
+
# NOTE: we peek at the document attributes using a throwaway document/reader pair
|
34
|
+
# so the parsing flow isn't perturbed in any way.
|
35
35
|
tmp_document = ::Asciidoctor::Document.new
|
36
|
-
|
37
|
-
|
38
|
-
::Asciidoctor::
|
39
|
-
|
40
|
-
|
36
|
+
# NOTE: peek_lines processes `include` directives (among other things),
|
37
|
+
# so we're able to get document attributes from included files.
|
38
|
+
tmp_reader = ::Asciidoctor::PreprocessorReader.new(tmp_document, reader.peek_lines)
|
39
|
+
::Asciidoctor::Parser.parse_document_header(tmp_reader, tmp_document)
|
40
|
+
tmp_document.attributes
|
41
41
|
end
|
42
42
|
|
43
43
|
def style
|
@@ -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
|
@@ -7,36 +7,36 @@ describe "citet macro with numeric style" do
|
|
7
7
|
|
8
8
|
it "formats a single citation" do
|
9
9
|
expect(formatted_citation("citet:[Erdos65]", options: options)).
|
10
|
-
to eq "Erdős et al.
|
10
|
+
to eq "Erdős et al. [1]"
|
11
11
|
end
|
12
12
|
|
13
13
|
it "formats a grouped citation" do
|
14
14
|
expect(formatted_citation("citet:[Erdos65]+[Einstein35]", options: options)).
|
15
|
-
to eq "Erdős et al.
|
15
|
+
to eq "Erdős et al. [1], Einstein et al. [2]"
|
16
16
|
end
|
17
17
|
|
18
18
|
it "formats a single citation with a prefix" do
|
19
19
|
expect(formatted_citation("citet:[Erdos65, prefix=see]", options: options)).
|
20
|
-
to eq "Erdős et al.
|
20
|
+
to eq "Erdős et al. [see 1]"
|
21
21
|
end
|
22
22
|
|
23
23
|
it "formats a single citation with a suffix" do
|
24
24
|
expect(formatted_citation("citet:[Erdos65, suffix=new edition]", options: options)).
|
25
|
-
to eq "Erdős et al.
|
25
|
+
to eq "Erdős et al. [1, new edition]"
|
26
26
|
end
|
27
27
|
|
28
28
|
it "formats a single citation with both a prefix and a suffix" do
|
29
29
|
expect(formatted_citation("citet:[Erdos65, prefix=see, suffix=new edition]", options: options)).
|
30
|
-
to eq "Erdős et al.
|
30
|
+
to eq "Erdős et al. [see 1, new edition]"
|
31
31
|
end
|
32
32
|
|
33
33
|
it "formats a single citation with a standard locator" do
|
34
34
|
expect(formatted_citation("citet:[Erdos65, page=41-43]", options: options)).
|
35
|
-
to eq "Erdős et al.
|
35
|
+
to eq "Erdős et al. [1, pp. 41-43]"
|
36
36
|
end
|
37
37
|
|
38
38
|
it "formats a single citation with a custom locator" do
|
39
39
|
expect(formatted_citation("citet:[Erdos65, locator=somewhere]", options: options)).
|
40
|
-
to eq "Erdős et al.
|
40
|
+
to eq "Erdős et al. [1, somewhere]"
|
41
41
|
end
|
42
42
|
end
|
@@ -7,36 +7,36 @@ describe "citet* macro with numeric style" do
|
|
7
7
|
|
8
8
|
it "formats a single citation" do
|
9
9
|
expect(formatted_citation("citet*:[Erdos65]", options: options)).
|
10
|
-
to eq "Erdős, Heyting, and Brouwer
|
10
|
+
to eq "Erdős, Heyting, and Brouwer [1]"
|
11
11
|
end
|
12
12
|
|
13
13
|
it "formats a grouped citation" do
|
14
14
|
expect(formatted_citation("citet*:[Erdos65]+[Einstein35]", options: options)).
|
15
|
-
to eq "Erdős, Heyting, and Brouwer
|
15
|
+
to eq "Erdős, Heyting, and Brouwer [1], Einstein, Podolsky, and Rosen [2]"
|
16
16
|
end
|
17
17
|
|
18
18
|
it "formats a single citation with a prefix" do
|
19
19
|
expect(formatted_citation("citet*:[Erdos65, prefix=see]", options: options)).
|
20
|
-
to eq "Erdős, Heyting, and Brouwer
|
20
|
+
to eq "Erdős, Heyting, and Brouwer [see 1]"
|
21
21
|
end
|
22
22
|
|
23
23
|
it "formats a single citation with a suffix" do
|
24
24
|
expect(formatted_citation("citet*:[Erdos65, suffix=new edition]", options: options)).
|
25
|
-
to eq "Erdős, Heyting, and Brouwer
|
25
|
+
to eq "Erdős, Heyting, and Brouwer [1, new edition]"
|
26
26
|
end
|
27
27
|
|
28
28
|
it "formats a single citation with both a prefix and a suffix" do
|
29
29
|
expect(formatted_citation("citet*:[Erdos65, prefix=see, suffix=new edition]", options: options)).
|
30
|
-
to eq "Erdős, Heyting, and Brouwer
|
30
|
+
to eq "Erdős, Heyting, and Brouwer [see 1, new edition]"
|
31
31
|
end
|
32
32
|
|
33
33
|
it "formats a single citation with a standard locator" do
|
34
34
|
expect(formatted_citation("citet*:[Erdos65, page=41-43]", options: options)).
|
35
|
-
to eq "Erdős, Heyting, and Brouwer
|
35
|
+
to eq "Erdős, Heyting, and Brouwer [1, pp. 41-43]"
|
36
36
|
end
|
37
37
|
|
38
38
|
it "formats a single citation with a custom locator" do
|
39
39
|
expect(formatted_citation("citet*:[Erdos65, locator=somewhere]", options: options)).
|
40
|
-
to eq "Erdős, Heyting, and Brouwer
|
40
|
+
to eq "Erdős, Heyting, and Brouwer [1, somewhere]"
|
41
41
|
end
|
42
42
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
require "asciidoctor-bibliography"
|
4
|
+
|
5
|
+
describe "rendering citations styles containing square brackets" do
|
6
|
+
let(:parsed_document) do
|
7
|
+
Asciidoctor::Document.new(<<~ADOC_INPUT).tap(&:parse)
|
8
|
+
= Sample document
|
9
|
+
:bibliography-database: spec/fixtures/database.bib
|
10
|
+
:bibliography-hyperlinks: true
|
11
|
+
:bibliography-style: ieee
|
12
|
+
...
|
13
|
+
|
14
|
+
This paragraph contains a citation: cite:[Lane12a].
|
15
|
+
It also contains [.my-class]#some# inline styling.
|
16
|
+
ADOC_INPUT
|
17
|
+
end
|
18
|
+
|
19
|
+
it "does not confuse rendered brackets with macro brackets in the paragraph" do
|
20
|
+
# I.e. we're trying to avoid results like
|
21
|
+
# ```
|
22
|
+
# <p>This paragraph contains a citation: <a href="#bibliography-default-Lane12a"><span class="1]</a>.
|
23
|
+
# It also contains [.my-class">some</span> inline styling.</p>
|
24
|
+
# ```
|
25
|
+
expect(parsed_document.render).to eq(<<~HTML_OUTPUT.strip)
|
26
|
+
<div class="paragraph">
|
27
|
+
<p>This paragraph contains a citation: <a href="#bibliography-default-Lane12a">[1]</a>.
|
28
|
+
It also contains <span class="my-class">some</span> inline styling.</p>
|
29
|
+
</div>
|
30
|
+
HTML_OUTPUT
|
31
|
+
end
|
32
|
+
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>
|
@@ -207,4 +207,37 @@ describe "asciidoctor integration" do
|
|
207
207
|
BODY
|
208
208
|
end
|
209
209
|
end
|
210
|
+
|
211
|
+
describe "including metadata files" do
|
212
|
+
it "reads the bibliography configuration from the included file" do
|
213
|
+
setup_file tmpdir, "database.bib", <<~ADOC
|
214
|
+
@book{Lane12a,
|
215
|
+
author = {P. Lane},
|
216
|
+
title = {Book title},
|
217
|
+
publisher = {Publisher},
|
218
|
+
year = {2000}
|
219
|
+
}
|
220
|
+
ADOC
|
221
|
+
|
222
|
+
setup_file tmpdir, "metadata.adoc", <<~ADOC
|
223
|
+
:bibliography-database: #{tmpdir}/database.bib
|
224
|
+
:bibliography-style: ieee
|
225
|
+
ADOC
|
226
|
+
|
227
|
+
input_path, output_path = setup_main_document tmpdir, <<~ADOC
|
228
|
+
include::metadata.adoc[]
|
229
|
+
|
230
|
+
This is a citation: cite:[Lane12a]. Yay!
|
231
|
+
ADOC
|
232
|
+
|
233
|
+
expect { `asciidoctor -r asciidoctor-bibliography #{input_path} --trace` }.to_not raise_exception
|
234
|
+
expect(File.read(output_path)).to include <<~'BODY'
|
235
|
+
<div id="content">
|
236
|
+
<div class="paragraph">
|
237
|
+
<p>This is a citation: <a href="#bibliography-default-Lane12a">[1]</a>. Yay!</p>
|
238
|
+
</div>
|
239
|
+
</div>
|
240
|
+
BODY
|
241
|
+
end
|
242
|
+
end
|
210
243
|
end
|
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
|
@@ -307,6 +307,7 @@ files:
|
|
307
307
|
- spec/fixtures/database.rfc.xml
|
308
308
|
- spec/fixtures/database.unk
|
309
309
|
- spec/index_spec.rb
|
310
|
+
- spec/integration_spec.rb
|
310
311
|
- spec/macros_spec.rb
|
311
312
|
- spec/nocite_spec.rb
|
312
313
|
- spec/options_spec.rb
|
@@ -325,14 +326,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
325
326
|
requirements:
|
326
327
|
- - ">="
|
327
328
|
- !ruby/object:Gem::Version
|
328
|
-
version: 2.
|
329
|
+
version: 2.5.0
|
329
330
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
330
331
|
requirements:
|
331
332
|
- - ">="
|
332
333
|
- !ruby/object:Gem::Version
|
333
334
|
version: '0'
|
334
335
|
requirements: []
|
335
|
-
rubygems_version: 3.
|
336
|
+
rubygems_version: 3.3.7
|
336
337
|
signing_key:
|
337
338
|
specification_version: 4
|
338
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
|