Class: Asciidoctor::Foodogsquared::Extensions::IETFRFCInlineMacro

Inherits:
Extensions::InlineMacroProcessor
  • Object
show all
Defined in:
lib/asciidoctor/foodogsquared/extensions/ietf-rfc-inline-macro.rb

Instance Method Summary collapse

Instance Method Details

#process(parent, target, attrs) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/asciidoctor/foodogsquared/extensions/ietf-rfc-inline-macro.rb', line 10

def process(parent, target, attrs)
  doc = parent.document
  url = %(https://datatracker.ietf.org/doc/html/#{target})
  attrs['caption'] ||= "RFC#{target}"
  doc.register :links, url
  create_anchor parent, attrs['caption'], type: :link, target: url
end