jekyll-scholar 5.13.0 → 5.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +5 -5
- data/features/filter.feature +26 -0
- data/lib/jekyll/scholar.rb +1 -0
- data/lib/jekyll/scholar/defaults.rb +1 -1
- data/lib/jekyll/scholar/plugins/italics.rb +13 -0
- data/lib/jekyll/scholar/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd0dce701856f7a79d97fa09d8588178990d844d2f7d9ae119625c1cf38edf35
|
4
|
+
data.tar.gz: 0ed8d1968b07c393f098640e16c77a4265672832686fc4fa455acc36eec874d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3b2b3aa1e84ebfdcc4013162c37f61b447461ef823448108d119a71e35f15099c9dc56c6ab35ab61b2b9d06a27ddb406f1e98a23e339a4b3f9aecfc1c9af324
|
7
|
+
data.tar.gz: ef5bff524cd70702b239bd4e260afe8907fd54139b02079af87eed5432ebdc4dfe7fe339cc2d0757380168935e6e30f4dd3bd6345fec0671c71fbd263d4ea2f7
|
data/Gemfile
CHANGED
@@ -4,22 +4,22 @@ gemspec
|
|
4
4
|
group :development do
|
5
5
|
gem 'test-unit'
|
6
6
|
gem 'rake'
|
7
|
-
gem 'redgreen'
|
8
|
-
gem 'shoulda'
|
7
|
+
gem 'redgreen'
|
8
|
+
gem 'shoulda'
|
9
9
|
gem 'cucumber', '1.3.11'
|
10
10
|
gem 'redcarpet'
|
11
11
|
gem 'unicode_utils' if RUBY_VERSION < '2.4'
|
12
12
|
end
|
13
13
|
|
14
14
|
group :extra do
|
15
|
-
gem 'listen'
|
15
|
+
gem 'listen'
|
16
16
|
end
|
17
17
|
|
18
18
|
group :coverage do
|
19
|
-
gem 'simplecov',
|
19
|
+
gem 'simplecov', :require => false
|
20
20
|
gem 'coveralls', :require => false
|
21
21
|
end
|
22
22
|
|
23
23
|
group :debug do
|
24
|
-
gem 'byebug',
|
24
|
+
gem 'byebug', :require => false, :platform => :mri
|
25
25
|
end
|
data/features/filter.feature
CHANGED
@@ -482,3 +482,29 @@ Feature: BibTeX
|
|
482
482
|
Then the _site directory should exist
|
483
483
|
And the "_site/scholar.html" file should exist
|
484
484
|
And I should see "This is <font style=\"font-variant: small-caps\">smallcaps text</font> this should not be smallcaps \{even\} \{with \{additional\} groups\}." in "_site/scholar.html"
|
485
|
+
|
486
|
+
@tags @italics @emph
|
487
|
+
Scenario: LaTeX emph as HTML italics
|
488
|
+
Given I have a scholar configuration with:
|
489
|
+
| key | value |
|
490
|
+
| source | ./_bibliography |
|
491
|
+
And I have the following BibTeX filters:
|
492
|
+
| italics |
|
493
|
+
And I have a "_bibliography" directory
|
494
|
+
And I have a file "_bibliography/references.bib":
|
495
|
+
"""
|
496
|
+
@misc{pickaxe,
|
497
|
+
title = {This is \emph{italics}.}
|
498
|
+
}
|
499
|
+
"""
|
500
|
+
And I have a page "scholar.html":
|
501
|
+
"""
|
502
|
+
---
|
503
|
+
---
|
504
|
+
{% bibliography %}
|
505
|
+
"""
|
506
|
+
When I run jekyll
|
507
|
+
Then the _site directory should exist
|
508
|
+
And the "_site/scholar.html" file should exist
|
509
|
+
And I should see "This is <i>italics</i>." in "_site/scholar.html"
|
510
|
+
|
data/lib/jekyll/scholar.rb
CHANGED
@@ -36,7 +36,7 @@ module Jekyll
|
|
36
36
|
'repository_file_delimiter' => '.',
|
37
37
|
|
38
38
|
'bibtex_options' => { :strip => false, :parse_months => true },
|
39
|
-
'bibtex_filters' => [ :smallcaps, :superscript, :latex ],
|
39
|
+
'bibtex_filters' => [ :smallcaps, :superscript, :italics, :latex ],
|
40
40
|
'bibtex_skip_fields' => [ :abstract, :month_numeric ],
|
41
41
|
'bibtex_quotes' => ['{', '}'],
|
42
42
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Jekyll
|
2
|
+
class Scholar
|
3
|
+
class Italics < BibTeX::Filter
|
4
|
+
def apply(value)
|
5
|
+
# Use of \g<1> pattern back-reference to allow for capturing nested {} groups.
|
6
|
+
# The first (outermost) capture of $1 is used.
|
7
|
+
value.to_s.gsub(/\\emph(\{(?:[^{}]|\g<1>)*\})/) {
|
8
|
+
"<i>#{$1[1..-2]}</i>"
|
9
|
+
}
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-scholar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvester Keil
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -117,6 +117,7 @@ files:
|
|
117
117
|
- lib/jekyll/scholar/converters/bibtex.rb
|
118
118
|
- lib/jekyll/scholar/defaults.rb
|
119
119
|
- lib/jekyll/scholar/generators/details.rb
|
120
|
+
- lib/jekyll/scholar/plugins/italics.rb
|
120
121
|
- lib/jekyll/scholar/plugins/markdown_links.rb
|
121
122
|
- lib/jekyll/scholar/plugins/smallcaps.rb
|
122
123
|
- lib/jekyll/scholar/plugins/superscript.rb
|