lib/jekyll-diagrams/plantuml.rb in jekyll-diagrams-0.9.3 vs lib/jekyll-diagrams/plantuml.rb in jekyll-diagrams-0.10.0
- old
+ new
@@ -1,25 +1,10 @@
# frozen_string_literal: true
+require_relative 'plantuml/renderer'
+require_relative 'plantuml/block'
+
module Jekyll
module Diagrams
- class PlantUMLBlock < Block
- XML_REGEX = /^<\?xml([^>]|\n)*>\n?/.freeze
-
- def render_svg(code, config)
- command = build_command(config)
-
- svg = render_with_stdin_stdout(command, code)
- svg.sub!(XML_REGEX, '')
- end
-
- def build_command(_config)
- jar = Diagrams.vendor_path('plantuml.1.2020.1.jar')
-
- options = +Diagrams.run_jar(jar)
- options << ' -tsvg -pipe'
- end
- end
+ Liquid::Template.register_tag(:plantuml, PlantUMLBlock)
end
end
-
-Liquid::Template.register_tag(:plantuml, Jekyll::Diagrams::PlantUMLBlock)