Class: CiteProc::Ruby::Formats::CiteProcJS

Inherits:
Html show all
Defined in:
lib/citeproc/ruby/formats/html.rb

Instance Attribute Summary

Attributes inherited from Html

#config

Attributes inherited from CiteProc::Ruby::Format

#locale

Instance Method Summary collapse

Methods inherited from Html

#apply_display, #apply_font_style, #apply_font_variant, #apply_font_weight, #apply_text_decoration, #apply_vertical_align, #css_only?, #escape_quotes?, #prefix, #strip, #suffix

Methods inherited from CiteProc::Ruby::Format

#apply, #apply_display, #apply_prefix, #apply_quotes, #apply_suffix, #apply_text_case, #close_inner_quote, #close_quote, #escape_quotes?, #join, #keys, load, #prefix, #punctuation_in_quotes?, #split_closing_quotes, squeezable, #squeezable?, squeezable?, #squeeze_prefix, #squeeze_suffix, stopword?, #strip, #suffix

Constructor Details

#initializeCiteProcJS

Returns a new instance of CiteProcJS.



197
198
199
200
201
202
203
204
# File 'lib/citeproc/ruby/formats/html.rb', line 197

def initialize
  super(
    :bib_container => 'div',
    :bib_container_class => 'csl-bib-body',
    :bib_entry => 'div',
    :bib_entry_class => 'csl-entry'
  )
end

Instance Method Details

#bibliography(bibliography) ⇒ Object



206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/citeproc/ruby/formats/html.rb', line 206

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