Class: Jekyll::PlantUmlBlock
- Inherits:
-
Liquid::Block
- Object
- Liquid::Block
- Jekyll::PlantUmlBlock
- Defined in:
- lib/jekyll-remote-plantuml.rb
Instance Method Summary collapse
-
#initialize(tag_name, markup, tokens) ⇒ PlantUmlBlock
constructor
Plugin initilializer.
-
#render(context) ⇒ Object
Render.
Constructor Details
#initialize(tag_name, markup, tokens) ⇒ PlantUmlBlock
Plugin initilializer
38 39 40 41 |
# File 'lib/jekyll-remote-plantuml.rb', line 38 def initialize(tag_name, markup, tokens) super @markup = markup; end |
Instance Method Details
#render(context) ⇒ Object
Render
44 45 46 47 48 49 50 51 |
# File 'lib/jekyll-remote-plantuml.rb', line 44 def render(context) output = super(context); code, pconf, baseurl = PlantUmlEncode64.new(output).encode(), PlantUmlConfig::DEFAULT, Jekyll.configuration({})['baseurl']; p = {:url => pconf[:url], :type => pconf[:type], :code => code } Jekyll.logger.debug "Generate html with input params :", p; d = RemoteLoader.instance.savedRemoteBinary(p); return "<img src=\"%{baseurl}%{uri}\" />" % d.merge({ :baseurl => baseurl }); end |