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
30bedf1e
Commit
30bedf1e
authored
Apr 06, 2013
by
Sylvester Keil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
expose index to bibliography template #19
parent
50c4ded7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
10 deletions
+11
-10
features/bibtex.feature
features/bibtex.feature
+4
-4
lib/jekyll/scholar/tags/bibliography.rb
lib/jekyll/scholar/tags/bibliography.rb
+4
-4
lib/jekyll/scholar/utilities.rb
lib/jekyll/scholar/utilities.rb
+3
-2
No files found.
features/bibtex.feature
View file @
30bedf1e
...
...
@@ -93,9 +93,9 @@ Feature: BibTeX
@tags
@bibliography
@config
Scenario
:
Simple Bibliography With Custom Template
Given I have a scholar configuration with
:
|
key
|
value
|
|
source
|
./_bibliography
|
|
bibliography_template
|
<abbr>[%{key}]</abbr>%{reference}
|
|
key
|
value
|
|
source
|
./_bibliography
|
|
bibliography_template
|
<abbr>
%{index}
[%{key}]</abbr>%{reference}
|
And
I have a
"_bibliography"
directory
And I have a file "_bibliography/references.bib"
:
"""
...
...
@@ -116,7 +116,7 @@ Feature: BibTeX
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"
And
I should see
"<abbr>\[ruby\]</abbr><span"
in
"_site/scholar.html"
And
I should see
"<abbr>
1
\[ruby\]</abbr><span"
in
"_site/scholar.html"
@tags
@filter
Scenario
:
Filtered Bibliography Loaded From Default Directory
...
...
lib/jekyll/scholar/tags/bibliography.rb
View file @
30bedf1e
...
...
@@ -23,8 +23,8 @@ module Jekyll
end
end
references
.
map!
do
|
entry
|
reference
=
bibliography_tag
entry
bibliography
=
references
.
map
.
with_index
{
|
entry
,
index
|
reference
=
bibliography_tag
(
entry
,
index
+
1
)
if
generate_details?
reference
<<
link_to
(
details_link_for
(
entry
),
...
...
@@ -32,9 +32,9 @@ module Jekyll
end
content_tag
:li
,
reference
end
}.
join
(
"
\n
"
)
content_tag
:ol
,
references
.
join
(
"
\n
"
)
,
:class
=>
config
[
'bibliography_class'
]
content_tag
:ol
,
bibliography
,
:class
=>
config
[
'bibliography_class'
]
end
end
...
...
lib/jekyll/scholar/utilities.rb
View file @
30bedf1e
...
...
@@ -102,12 +102,13 @@ module Jekyll
config
[
'bibliography_template'
]
||
'%{reference}'
end
def
bibliography_tag
(
entry
)
def
bibliography_tag
(
entry
,
index
)
return
missing_reference
unless
entry
bibliography_template
%
{
:reference
=>
reference_tag
(
entry
),
:key
=>
entry
.
key
:key
=>
entry
.
key
,
:index
=>
index
}
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