Class: Metanorma::Plugin::Glossarist::BibliographyRenderer
- Inherits:
-
Object
- Object
- Metanorma::Plugin::Glossarist::BibliographyRenderer
- Includes:
- CitationHelper
- Defined in:
- lib/metanorma/plugin/glossarist/bibliography_renderer.rb
Instance Method Summary collapse
-
#initialize ⇒ BibliographyRenderer
constructor
A new instance of BibliographyRenderer.
- #render_all(concepts, lang: "eng") ⇒ Object
- #render_entry(concept, lang: "eng") ⇒ Object
Methods included from CitationHelper
Constructor Details
#initialize ⇒ BibliographyRenderer
Returns a new instance of BibliographyRenderer.
9 10 11 |
# File 'lib/metanorma/plugin/glossarist/bibliography_renderer.rb', line 9 def initialize @rendered = {} end |
Instance Method Details
#render_all(concepts, lang: "eng") ⇒ Object
22 23 24 25 |
# File 'lib/metanorma/plugin/glossarist/bibliography_renderer.rb', line 22 def render_all(concepts, lang: "eng") entries = concepts.filter_map { |c| render_entry(c, lang: lang) } entries.sort.join("\n") end |
#render_entry(concept, lang: "eng") ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/metanorma/plugin/glossarist/bibliography_renderer.rb', line 13 def render_entry(concept, lang: "eng") l10n = concept.localization(lang) return nil unless l10n entries = source_entries(l10n) warn_unresolved_xrefs(l10n) entries.empty? ? nil : entries.sort.join("\n") end |