Class: Jekyll::Scholar::DetailsGenerator

Inherits:
Generator
  • Object
show all
Includes:
Utilities
Defined in:
lib/jekyll/scholar/generators/details.rb

Instance Attribute Summary collapse

Attributes included from Utilities

#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

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



36
37
38
# File 'lib/jekyll/scholar/generators/details.rb', line 36

def config
  @config
end

Instance Method Details

#generate(site) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/jekyll/scholar/generators/details.rb', line 38

def generate(site)
  @site, @config = site, Scholar.defaults.merge(site.config['scholar'] || {})

  # Check for removed option and warn if it is set
  if @config.include? 'use_raw_bibtex_entry'
    Jekyll.logger.warn('Jekyll-scholar:',
                       'Option `use_raw_bibtex_entry` is no longer supported')
  end

  if generate_details?
    entries.each do |entry|
      details = Details.new(site, site.source, File.join('', details_path), entry)
      details.render(site.layouts, site.site_payload)
      details.write(site.dest)

      site.pages << details

      site.regenerator.add_dependency(
        site.in_source_dir(details.path),
        bibtex_path
      )
    end

  end
end