Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
J
jekyll-scholar
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
caesr-pub
jekyll-scholar
Commits
80b1fe04
Commit
80b1fe04
authored
Apr 14, 2014
by
Sylvester Keil
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #43 from mdave/master
Enable support for joining strings
parents
733e79b2
4c7dbaa3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
121 additions
and
0 deletions
+121
-0
README.md
README.md
+1
-0
features/string.feature
features/string.feature
+114
-0
lib/jekyll/scholar/defaults.rb
lib/jekyll/scholar/defaults.rb
+1
-0
lib/jekyll/scholar/utilities.rb
lib/jekyll/scholar/utilities.rb
+5
-0
No files found.
README.md
View file @
80b1fe04
...
...
@@ -43,6 +43,7 @@ default configuration is as follows:
bibliography_template: "{{reference}}"
replace_strings: true
join_strings: true
details_dir: bibliography
details_layout: bibtex.html
...
...
features/string.feature
0 → 100644
View file @
80b1fe04
Feature
:
String replacement
As a scholar who likes to blog
I want to publish my BibTeX bibliography on my blog
And make sure that strings are correctly substituted
@tags @string
Scenario
:
String replacement
Given I have a scholar configuration with
:
|
key
|
value
|
|
source
|
./_bibliography
|
And
I have a
"_bibliography"
directory
And I have a file "_bibliography/references.bib"
:
"""
@string{ rubypl = "The Ruby Programming Language" }
@book{ruby,
title = rubypl,
author = {Flanagan, David and Matsumoto, Yukihiro},
year = {2008},
publisher = {O'Reilly Media}
}
"""
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 see
"<i>The Ruby Programming Language</i>"
in
"_site/scholar.html"
@tags
@string
Scenario
:
String replacement disabled
Given I have a scholar configuration with
:
|
key
|
value
|
|
source
|
./_bibliography
|
|
replace_strings
|
false
|
And
I have a
"_bibliography"
directory
And I have a file "_bibliography/references.bib"
:
"""
@string{ rubypl = "The Ruby Programming Language" }
@book{ruby,
title = rubypl,
author = {Flanagan, David and Matsumoto, Yukihiro},
year = {2008},
publisher = {O'Reilly Media}
}
"""
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 see
"<i>rubypl</i>"
in
"_site/scholar.html"
@tags
@string
Scenario
:
Join strings
Given I have a scholar configuration with
:
|
key
|
value
|
|
source
|
./_bibliography
|
And
I have a
"_bibliography"
directory
And I have a file "_bibliography/references.bib"
:
"""
@string{ ruby = "Ruby" }
@book{ruby,
title = "The " # ruby # " Programming Language",
author = {Flanagan, David and Matsumoto, Yukihiro},
year = {2008},
publisher = {O'Reilly Media}
}
"""
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 see
"<i>The Ruby Programming Language</i>"
in
"_site/scholar.html"
@tags
@string
Scenario
:
Join strings disabled
Given I have a scholar configuration with
:
|
key
|
value
|
|
source
|
./_bibliography
|
|
join_strings
|
false
|
And
I have a
"_bibliography"
directory
And I have a file "_bibliography/references.bib"
:
"""
@string{ ruby = "Ruby" }
@book{ruby,
title = "The " # ruby # " Programming Language",
author = {Flanagan, David and Matsumoto, Yukihiro},
year = {2008},
publisher = {O'Reilly Media}
}
"""
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 see
"<i>\"
The \"
# \"Ruby\" # \" Programming Language\"</i>" in "_site/scholar.html"
lib/jekyll/scholar/defaults.rb
View file @
80b1fe04
...
...
@@ -15,6 +15,7 @@ module Jekyll
'bibtex_filters'
=>
[
:latex
],
'replace_strings'
=>
true
,
'join_strings'
=>
true
,
'details_dir'
=>
'bibliography'
,
'details_layout'
=>
'bibtex.html'
,
...
...
lib/jekyll/scholar/utilities.rb
View file @
80b1fe04
...
...
@@ -109,6 +109,7 @@ module Jekyll
bibtex_options
)
@bibliography
.
replace_strings
if
replace_strings?
@bibliography
.
join
if
join_strings?
&&
replace_strings?
end
@bibliography
...
...
@@ -149,6 +150,10 @@ module Jekyll
config
[
'replace_strings'
]
end
def
join_strings?
config
[
'join_strings'
]
end
def
cited_only?
!!
@cited
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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