Class: Avm::EacAsciidoctorBase0::Instances::Build::Document::HeaderLines
- Inherits:
-
Object
- Object
- Avm::EacAsciidoctorBase0::Instances::Build::Document::HeaderLines
- Defined in:
- lib/avm/eac_asciidoctor_base0/instances/build/document/header_lines.rb
Constant Summary collapse
- ATTRIBUTES =
['Author Initials', 'toc', 'icons', 'numbered', 'source-highlighter', 'website'].freeze
- TOC =
'left'- ICONS =
''- NUMBERED =
''- SOURCE_HIGHLIGHTER =
'rouge'
Instance Method Summary collapse
- #attribute_line(name, value) ⇒ String
- #attribute_value(attr) ⇒ Object
- #attributes_lines ⇒ Object
- #author_initials ⇒ Object
- #author_line ⇒ Object
- #breadcrumbs_lines ⇒ String
- #relative_path_to_stylesheet ⇒ Pathname
- #result ⇒ Array<String>
- #stylesheet_line ⇒ String
- #title_line ⇒ String
- #website ⇒ Object
Instance Method Details
#attribute_line(name, value) ⇒ String
28 29 30 |
# File 'lib/avm/eac_asciidoctor_base0/instances/build/document/header_lines.rb', line 28 def attribute_line(name, value) [":#{name}:", value].compact_blank.join(' ') end |
#attribute_value(attr) ⇒ Object
36 37 38 |
# File 'lib/avm/eac_asciidoctor_base0/instances/build/document/header_lines.rb', line 36 def attribute_value(attr) setting_value(attr.variableize) end |
#attributes_lines ⇒ Object
32 33 34 |
# File 'lib/avm/eac_asciidoctor_base0/instances/build/document/header_lines.rb', line 32 def attributes_lines ATTRIBUTES.map { |attr| attribute_line(attr, attribute_value(attr)) } end |
#author_initials ⇒ Object
40 41 42 |
# File 'lib/avm/eac_asciidoctor_base0/instances/build/document/header_lines.rb', line 40 def instance. end |
#author_line ⇒ Object
44 45 46 |
# File 'lib/avm/eac_asciidoctor_base0/instances/build/document/header_lines.rb', line 44 def "#{author_name} <#{author_email}>" end |
#breadcrumbs_lines ⇒ String
49 50 51 |
# File 'lib/avm/eac_asciidoctor_base0/instances/build/document/header_lines.rb', line 49 def ['[.normal]', document.macro_lines(:breadcrumbs)] end |
#relative_path_to_stylesheet ⇒ Pathname
60 61 62 63 |
# File 'lib/avm/eac_asciidoctor_base0/instances/build/document/header_lines.rb', line 60 def relative_path_to_stylesheet build.theme.target_stylesheet_path .relative_path_from(document.body_target_path.dirname) end |
#result ⇒ Array<String>
54 55 56 57 |
# File 'lib/avm/eac_asciidoctor_base0/instances/build/document/header_lines.rb', line 54 def result [stylesheet_line, title_line, ] + attributes_lines + [''] + end |
#stylesheet_line ⇒ String
66 67 68 |
# File 'lib/avm/eac_asciidoctor_base0/instances/build/document/header_lines.rb', line 66 def stylesheet_line attribute_line('stylesheet', stylesheet_path) end |
#title_line ⇒ String
71 72 73 |
# File 'lib/avm/eac_asciidoctor_base0/instances/build/document/header_lines.rb', line 71 def title_line "= #{source_document.title}" end |
#website ⇒ Object
75 76 77 |
# File 'lib/avm/eac_asciidoctor_base0/instances/build/document/header_lines.rb', line 75 def website instance.web_url end |