Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wtnabe/jekyll-kroki-tag
text-to-diagram power to Jekyll with kroki.io
https://github.com/wtnabe/jekyll-kroki-tag
jekyll kroki ruby rubygems
Last synced: 2 months ago
JSON representation
text-to-diagram power to Jekyll with kroki.io
- Host: GitHub
- URL: https://github.com/wtnabe/jekyll-kroki-tag
- Owner: wtnabe
- License: bsd-2-clause
- Created: 2023-08-17T05:34:49.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-15T23:14:19.000Z (5 months ago)
- Last Synced: 2024-10-18T22:08:49.950Z (3 months ago)
- Topics: jekyll, kroki, ruby, rubygems
- Language: Ruby
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Jekyll::KrokiTag
A plugin that add feature \`text to diagram\` to Jekyll using [kroki.io](https://kroki.io/) hosting. To experiment with that code, run `bin/console` for an interactive prompt.
```
irb(main)> Liquid::Template.register_tag('kroki', Jekyll::KrokiTag::Block)
irb(main)> t = Liquid::Template.parse('{% kroki type: "plantuml" %}actor User{% endkroki %}'
irb(main)> puts t.render
```result
```
```## Installation
Install the gem and add to the application's Gemfile by executing:
$ bundle add jekyll-kroki-tag
If bundler is not being used to manage dependencies, install the gem by executing:
$ gem install jekyll-kroki-tag
## Usage
Add to config.
```yaml
plugins:
- jekyll-kroki-tag
```Write your content.
```liquid
{% kroki type: 'plantuml' %}
actor User
usecase "Write great code" as case
User -> case
{% endkroki %}
```A Converted HTML as below.
```html
```
Now you don't need to convert every test-diagram image into real image file and store it and write its path in Markdown or HTML flle.
### Supported attribute
* type ( required. PlantUML, Graphviz, Mermaid, ... )
* format ( PNG, SVG, and more. default is svg )
* alt
* caption## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/wtnabe/jekyll-kroki-tag.