/ recognize id and options for the doctitle (aka header); should be part of Asciidoctor core - (attr 'header-opts').split(',').each {|opt| header.set_option opt unless header.option? opt } if attr? 'header-opts' - header.id = attr 'header-id' - _bg_img = _style = nil - if (_preamble = pluck_first context: :preamble) - unless (_result = _preamble.find_by context: :image, role: 'canvas').empty? - (_bg_img = _result[0]).set_attr 'skip-option', '' - _style = %[background-image: url(#{image_uri _bg_img.attr(:target)}); background-size: #{(_bg_img.roles & %w[cover contain])[0] || 'cover'}; background-repeat: no-repeat] section.title id=header.id class=[role, ('image' if _bg_img)] style=_style data-title='' data-bespoke-backdrop=(attr 'header-backdrop-role') - content_for :content - if (_title_obj = doctitle partition: true, use_fallback: true).subtitle? header h1=slice_text _title_obj.title, (_slice = header.option? :slice) h2=slice_text _title_obj.subtitle, _slice - else h1=slice_text _title_obj.title, (header.option? :slice) =_preamble ? _preamble.content : nil / TODO move footer to include file - if attr? :author footer / TODO handle multiple authors p.author span.personname span.firstname=>attr :firstname - if (attr? :middlename) span.middlename=>attr :middlename span.surname=attr :lastname - if (attr? :position) || (attr? :organization) =newline span.affiliation - if attr? :position span.position=>attr :position - if attr? :organization span.organization=attr :organization - if attr? :avatar =newline img.avatar src=(image_uri attr :avatar) alt=(attr :author) - if (attr? :twitter) || (attr? :email) =newline span.contact - if attr? :twitter span.twitter=>attr :twitter - if (attr? :email) - if (((_val = attr :email).start_with? 'http://') || (_val.start_with? 'https://')) span.url=_val[((_val.index '//') + 2)..-1] - else span.email=_val /- if attr? :hashtag / p.meta: span.hashtag=attr :hashtag - if (header.option? :enclose) || (document.attr? 'enclose-option') - _notes = _preamble ? (pluck_first context: :sidebar, role: 'cue') : nil .content - yield_content :content =_notes ? _notes.convert : nil - else - yield_content :content