class AsciidoctorBibtex::Asciidoctor::BibliographyBlockMacro
The `bibliography::[] block macro` processor.
This macro processor does only half the work. It just parse the macro and set bibtex file and style if found in the macro. The macro is then expanded to a special paragraph, which is then replaced with generated references by the treeprocessor.
Public Instance Methods
process(parent, target, attrs)
click to toggle source
# File lib/asciidoctor-bibtex/extensions.rb, line 33 def process(parent, target, attrs) # NOTE: bibtex-file and bibtex-style set by this macro shall be # overridable by document attributes and commandline arguments. So we # respect the convention here. if target && (!parent.document.attr? 'bibtex-file') parent.document.set_attribute 'bibtex-file', target end if attrs.key?(:style) && (!parent.document.attr? 'bibtex-style') parent.document.set_attribute 'bibtex-style', attrs[:style] end if attrs.key?(:locale) && (!parent.document.attr? 'bibtex-locale') parent.document.set_attribute 'bibtex-locale', attrs[:locale] end create_paragraph parent, BibliographyBlockMacroPlaceholder, {} end