Class: AsciidoctorExtensions::KrokiBlockProcessor
- Inherits:
-
Extensions::BlockProcessor
- Object
- Extensions::BlockProcessor
- AsciidoctorExtensions::KrokiBlockProcessor
- Defined in:
- lib/asciidoctor/extensions/asciidoctor_kroki/extension.rb
Overview
A block extension that converts a diagram into an image.
Instance Method Summary collapse
-
#initialize(name = nil, config = {}) ⇒ KrokiBlockProcessor
constructor
A new instance of KrokiBlockProcessor.
- #process(parent, reader, attrs) ⇒ Object
Constructor Details
#initialize(name = nil, config = {}) ⇒ KrokiBlockProcessor
Returns a new instance of KrokiBlockProcessor.
23 24 25 26 |
# File 'lib/asciidoctor/extensions/asciidoctor_kroki/extension.rb', line 23 def initialize(name = nil, config = {}) @logger = (config || {}).delete(:logger) { ::Asciidoctor::LoggerManager.logger } super(name, config) end |
Instance Method Details
#process(parent, reader, attrs) ⇒ Object
28 29 30 31 32 |
# File 'lib/asciidoctor/extensions/asciidoctor_kroki/extension.rb', line 28 def process(parent, reader, attrs) diagram_type = @name diagram_text = reader.string KrokiProcessor.process(self, parent, attrs, diagram_type, diagram_text, @logger) end |