Project

r_to_d2

0.0
No release in over 3 years
Ruby to D2. Convert diagrams to SVG and PNG via the compiled D2 binary.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

r_to_d2

THIS IS AN ALPHA RELEASE. USE AT YOUR OWN RISK.

This gem ships Go executables downloaded from here: https://github.com/terrastruct/d2/releases

Installation

⚠️ If your CPU architecture or operating system isn't supported, the following steps will install the gem for the ruby platform. That is a gem without the Go binary, which raises errors on usage.

Install the gem and add to the application's Gemfile by executing:

bundle add r_to_d2

If bundler is not being used to manage dependencies, install the gem by executing:

gem install r_to_d2

Usage

svg_string = RToD2.to_svg('a -> b')
File.open('test.svg', 'w').write(svg_string)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/dunkelziffer/r_to_d2.

License

The gem is available as open source under the terms of the MIT License.