Class: Asciidoctor::Foodogsquared::Extensions::PypiInlineMacro

Inherits:
Extensions::InlineMacroProcessor
  • Object
show all
Defined in:
lib/asciidoctor/foodogsquared/extensions/package-indices-macro.rb

Instance Method Summary collapse

Instance Method Details

#process(parent, target, attrs) ⇒ Object



31
32
33
34
35
36
37
38
39
# File 'lib/asciidoctor/foodogsquared/extensions/package-indices-macro.rb', line 31

def process(parent, target, attrs)
  doc = parent.document
  text = attrs['caption'] || target
  url = %(https://pypi.org/project/#{target})

  doc.register :links, url

  create_anchor parent, text, type: :link, target: url
end