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
9a35ade2
Commit
9a35ade2
authored
Apr 10, 2014
by
David Moxey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for multiple bibliography files to Utilities
parent
82bded55
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
lib/jekyll/scholar/utilities.rb
lib/jekyll/scholar/utilities.rb
+18
-8
No files found.
lib/jekyll/scholar/utilities.rb
View file @
9a35ade2
...
...
@@ -18,7 +18,8 @@ module Jekyll
end
opts
.
on
(
'-f'
,
'--file FILE'
)
do
|
file
|
@bibtex_file
=
file
@bibtex_file
||=
[]
@bibtex_file
<<
file
end
opts
.
on
(
'-q'
,
'--query QUERY'
)
do
|
query
|
...
...
@@ -61,7 +62,9 @@ module Jekyll
def
bibliography
unless
@bibliography
@bibliography
=
BibTeX
.
open
(
bibtex_path
,
bibtex_options
)
tmp
=
""
bibtex_path
.
each
{
|
s
|
tmp
<<
IO
.
read
(
s
)}
@bibliography
=
BibTeX
.
parse
(
tmp
,
bibtex_options
)
@bibliography
.
replace_strings
if
replace_strings?
end
...
...
@@ -109,15 +112,22 @@ module Jekyll
def
extend_path
(
name
)
if
name
.
nil?
||
name
.
empty?
name
=
config
[
'bibliography'
]
name
=
[
config
[
'bibliography'
]
]
end
# return as is if it is an absolute path
return
name
if
name
.
start_with?
(
'/'
)
&&
File
.
exists?
(
name
)
ret
=
[]
p
=
File
.
join
(
config
[
'source'
],
name
)
p
<<
'.bib'
unless
File
.
exists?
(
p
)
p
name
.
each
{
|
file
|
# return as is if it is an absolute path
if
file
.
start_with?
(
'/'
)
&&
File
.
exists?
(
file
)
ret
<<
file
else
p
=
File
.
join
(
config
[
'source'
],
file
)
p
<<
'.bib'
unless
File
.
exists?
(
p
)
ret
<<
p
end
}
ret
end
def
reference_tag
(
entry
)
...
...
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