jekyll-scholar 5.13.0 → 5.14.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f359f44f4b469aa193816eba500f7681fc030ed23dbf766ae1ad2a8e4803eef2
4
- data.tar.gz: 6a69cfd5619d538f8ddce416f4e1b188972823cc245933af39f96fc2413bebdc
3
+ metadata.gz: dd0dce701856f7a79d97fa09d8588178990d844d2f7d9ae119625c1cf38edf35
4
+ data.tar.gz: 0ed8d1968b07c393f098640e16c77a4265672832686fc4fa455acc36eec874d8
5
5
  SHA512:
6
- metadata.gz: 5edcdf79e17f89ab9fe6058b88b78fa352cb81769bde7be530e57afa2cd7ea0c5e52e317bc87d55a12387dc1261a81947da04046b0f611e198461a458124b5e7
7
- data.tar.gz: 5dfff2a5f869f20f32aab61933088f569fa9c2f67e0acf1a61dcdf254a3f64fb902db49a503d8e2f99cc7fffa42929149a14787854841145d33c3894f0859809
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', '~> 1.2'
8
- gem 'shoulda', '~> 3.5'
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', '~>3.0.0'
15
+ gem 'listen'
16
16
  end
17
17
 
18
18
  group :coverage do
19
- gem 'simplecov', '~>0.14', :require => false
19
+ gem 'simplecov', :require => false
20
20
  gem 'coveralls', :require => false
21
21
  end
22
22
 
23
23
  group :debug do
24
- gem 'byebug', '~>3.5', :require => false, :platform => :mri
24
+ gem 'byebug', :require => false, :platform => :mri
25
25
  end
@@ -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
+
@@ -24,3 +24,4 @@ require 'jekyll/scholar/generators/details'
24
24
  require 'jekyll/scholar/plugins/markdown_links'
25
25
  require 'jekyll/scholar/plugins/superscript'
26
26
  require 'jekyll/scholar/plugins/smallcaps'
27
+ require 'jekyll/scholar/plugins/italics'
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  class Scholar
3
- VERSION = '5.13.0'.freeze
3
+ VERSION = '5.14.0'.freeze
4
4
  end
5
5
  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.13.0
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-03-17 00:00:00.000000000 Z
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