class CiteProc::Ruby::Formats::CiteProcJS

Public Class Methods

new() click to toggle source
Calls superclass method CiteProc::Ruby::Formats::Html.new
# File lib/citeproc/ruby/formats/html.rb, line 195
def initialize
  super(
    :bib_container => 'div',
    :bib_container_class => 'csl-bib-body',
    :bib_entry => 'div',
    :bib_entry_class => 'csl-entry'
  )
end

Public Instance Methods

bibliography(bibliography) click to toggle source
# File lib/citeproc/ruby/formats/html.rb, line 204
def bibliography(bibliography)
  ol, li, indent =
    config.values_at(:bib_container, :bib_entry, :bib_indent)

  container_options = {}
  container_options['class'] = config[:bib_container_class]

  entry_options = {}
  entry_options['class'] = config[:bib_entry_class]

  bibliography.header = opening_tag(ol, container_options)
  bibliography.footer = closing_tag(ol)

  bibliography.prefix = [indent, opening_tag(li, entry_options)].join('')
  bibliography.suffix = closing_tag(li)

  bibliography.connector = indent ? "\n" : ''
  bibliography
end