Class: Faa::Asciidoctor::CwpMacro

Inherits:
Extensions::InlineMacroProcessor
  • Object
show all
Defined in:
lib/faa/asciidoctor/extension.rb

Instance Method Summary collapse

Instance Method Details

#process(parent, target, attrs) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/faa/asciidoctor/extension.rb', line 13

def process(parent, target, attrs)
  doc = parent.document
  jcn = target
  url = %(https://corporateworkplan.faa.gov:7011/CWPPortal/faces/projects?pageId=null&searchString=null&jcn=#{jcn})
  text = attrs["text"] || "CWP: #{jcn}"
  doc.register :links, target
  (create_anchor parent, text, type: :link, target: url, attributes: {"title" => jcn}).render
end