Commit 11b1a3ed authored by Sylvester Keil's avatar Sylvester Keil
Browse files

added latex filter by default

#1
parent 9ed886d6
...@@ -39,3 +39,19 @@ Feature: BibTeX ...@@ -39,3 +39,19 @@ Feature: BibTeX
""" """
When I run jekyll When I run jekyll
Then I should see "<h1[^>]*>References</h1>" in "_site/references.html" Then I should see "<h1[^>]*>References</h1>" in "_site/references.html"
@latex
Scenario: Simple Bibliography with LaTeX directives
Given I have a configuration file with "citation_style" set to "apa"
And I have a page "references.bib":
"""
---
---
@misc{umlaut,
title = {Look, an umlaut: \"u!},
}
"""
When I run jekyll
Then the _site directory should exist
And the "_site/references.html" file should exist
And I should see "Look, an umlaut: ü!" in "_site/references.html"
...@@ -3,7 +3,8 @@ Feature: Sorting BibTeX Bibliographies ...@@ -3,7 +3,8 @@ Feature: Sorting BibTeX Bibliographies
I want to sort my bibliographies according to configurable parameters I want to sort my bibliographies according to configurable parameters
Scenario Outline: Sort Bibliography Scenario Outline: Sort Bibliography
Given I have a configuration file with "citation_sort_order" set to "<sort-by>" Given I have a configuration file with "citation_sort_by" set to "<sort-by>"
And I have a configuration file with "citation_sort_order" set to "<sort-order>"
And I have a page "references.bib": And I have a page "references.bib":
""" """
--- ---
...@@ -25,7 +26,9 @@ Feature: Sorting BibTeX Bibliographies ...@@ -25,7 +26,9 @@ Feature: Sorting BibTeX Bibliographies
Then "<pattern-1>" should come before "<pattern-2>" in "_site/references.html" Then "<pattern-1>" should come before "<pattern-2>" in "_site/references.html"
Scenarios: Various Sort Orders Scenarios: Various Sort Orders
| sort-by | pattern-1 | pattern-2 | | sort_order | sort-by | pattern-1 | pattern-2 |
| none | 2008 | 2007 | | ascending | none | 2008 | 2007 |
| year | 2007 | 2008 | | descending | none | 2008 | 2007 |
| ascending | year | 2007 | 2008 |
| descending | year | 2008 | 2007 |
\ No newline at end of file
...@@ -11,6 +11,7 @@ module Jekyll ...@@ -11,6 +11,7 @@ module Jekyll
DEFAULTS = Hash[*%w{ DEFAULTS = Hash[*%w{
citation_style apa citation_style apa
citation_locale en citation_locale en
citation_sort_by none
}].freeze }].freeze
PATTERN = (/bib(tex)?$/i).freeze PATTERN = (/bib(tex)?$/i).freeze
...@@ -27,7 +28,7 @@ module Jekyll ...@@ -27,7 +28,7 @@ module Jekyll
def output_ext (extension); EXTENSION; end def output_ext (extension); EXTENSION; end
def convert (content) def convert (content)
content = BibTeX.parse(content, :include => [:meta_content]).map do |b| content = BibTeX.parse(content, :include => [:meta_content], :filter => [:latex]).map do |b|
if b.respond_to?(:to_citeproc) if b.respond_to?(:to_citeproc)
CiteProc.process b.to_citeproc, :style => @config['citation_style'], CiteProc.process b.to_citeproc, :style => @config['citation_style'],
:locale => @config['citation_locale'], :format => 'html' :locale => @config['citation_locale'], :format => 'html'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment