From 7e0e9e8fb6573485d4ee6ce3612d0b95f05c0a75 Mon Sep 17 00:00:00 2001 From: Joost van Pinxten Date: Thu, 7 Jan 2016 13:46:45 +0100 Subject: [PATCH] Added global configuration option to enable raw output of bibtex entry. Removed tag option for raw bibtex entry. Added a note in the documentation on the usage of this option. --- README.md | 6 ++++++ lib/jekyll/scholar/defaults.rb | 1 + lib/jekyll/scholar/utilities.rb | 8 ++------ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ba4b8b4..78bb5cb 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,8 @@ default configuration is as follows: replace_strings: true join_strings: true + + use_raw_bibtex_entry: false details_dir: bibliography details_layout: bibtex.html @@ -76,6 +78,10 @@ The `source` option indicates where your bibliographies are stored; `bibliography` is the name of your default bibliography. For best results, please ensure that your Bibliography is encoded as ASCII or UTF-8. +The `use_raw_bibtex_entry` option will disable parsing of Liquid tags that +are embedded in the Bibtex fields. This option provides a way to circumvent +the problem that the double braces functionality of BibTex is accidentally +parsed by Liquid, while it was intended to keep the exact capitalization style. ### Bibliographies diff --git a/lib/jekyll/scholar/defaults.rb b/lib/jekyll/scholar/defaults.rb index cdb89b1..eca08ea 100644 --- a/lib/jekyll/scholar/defaults.rb +++ b/lib/jekyll/scholar/defaults.rb @@ -23,6 +23,7 @@ module Jekyll 'details_dir' => 'bibliography', 'details_layout' => 'bibtex.html', 'details_link' => 'Details', + 'use_raw_bibtex_entry' => false, 'bibliography_class' => 'bibliography', 'bibliography_template' => '{{reference}}', diff --git a/lib/jekyll/scholar/utilities.rb b/lib/jekyll/scholar/utilities.rb index f168dc6..ef29ca9 100644 --- a/lib/jekyll/scholar/utilities.rb +++ b/lib/jekyll/scholar/utilities.rb @@ -80,13 +80,9 @@ module Jekyll opts.on('-T', '--template TEMPLATE') do |template| @bibliography_template = template end - - opts.on('-R', '--raw_bibtex') do |raw_bibtex| - @raw_bibtex = raw_bibtex - end end - argv = arguments.split(/(\B-[cCfqptTslomAR]|\B--(?:cited(_in_order)?|file|query|prefix|text|style|template|locator|offset|max|suppress_author|raw_bibtex|))/) + argv = arguments.split(/(\B-[cCfqptTslomA]|\B--(?:cited(_in_order)?|file|query|prefix|text|style|template|locator|offset|max|suppress_author|))/) parser.parse argv.map(&:strip).reject(&:empty?) end @@ -182,7 +178,7 @@ module Jekyll end def raw_bibtex? - !!@raw_bibtex + config['use_raw_bibtex_entry'] end def repository? -- GitLab