<Copyright (C) 2018 Hermann Detz>
This gem provides useful functions to generate Jupyter Notebooks, (formerly IPython Notebooks), from Ruby scripts.
Add the gem to your Gemfile:
gem 'jupyternb', :path => "path-to/jupyternb"
Update your gem list:
$ bundle install
Currently, the only functionality is to generate .ipynb files. A simple example is given in the following:
module JupyterNB
# Create a Jupyter Notebook Generator
# The parameter defines the kernel used. Present options are :ruby, :julia or :python3.
gen = Generator.new(:ruby)
# Add some content cells (either multi-line strings or arrays of strings)
gen.add_cell("markdown", "", "", "# Test header\nsome text\n## Second Header\nmore text")
gen.add_cell("code", "", "", ["puts \"Hello World!\"","# Do something useful here"])
# Simply print the output to the terminal
puts gen.generate
end
Suppport for Julia
Detecting python3 executable3 before calling it
Add capability to generate notebooks with different kernels Support for Ruby and Python3
Initial commit
- Fork it ( http://github.com/hermanndetz/middleman-gnuplot/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request