Class: Jekyll::Scholar::QuoteTag

Inherits:
Liquid::Block
  • Object
show all
Includes:
Utilities
Defined in:
lib/jekyll/scholar/tags/quote.rb

Instance Attribute Summary collapse

Attributes included from Utilities

#config, #context, #max, #offset, #prefix, #site, #text

Instance Method Summary collapse

Methods included from Utilities

#allow_locale_overrides?, #base_url, #bibliography, #bibliography_list_tag, #bibliography_stale?, #bibliography_tag, #bibliography_template, #bibtex_file, #bibtex_files, #bibtex_filters, #bibtex_options, #bibtex_path, #bibtex_paths, #citation_item_for, #citation_number, #cite, #cite_details, #cited_entries, #cited_keys, #cited_only?, #cited_references, #clear?, #content_tag, #csl_renderer, #details_link, #details_link_for, #details_path, #details_path_for, #entries, #extend_path, #generate_details?, #generate_details_link?, #group, #group?, #group_by, #group_compare, #group_keys, #group_name, #group_order, #group_order=, #group_tags, #group_value, #grouper, #interpolate, #join_strings?, #keys, #labels, #limit_entries?, #link_target_for, #link_to, #liquid_template, #liquidify, #load_repository, #load_style, #locales, #locators, #match_fields, #missing_reference, #month_names, #nocite, #optparse, #query, #raw_bibtex_filters, #reference_data, #reference_tag, #reference_tagname, #relative, #remove_duplicates?, #render_bibliography, #render_citation, #replace_strings?, #repository, #repository?, #repository_file_delimiter, #repository_link_for, #repository_links_for, #repository_path, #scholar_source, #set_context_to, #skip_sort?, #sort, #sort_keys, #sort_order, #split_arguments, #style, #styles, #suppress_author?, #type_aliases, #type_names, #type_order, #update_dependency_tree

Constructor Details

#initialize(tag_name, arguments, tokens) ⇒ QuoteTag

Returns a new instance of QuoteTag.



9
10
11
12
13
14
15
16
# File 'lib/jekyll/scholar/tags/quote.rb', line 9

def initialize(tag_name, arguments, tokens)
  super

  @config = Scholar.defaults.dup
  @keys, arguments = split_arguments arguments

  optparse(arguments)
end

Instance Attribute Details

#pagesObject (readonly)

Returns the value of attribute pages.



7
8
9
# File 'lib/jekyll/scholar/tags/quote.rb', line 7

def pages
  @pages
end

Instance Method Details

#render(context) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/jekyll/scholar/tags/quote.rb', line 18

def render(context)
  set_context_to context

  quote = super.strip.gsub(/\n\n/, '</p><p>').gsub(/\n/, '<br/>')
  quote =  :p, quote

  citation = cite keys

  quote << (:cite, citation)

   :blockquote, quote
end