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
b4404bd8
Commit
b4404bd8
authored
Aug 03, 2012
by
Sylvester Keil
Browse files
Merge pull request #6 from hdpatel/master
cite_details
parents
3dd51beb
d0bd2541
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/jekyll/scholar.rb
View file @
b4404bd8
...
...
@@ -11,5 +11,6 @@ require 'jekyll/scholar/utilities'
require
'jekyll/scholar/converters/bibtex'
require
'jekyll/scholar/tags/bibliography'
require
'jekyll/scholar/tags/cite'
require
'jekyll/scholar/tags/cite_details'
require
'jekyll/scholar/tags/quote'
require
'jekyll/scholar/generators/details'
lib/jekyll/scholar/tags/cite_details.rb
0 → 100644
View file @
b4404bd8
module
Jekyll
class
Scholar
class
CiteDetailsTag
<
Liquid
::
Tag
include
Scholar
::
Utilities
attr_reader
:key
,
:text
def
initialize
(
tag_name
,
arguments
,
tokens
)
super
@config
=
Scholar
.
defaults
.
dup
@key
=
arguments
.
strip
.
split
(
/\s+/
,
2
)[
0
]
@text
=
arguments
.
strip
.
split
(
/\s+/
,
2
)[
1
]
end
def
render
(
context
)
set_context_to
context
cite_details
key
,
text
end
end
end
end
Liquid
::
Template
.
register_tag
(
'cite_details'
,
Jekyll
::
Scholar
::
CiteDetailsTag
)
lib/jekyll/scholar/utilities.rb
View file @
b4404bd8
...
...
@@ -79,6 +79,16 @@ module Jekyll
rescue
"(
#{
key
}
)"
end
def
cite_details
(
key
,
text
)
entry
=
bibliography
[
key
]
if
bibliography
.
key?
(
key
)
link_to
details_link_for
(
entry
),
text
else
"(missing reference)"
end
end
def
content_tag
(
name
,
content_or_attributes
,
attributes
=
{})
if
content_or_attributes
.
is_a?
(
Hash
)
...
...
@@ -108,4 +118,4 @@ module Jekyll
end
end
end
\ No newline at end of file
end
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