def process(document)
      return unless document.attr? 'source-highlighter', 'rouge'

      document.find_by(context: :listing, style: 'source') do |block|
        process_listing(block)
      end

      # Table cells may contain listing, but Document#find_by does not search
      # inside table, so we must handle it specially.
      document.find_by(context: :table) do |table|
        table.rows.body.each do |row|
          row.each do |cell|
            if (inner = cell.inner_document)
              inner.find_by(context: :listing, style: 'source') do |block|
                process_listing(block)
              end
            end
          end
        end
      end
    end
def process(document)
      return unless document.attr? 'source-highlighter', 'rouge'

      document.find_by(context: :listing, style: 'source') do |block|
        process_listing(block)
      end

      # Table cells may contain listing, but Document#find_by does not search
      # inside table, so we must handle it specially.
      document.find_by(context: :table) do |table|
        table.rows.body.each do |row|
          row.each do |cell|
            if (inner = cell.inner_document)
              inner.find_by(context: :listing, style: 'source') do |block|
                process_listing(block)
              end
            end
          end
        end
      end
    end
@param formatter [Class<Rouge::Formatter>] the Rouge formatter to use for
   formatting a token stream from a Rouge lexer. It must respond to method
   `format` accepting a token stream and (optionally) a hash of options,
   producing `String`. Defaults to {HtmlFormatter}.

 @param formatter_opts [Hash] options to pass to the *formatter*.
   It's used only if *formatter's* `format` method has arity > 1.
   Defaults to empty hash.

 @param callouts_sub [#create] the callouts substitutor class to use for
   processing callouts. Defaults to {CalloutsSubstitutor}.

 @param passthroughs_sub [#create] the passthroughs substitutor class to
   use for processing passthroughs.
   Defaults to {PassthroughsSubstitutor}.

 @param document [Asciidoctor::Document] the document to process.