Class: Jekyll::Diagrams::BasicRenderer
- Inherits:
-
Object
- Object
- Jekyll::Diagrams::BasicRenderer
- Includes:
- Rendering
- Defined in:
- lib/jekyll-diagrams/basic_renderer.rb
Direct Known Subclasses
ErdRenderer, GraphvizRenderer, MermaidRenderer, NomnomlRenderer, PlantUMLRenderer, SMCatRenderer, SvgbobRenderer, SyntraxRenderer, WavedromRenderer
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(context, content, options = {}) ⇒ BasicRenderer
constructor
A new instance of BasicRenderer.
- #render ⇒ Object
Methods included from Rendering
render_with_command, render_with_stdin_stdout, render_with_tempfile
Constructor Details
#initialize(context, content, options = {}) ⇒ BasicRenderer
Returns a new instance of BasicRenderer.
12 13 14 15 16 17 18 |
# File 'lib/jekyll-diagrams/basic_renderer.rb', line 12 def initialize(context, content, = {}) @context = context @content = content @diagram = .fetch(:diagram_name) do self.class.name.split('::').last.sub(/Renderer$/, '').downcase end end |
Class Method Details
.render(context, content, options = {}) ⇒ Object
8 9 10 |
# File 'lib/jekyll-diagrams/basic_renderer.rb', line 8 def self.render(context, content, = {}) new(context, content, ).render end |
Instance Method Details
#render ⇒ Object
20 21 22 23 24 25 |
# File 'lib/jekyll-diagrams/basic_renderer.rb', line 20 def render output = render_svg(@content, configuration) Utils.wrap_class(output, @diagram) rescue StandardError => error Utils.wrap_class(Utils.handle_error(@context, error), @diagram) end |