jekyll-plantuml-base64

Build Status Gem Version Maintainability Test Coverage security

A Jekyll plugin to simplify the creation of diagrams and flowcharts in your posts and pages with PlantUML as base64 image. forked from: https://github.com/Patouche/jekyll-remote-plantuml

A plugin for jekyll to use plantuml diagram inside your Jekyll for you website. Origin of this code will use external resource to build plantuml diagram. Once created, the diagram is store on the filesystem to prevent any unnecessary diagram generation. So, using this plugin, provide a simple way to integrate plantuml diagramm without the Graphiz software or the using the plantuml jar file but I modified by convert that file into base64 and displayed on your website.

Installation

Option 1: To install this plugin on Jekyll, you just have to follow the guideline of Jekyll documentation

Option 2: Use rubygems, by adding gem 'jekyll-plantuml-base64', '~> 0.1.4.36' on your gemfile then bundle install

Option 3: Pull the gems directly from git by adding gem 'jekyll-remote-plantuml', '0.1.4.36', git: 'https://github.com/RobbiNespu/jekyll-remote-plantuml' on your gemfile and then bundle install

Usage

To use the jekyll-plantuml-base64 plugin, you just have to wrap you text between {% plantuml %} and {% endplantuml %} tags.

For example, to create a basic shema between Bob and Alice, you can write the following code :

{% plantuml %}
Bob -> Alice : Hello 
{% endplantuml %}

This will retrieve the binary from a remote provider and add it into the folder defined in your configuration.

Bob and Alice generated

The origin will generated html will have be something like :

<img src="/assets/images/plantuml/765f88ab868d9706e797ff2c90c67a549a144c52adf0bf2e247d355cf981b9aa.png" />

Any update of the uml will regenerated the image file using the remote. If the uml is not modified, no request will be made on the remote provider.

but this code will convert them nto base64 format

<img src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAK0AAAA2CAIAAAA6bI6UAAAAKXRFWHRjb3B5bGVmdABHZW5lcmF0
 ZWQgYnkgaHR0cDovL3BsYW50dW1sLmNvbREwORwAAAEAaVRYdHBsYW50dW1sAAEAAAB4nDWOTW+C
 QBCG75v4H+YIaSRgTT84mbbaxkBqXOFiPKwwJZvCLFlmaf33XSU9zrzPO/OsBlaWXdfOxHGj7cAn
 mMNRYmWoPs3ECqm+hWLXKuIiz2BEO2hDkESLeBFH8fMZWd0HBX2T+SG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FAouLDSol2vCyo60R1DnA8Z85nMTHR+HQYiFGoNM2R
 g3Pn/hgzZnCbNq0Q/6FD+yEW0qi1a2fjPSoiIsJihvfGsrLDM2d+2rdvDzwwaOnRo8v8+VMwQaUO
 qN77938X8xX1wZAh/fAKQNqxO8THz8EbBN6cMQ1QW5B2VE54p0ALeW+U+tepPJTnAJvsggVfREdH
 oTKNjR0RnvfG0JMqwyjwKZ+dVANFDuqBT/nspBpopu+p6sgIGqaQz06qgeL7ByaQz06qgWb6nqqO
 jKBhCvnspBoovp9oAvnspBoocmAC+eykGii+p2oC+eykGijqRBPIZyfVQPE9VRPIZyfVQPF7pHrg
 Uz47qQaKHNQDn/LZSTXQfw606qZwkdRrOjKMAp/y2Uk10H8O+KSODKPAs3x26hiozIG8bsq2pmTF
 Je1YlmBfGo9LhJ/b7VoyjALX8tmpbaAyB3J4PB6Xy+VwONJ4gt8/328I8CmfHX4N1MtBYWEhUuN0
 OjHSxge0/p1HQ4BD+ezQMlAvB1g3vF4vxiA+WXxA69/7NAQ4lM8OLQP1coC8oDeCgzXEzQe0/t1X
 Q4BD+ezQMlAvB+iHyGAANpISPoA7wf3grnBvNTU1yjs2FBzKZ4eWgXo5EHhzIHIg4IPIgYAP/wGD
 zxhdIJCj5gAAAABJRU5ErkJggg==
 ">

Mean, i do not need to really install this file because during CI/CD build process, the plugin will convert them into base64. Anyway, it will execute every time you build. If you have a lots of image and heavy / big images then pls consider using original plugins.

Configuration

For now, the configuration is really poor. You can just change the remote provider and the location where are store the binary files.

plantuml:
  url:   'http://www.plantuml.com/plantuml/png/{code}'
  assets:  '_images/plantuml/'

check file plantuml-config.rb

  DEFAULT = {
        :assets       => 'assets/img/plantuml/',
        :type         => 'png',
        :encode       => 'encode64',
        :url          => 'http://www.plantuml.com/plantuml/{type}/{code}'
    }

Notes

I'm sorry if it's sad code for a ruby developper which I'm not. I tried to do my best and to share it with the community. So please be lenient.

If you have any request, please leave a message and don't hesitate for any pull request.

License

This plugin is under the MIT license. See LICENSE.txt file for more details.