Pseudocode.js for Ruby
This rubygem enables you to render LaTeX pseudocode algorithms to HTML using pseudocode.js and KaTeX.
This code is heavily inspired by KaTeX for Ruby and it uses it and ExecJS under the hood.
Installation
Add this line to your application's Gemfile:
gem 'pseudocode', '~> 0.1.0'
And then execute:
$ bundle
Or install it yourself as:
$ gem install pseudocode
Usage
Render some algorithm:
Pseudocode.render algorithm
#=> "<span class=\"root\">..."
Learn more about all the available synyax in the documentation.
Assets
For this rendered algorithms to look nice, you will also need to include Pseudocode CSS into the webpage.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/FlorianFranzen/pseudocode-ruby.
License
The gem is available as open source under the terms of the MIT License.