:source-highlighter: highlight.js
:icons: font

[source, ruby]
----
class ExternalCalloutTreeProcessor < Extensions::TreeProcessor

  use_dsl

  def process(document)

    document.find_by context: :listing, style: 'source'.each do |src|

      Open3.popen3 cmd do |stdin, stdout, _, wait_thr|
        stdin.write src.source
        stdin.close

        result = []

        while (line = stdout.gets) <1>
          result << line
        end

        result << 'Eur/eka'

        src.lines.replace result
        wait_thr.value

      end

    end

  end

end
----


Can I add something in here?

. test `at`  @5
. this is another test @5 @/Result/gi
. Another callout on the same line @5
. this is a string find @/result/
. Out of range @500
. Can't have zero lines @0
. Find Eureka @/Eur\/eka/

//-

[calloutlist]
. This is a standalone callout block.
. You can use it to add callout references to annotated images.