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-extras
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
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
caesr-pub
jekyll-scholar-extras
Commits
69728c56
Commit
69728c56
authored
Feb 07, 2016
by
rmrf
Committed by
Hiren Patel
Feb 07, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prune the files
parent
76db48e2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
128 deletions
+0
-128
lib/jekyll/scholar/extras/extra_utils.rb
lib/jekyll/scholar/extras/extra_utils.rb
+0
-101
lib/jekyll/scholar/tags/cite_details_dep.rb
lib/jekyll/scholar/tags/cite_details_dep.rb
+0
-27
No files found.
lib/jekyll/scholar/extras/extra_utils.rb
deleted
100644 → 0
View file @
76db48e2
module
Jekyll
class
ScholarExtras
module
Utilities
attr_reader
:bibtex_file
,
:config
,
:site
def
bibtex_options
@bibtex_options
||=
{
:filter
=>
:latex
}
end
def
bibtex_path
@bibtex_path
||=
extend_path
(
bibtex_file
)
end
def
bibliography
@bibliography
||=
BibTeX
.
open
(
bibtex_path
,
bibtex_options
)
end
def
get_entries
(
and_list
)
b
=
bibliography
[
'@*'
]
and_list
.
each
{
|
t
|
b
=
bibliography
[
t
]
&
b
}
#puts b.length
unless
config
[
'sort_by'
]
==
'none'
b
.
sort_by!
{
|
e
|
e
[
config
[
'sort_by'
]].
to_s
}
b
.
reverse!
if
config
[
'order'
]
=~
/^(desc|reverse)/i
end
b
end
def
public_journal_entries
bart
=
bibliography
[
'@article'
]
bpub
=
bibliography
[
'@*[public!=no]'
]
b
=
bart
&
bpub
#puts b.class
#puts bart.length
#puts bpub.length
#puts b.length
unless
config
[
'sort_by'
]
==
'none'
b
.
sort_by!
{
|
e
|
e
[
config
[
'sort_by'
]].
to_s
}
b
.
reverse!
if
config
[
'order'
]
=~
/^(desc|reverse)/i
end
b
end
def
public_entries
b
=
bibliography
[
'@*[public!=no]'
]
unless
config
[
'sort_by'
]
==
'none'
b
.
sort_by!
{
|
e
|
e
[
config
[
'sort_by'
]].
to_s
}
b
.
reverse!
if
config
[
'order'
]
=~
/^(desc|reverse)/i
end
b
end
def
details_file_for
(
entry
)
name
=
entry
.
key
.
to_s
.
dup
name
.
gsub!
(
/[:\s]+/
,
'_'
)
[
name
,
'html'
].
join
(
'.'
)
end
def
details_link_for
(
entry
,
base
=
base_url
)
[
base
,
details_path
,
details_file_for
(
entry
)].
join
(
'/'
)
end
def
base_url
@base_url
||=
site
.
config
[
'baseurl'
]
||
site
.
config
[
'base_url'
]
||
nil
end
def
details_path
config
[
'details_dir'
]
end
def
cite_details
(
key
)
entry
=
bibliography
[
key
]
if
bibliography
.
key?
(
key
)
link_to
"More details."
,
details_link_for
(
entry
)
#citation = CiteProc.process entry.to_citeproc, :style => config['style'],
#:locale => config['locale'], :format => 'html', :mode => :citation
#link_to "##{entry.key}", citation.join
#else
#"(missing reference)"
end
end
end
end
end
lib/jekyll/scholar/tags/cite_details_dep.rb
deleted
100644 → 0
View file @
76db48e2
module
Jekyll
class
Scholar
class
CiteTagDetails
<
Liquid
::
Tag
include
Scholar
::
Utilities
include
ScholarExtras
::
Utilities
attr_reader
:key
,
:pages
def
initialize
(
tag_name
,
arguments
,
tokens
)
super
@config
=
Scholar
.
defaults
.
dup
@key
=
arguments
.
strip
.
split
(
/\s+/
)[
0
]
end
def
render
(
context
)
set_context_to
context
cite_details
key
end
end
end
end
Liquid
::
Template
.
register_tag
(
'cite_details_dep'
,
Jekyll
::
Scholar
::
CiteTagDetails
)
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