Skip to content

Commit

Permalink
Merge 24a4256 into 9030a57
Browse files Browse the repository at this point in the history
  • Loading branch information
stevecheckoway committed Aug 25, 2019
2 parents 9030a57 + 24a4256 commit b46c55f
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 44 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ sudo: false
cache: bundler
matrix:
include:
- rvm: 2.5
- rvm: 2.6
env: WITH_COVERALLS=true
- rvm: 2.4
- rvm: 2.5
env: WITH_COVERALLS=false
- rvm: 2.3
- rvm: 2.4
env: WITH_COVERALLS=false
install:
- if [[ $WITH_COVERALLS = "true" ]]; then
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ description of all options and their defaults, see
| `locale` | `en` | Defines what language to use when formatting your references (this typically applies to localized terms, e.g., 'Eds.' for editors in English). |
| `source` | `./_bibliography` | Indicates where your bibliographies are stored. |
| `bibliography` | `references.bib` | Indicates the name of your default bibliography. For best results, please ensure that your bibliography is encoded as ASCII or UTF-8. A string that contains a `*` will be passed to `Dir::glob`, so `**/*.bib{,tex}` will find all files named `*.bib` and `*.bibtex` under `source`. |
| `use_raw_bibtex_entry` | `true` | When `true`, disables parsing of Liquid tags embedded in the Bibtex fields. This option provides a way to circumvent the problem that (the conflicting syntax of) the double braces functionality of BibTex is accidentally parsed by Liquid, while it was intended to keep the exact capitalization style. |
| `allow_locale_overrides` | `false` | When `true`, allows the `language` entry in the BibTex to override the `locale` setting for individual entries. When the language is missing it will revert back to `locale`. The language value should be encoded using the two-letter [ISO 639-1](https://www.loc.gov/standards/iso639-2/php/code_list.php) standard. Ex. English = 'en', Spanish = 'es'. |
| `sort_by` | `none` | Specifies if and how bibliography entries are sorted. Entries can be sorted on multiple fields, by using a list of keys, e.g. `year,month`. Ordering can be specified per sort level, e.g. `order: descending,ascending` will sort the years descending, but per year the months are ascending. If there are more sort keys than order directives, the last order entry is used for the remaining keys. |
| `order` | `ascending` | Specifies order bibliography entries are sorted in. Can be `ascending` or descending. Ordering can be specified per sort level, e.g. `descending,ascending` will sort in descending on the first key then ascending order on the second key. If there are more sort keys than order directives, the last order entry is used for the remaining keys. |
Expand Down
24 changes: 0 additions & 24 deletions features/bibtex.feature
Original file line number Diff line number Diff line change
Expand Up @@ -471,30 +471,6 @@ Feature: BibTeX
And the "_site/scholar.html" file should exist
And I should see "<i>The Ruby Programming Language</i>. O’Reilly Media, 2008" in "_site/scholar.html"

@tags @bibliography @config @template
Scenario: Raw bibtex template
Given I have a scholar configuration with:
| key | value |
| bibliography_template | "{{entry.bibtex}}" |
| use_raw_bibtex_entry | true |
And I have a "_bibliography" directory
And I have a file "_bibliography/references.bib":
"""
@book{ruby,
title = {The Ruby Programming Language}
}
"""
And I have a page "scholar.html":
"""
---
---
{% bibliography -f references %}
"""
When I run jekyll
Then the _site directory should exist
And the "_site/scholar.html" file should exist
And I should not see "{%[\w*]raw[\w*]%}" in "_site/scholar.html"

@config @bibliography @style
Scenario: A custom style with Jekyll source directory set
Given I have a configuration file with:
Expand Down
6 changes: 3 additions & 3 deletions features/cite_details.feature
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Feature: Citations
And I should not see "ab" in "_site/bibliography/a.html"

@tags @bibliography @config @template @cite_details
Scenario: Raw bibtex template in details page
Scenario: Raw bibtex template in details page with ignored option
Given I have a scholar configuration with:
| key | value |
| source | ./_bibliography |
Expand All @@ -111,8 +111,8 @@ Feature: Citations
Then the _site directory should exist

And the "_site/bibliography/a.html" file should exist
And I should not see "{{'b' | prepend: 'a'}}" in "_site/bibliography/a.html"
And I should see "ab" in "_site/bibliography/a.html"
And I should see "{{'b' | prepend: 'a'}}" in "_site/bibliography/a.html"
And I should not see "ab" in "_site/bibliography/a.html"

@tags @cite_details
Scenario: A Simple Cite Details Link With A Text Argument
Expand Down
4 changes: 1 addition & 3 deletions features/details.feature
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,12 @@ Feature: Details


@generators
Scenario: Raw input can be turned on, but should not generate any {%raw%} tags on the details page, and also not parse the liquid tags inside the bibtex
Scenario: Liquid tags should not be parsed inside the bibtex
Given I have a scholar configuration with:
| key | value |
| source | ./_bibliography |
| details_layout | details.html |
| bibtex_filters | |
| use_raw_bibtex_entry | true |
And I have a "_bibliography" directory
And I have a file "_bibliography/references.bib":
"""
Expand Down Expand Up @@ -152,7 +151,6 @@ Feature: Details
When I run jekyll
Then the _site directory should exist
And the "_site/bibliography/sdf.html" file should exist
And I should not see "{%raw%}" in "_site/bibliography/sdf.html"
And I should see "SDF\^3" in "_site/bibliography/sdf.html"

@tags @details
Expand Down
2 changes: 1 addition & 1 deletion jekyll-scholar.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = '>= 1.3.6'
s.rubyforge_project = s.name

s.add_runtime_dependency('jekyll', '>= 3.0')
s.add_runtime_dependency('jekyll', '~> 4.0')
s.add_runtime_dependency('citeproc-ruby', '~> 1.0')
s.add_runtime_dependency('csl-styles', '~> 1.0')
s.add_runtime_dependency('bibtex-ruby', '~> 4.0', '>= 4.0.13')
Expand Down
1 change: 0 additions & 1 deletion lib/jekyll/scholar/defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ class Scholar
# Template parameters can also include any key defined in the bibtex file, e.g. ":year", ":title", etc.
# Bibtex keys such as 'title' are slugified in the same way as Jekyll treats blog post titles.
'details_permalink' => '/:details_dir/:key:extension',
'use_raw_bibtex_entry' => true,

'bibliography_class' => 'bibliography',
'bibliography_template' => '{{reference}}',
Expand Down
6 changes: 6 additions & 0 deletions lib/jekyll/scholar/generators/details.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ class DetailsGenerator < Generator
def generate(site)
@site, @config = site, Scholar.defaults.merge(site.config['scholar'] || {})

# Check for removed option and warn if it is set
if @config.include? 'use_raw_bibtex_entry'
Jekyll.logger.warn('Jekyll-scholar:',
'Option `use_raw_bibtex_entry` is no longer supported')
end

if generate_details?
entries.each do |entry|
details = Details.new(site, site.source, File.join('', details_path), entry)
Expand Down
8 changes: 0 additions & 8 deletions lib/jekyll/scholar/utilities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,6 @@ def suppress_author?
!!@suppress_author
end

def raw_bibtex?
config['use_raw_bibtex_entry']
end

def repository?
!config['repository'].nil? && !config['repository'].empty?
end
Expand Down Expand Up @@ -535,10 +531,6 @@ def liquidify(entry)
e['bibtex'] = tmp.to_s({ quotes: config['bibtex_quotes'] })
end

if raw_bibtex?
e['bibtex'] = "{%raw%}#{e['bibtex']}{%endraw%}"
end

entry.fields.each do |key, value|
value = value.convert(*bibtex_filters) unless bibtex_filters.empty?
e[key.to_s] = value.to_s
Expand Down

0 comments on commit b46c55f

Please sign in to comment.