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.
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
Render some algorithm:
Pseudocode.render algorithm
#=> "<span class=\"root\">..."
Learn more about all the available synyax in the documentation.
For this rendered algorithms to look nice, you will also need to include Pseudocode CSS into the webpage.
Bug reports and pull requests are welcome on GitHub at https://github.com/FlorianFranzen/pseudocode-ruby.
The gem is available as open source under the terms of the MIT License.