diff --git a/.travis.yml b/.travis.yml index 9bc5748..fd91471 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/README.md b/README.md index 4b10944..3e48a73 100644 --- a/README.md +++ b/README.md @@ -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. | diff --git a/features/bibtex.feature b/features/bibtex.feature index 4803780..08e667a 100644 --- a/features/bibtex.feature +++ b/features/bibtex.feature @@ -471,30 +471,6 @@ Feature: BibTeX And the "_site/scholar.html" file should exist And I should see "The Ruby Programming Language. 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: diff --git a/features/cite_details.feature b/features/cite_details.feature index 2524e9f..038c4eb 100644 --- a/features/cite_details.feature +++ b/features/cite_details.feature @@ -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 | @@ -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 diff --git a/features/details.feature b/features/details.feature index 51a23f2..75ab576 100644 --- a/features/details.feature +++ b/features/details.feature @@ -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": """ @@ -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 diff --git a/jekyll-scholar.gemspec b/jekyll-scholar.gemspec index 5e334a0..a047f66 100644 --- a/jekyll-scholar.gemspec +++ b/jekyll-scholar.gemspec @@ -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') diff --git a/lib/jekyll/scholar/defaults.rb b/lib/jekyll/scholar/defaults.rb index 5f99878..62c70ec 100644 --- a/lib/jekyll/scholar/defaults.rb +++ b/lib/jekyll/scholar/defaults.rb @@ -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}}', diff --git a/lib/jekyll/scholar/generators/details.rb b/lib/jekyll/scholar/generators/details.rb index 5792108..dc1c4c5 100644 --- a/lib/jekyll/scholar/generators/details.rb +++ b/lib/jekyll/scholar/generators/details.rb @@ -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) diff --git a/lib/jekyll/scholar/utilities.rb b/lib/jekyll/scholar/utilities.rb index 8d1fd9a..65bf11b 100644 --- a/lib/jekyll/scholar/utilities.rb +++ b/lib/jekyll/scholar/utilities.rb @@ -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 @@ -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