Class: Gitlab::Asciidoc::IncludeProcessor

Inherits:
Asciidoctor::IncludeExt::IncludeProcessor
  • Object
show all
Extended by:
Utils::Override
Defined in:
lib/gitlab/asciidoc/include_processor.rb

Overview

Asciidoctor extension for processing includes (macro include::[]) within documents inside the same repository.

Instance Method Summary collapse

Methods included from Utils::Override

extended, extensions, method_added, override, prepended, queue_verification, verify!

Constructor Details

#initialize(context) ⇒ IncludeProcessor

Returns a new instance of IncludeProcessor.


12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/gitlab/asciidoc/include_processor.rb', line 12

def initialize(context)
  super(logger: Gitlab::AppLogger)

  @context = context
  @repository = context[:repository] || context[:project].try(:repository)
  @max_includes = context[:max_includes].to_i
  @included = []

  # Note: Asciidoctor calls #freeze on extensions, so we can't set new
  # instance variables after initialization.
  @cache = {
      uri_types: {}
  }
end