Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
caesr-pub
jekyll-scholar
Commits
11b1a3ed
Commit
11b1a3ed
authored
Apr 22, 2012
by
Sylvester Keil
Browse files
added latex filter by default
#1
parent
9ed886d6
Changes
3
Hide whitespace changes
Inline
Side-by-side
features/bibtex.feature
View file @
11b1a3ed
...
...
@@ -39,3 +39,19 @@ Feature: BibTeX
"""
When
I run jekyll
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"
features/sorting.feature
View file @
11b1a3ed
...
...
@@ -3,7 +3,8 @@ Feature: Sorting BibTeX Bibliographies
I want to sort my bibliographies according to configurable parameters
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"
:
"""
---
...
...
@@ -25,7 +26,9 @@ Feature: Sorting BibTeX Bibliographies
Then
"<pattern-1>"
should come before
"<pattern-2>"
in
"_site/references.html"
Scenarios
:
Various Sort Orders
|
sort-by
|
pattern-1
|
pattern-2
|
|
none
|
2008
|
2007
|
|
year
|
2007
|
2008
|
|
sort_order
|
sort-by
|
pattern-1
|
pattern-2
|
|
ascending
|
none
|
2008
|
2007
|
|
descending
|
none
|
2008
|
2007
|
|
ascending
|
year
|
2007
|
2008
|
|
descending
|
year
|
2008
|
2007
|
\ No newline at end of file
lib/jekyll/scholar/converters/bibtex.rb
View file @
11b1a3ed
...
...
@@ -11,6 +11,7 @@ module Jekyll
DEFAULTS
=
Hash
[
*
%w{
citation_style apa
citation_locale en
citation_sort_by none
}
].
freeze
PATTERN
=
(
/bib(tex)?$/i
).
freeze
...
...
@@ -27,7 +28,7 @@ module Jekyll
def
output_ext
(
extension
);
EXTENSION
;
end
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
)
CiteProc
.
process
b
.
to_citeproc
,
:style
=>
@config
[
'citation_style'
],
:locale
=>
@config
[
'citation_locale'
],
:format
=>
'html'
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment