Class: Metanorma::Html::IetfRenderer

Inherits:
IsoRenderer show all
Defined in:
lib/metanorma/html/ietf_renderer.rb

Overview

Renders IetfDocument components to HTML. Extends IsoRenderer with IETF/RFC branding.

Constant Summary

Constants inherited from BaseRenderer

BaseRenderer::CLASS_MAP, BaseRenderer::LOGO_DIR, BaseRenderer::METANORMA_LOGO, BaseRenderer::TEMPLATE_CACHE

Instance Attribute Summary

Attributes inherited from BaseRenderer

#footnote_collector, #index_term_collector

Instance Method Summary collapse

Methods inherited from IsoRenderer

doc_types, #extract_display_title, #extract_doctype, #extract_stage, #formatted_doc_id, registers_doc_type, #render, #render_inline_element, #render_term_origin

Methods inherited from StandardRenderer

#render

Methods inherited from BaseRenderer

#assemble_document, #build_footer, #build_header, #build_publisher_logos, #build_reader_controls, #build_scripts, #build_styles, #build_toc_html, #check_presentation_markers, #detect_publishers, #extract_plain_text, #extract_primary_doc_id, #flavor_css_module, #flavor_font_url, #flavor_js_module, #generate_full_document, #header_title_text, #html_title, #initialize, #language, #load_logo_svg, #register_figure_entry, #register_table_entry, #register_toc_entry, #render, #render_liquid, #to_html, #toc_entries, #validate_presentation_xml!

Constructor Details

This class inherits a constructor from Metanorma::Html::BaseRenderer

Instance Method Details

#flavor_publisher_nameObject



14
15
16
# File 'lib/metanorma/html/ietf_renderer.rb', line 14

def flavor_publisher_name
  "IETF"
end

#flavor_publishers(_doc_id) ⇒ Object



10
11
12
# File 'lib/metanorma/html/ietf_renderer.rb', line 10

def flavor_publishers(_doc_id)
  ["IETF"]
end

#publisher_logo_mapObject



18
19
20
# File 'lib/metanorma/html/ietf_renderer.rb', line 18

def publisher_logo_map
  {}
end

#themeObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/metanorma/html/ietf_renderer.rb', line 22

def theme
  @theme ||= Theme.new.tap do |t|
    t.primary        = "#333"
    t.accent         = "#c44536"
    t.accent_deep    = "#a3362b"
    t.gradient       = "linear-gradient(135deg, #1a1a1a 0%, #333 50%, #4d4d4d 100%)"
    t.primary_light  = "#f5f5f5"
    t.accent_light   = "#fdf0ee"
    t.warm           = "#c9982e"
    t.warm_light     = "#fdf8ec"
    t.font_body      = '"Roboto Slab", "Georgia", serif'
    t.font_sans      = '"Inter", "Helvetica Neue", Arial, sans-serif'
    t.font_mono      = '"JetBrains Mono", "Fira Code", monospace'
    t.font_url       = "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Roboto+Slab:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap"
    t.header_background = "linear-gradient(135deg, #1a1a1a 0%, #333 50%, #4d4d4d 100%)"
    t.cover_background  = "linear-gradient(175deg, #0d0d0d 0%, #1a1a1a 30%, #333 65%, #4d4d4d 100%)"
    t.cover_before_bg   = "background: radial-gradient(ellipse at 30% 20%, rgba(196,69,54,0.15) 0%, transparent 50%), radial-gradient(ellipse at 70% 80%, rgba(77,77,77,0.2) 0%, transparent 40%)"
    t.cover_after_bg    = "height: 2px; background: linear-gradient(90deg, transparent, #c44536, transparent)"
    t.progress_bar_color = "#c44536"
    t.note_border     = "#c44536"
    t.note_bg         = "#fdf0ee"
    t.note_color      = "#c44536"
    t.example_border  = "#333"
    t.example_bg      = "#f5f5f5"
    t.example_color   = "#333"
    t.admonition_border = "#c9982e"
    t.admonition_color  = "#c9982e"
    t.footer_border_color = "#c44536"
    t.cover_separator_color = "rgba(196,69,54,0.25)"
    t.extra_css = <<~CSS
      .sourcecode pre { background: #1a1a1a; border-color: #333; color: #e0e0e0; }
    CSS
  end
end