class Jekyll::CitePaperTag

Public Class Methods

new(tag_name, text, tokens) click to toggle source
Calls superclass method
# File lib/jekyll-planningwikiplugins.rb, line 63
def initialize(tag_name, text, tokens)
    super

    if text.split(' ').length > 2
      @text = text.encode('UTF-8').split(' ')[0..-3].join(" ")
      @paper = text.encode('UTF-8').split(' ')[-2]
      @pageno = text.encode('UTF-8').split(' ')[-1]
    else 
      @text = text.encode('UTF-8').split(' ')[0]
      @paper = text.encode('UTF-8').split(' ')[1]
      @pageno = 1
    end
end

Public Instance Methods

render(context) click to toggle source
# File lib/jekyll-planningwikiplugins.rb, line 77
def render(context)
    "<a href=\"/_citedpapers/#{@paper}.pdf#page=#{@pageno}\">#{@text}</a>"
end