cite_details.rb 502 Bytes
Newer Older
Hiren Patel's avatar
Hiren Patel committed
1 2 3 4 5
module Jekyll
  class Scholar

    class CiteDetailsTag < Liquid::Tag
      include Scholar::Utilities
6

7
      attr_reader :key, :text
8

Hiren Patel's avatar
Hiren Patel committed
9 10
      def initialize(tag_name, arguments, tokens)
        super
11

Hiren Patel's avatar
Hiren Patel committed
12
        @config = Scholar.defaults.dup
Sylvester Keil's avatar
Sylvester Keil committed
13
        @key, @text = arguments.strip.split(/\s+/, 2)
Hiren Patel's avatar
Hiren Patel committed
14 15 16 17
      end

      def render(context)
        set_context_to context
Sylvester Keil's avatar
Sylvester Keil committed
18
        cite_details key, text
Hiren Patel's avatar
Hiren Patel committed
19
      end
20

Hiren Patel's avatar
Hiren Patel committed
21
    end
22

Hiren Patel's avatar
Hiren Patel committed
23 24 25
  end
end

Hiren Patel's avatar
Hiren Patel committed
26
Liquid::Template.register_tag('cite_details', Jekyll::Scholar::CiteDetailsTag)