Install it first:
$ gem install jekyll-plantuml
With Jekyll 2, simply add the gem to your _config.yml
gems list:
gems: ['jekyll-plantuml', ... your other plugins]
Or for previous versions,
create a plugin file within your Jekyll project's _plugins
directory:
# _plugins/plantuml-plugin.rb
require "jekyll-plantuml"
Highly recommend to use Bundler. If you're using it, add this line
to your Gemfile
:
gem "jekyll-plantuml"
The plugin is compatible with Jekyll 3.9.3 and Jekyll 4.3.2. You can find our integration tests, which prove the compatibility, here.
Then, make sure PlantUML
is installed on your build machine, and can
be executed with a simple plantuml
command.
On Ubuntu, just apt-get install -y plantuml
should work.
However, if it doesn't, you can create a /usr/bin/plantuml
with the
following content:
#!/bin/bash
java -jar /home/user/Downloads/plantuml.jar "$1" "$2"
Remember to change the path to the plantuml.jar
file.
Then, set the executable permission of the file:
$ chmod +x /usr/bin/plantuml
Now, it's time to create a diagram, in your Jekyll blog page:
{% plantuml %}
[First] - [Second]
{% endplantuml %}
Now, check this blog post: the UML sequence diagram in it is auto-generated using exactly this plugin. The sources of the blog are available in GitHub.
Read these guidelines. Make sure you build is green before you contribute your pull request. You will need to have Ruby 2.3+ and Bundler installed. Then:
$ bundle update
$ bundle exec rake
If it's clean and you don't see any error messages, submit your pull request.