Class: Jekyll::PlantUmlBlock

Inherits:
Liquid::Block
  • Object
show all
Defined in:
lib/jekyll-remote-plantuml.rb

Instance Method Summary collapse

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
52
53
54
55
56
# File 'lib/jekyll-remote-plantuml.rb', line 44

def render(context)
    output = super(context);
    #Jekyll.logger.info  "ZZZZZ we got > #{output}"
    code, pconf, baseurl = PlantUmlEncode64.new(output).encode(), PlantUmlConfig::DEFAULT, Jekyll.configuration({})['baseurl'];
    host,port = Jekyll.configuration({})['host'], Jekyll.configuration({})['port']
    p = {:url => pconf[:url], :type => pconf[:type], :code => code }
    #Jekyll.logger.info "Generate html with input params  :", p;
    #d = RemoteLoader.instance.savedRemoteBinary(p);
    d = RemoteLoader.instance.savedRemoteBinaryBase64(p);
    #puts d
    return "#{d}"
    #return "<img src=\"http://#{host}:#{port}/%{baseurl}%{uri}\" />" % d.merge({ :baseurl => baseurl });
end