To set up this project, you will need to:
- install rbenv,
- use rbenv to install the correct version of the Ruby programming language,
- use the Ruby programming language's tools to install Bundler, and finally,
- use bundler to install this project's only dependency, Spiffy.
These steps are detailed below...
-
Install rbenv using your computer's package manager.
-
On macOS with Homebrew:
$ brew install rbenv
-
-
Set up rbenv so it can install/build the ruby programming language:
$ rbenv init
Use the instructions it prints to add the rbenv shim to your shell's configuration. This shim ensures when you type
ruby
orgem
at the command-line, you get the version of Ruby stated in a project's.ruby-version
file, or the default if a.ruby-version
file can't be found in the current folder or any of its ancestors. -
Close and re-open your shell so the configuration you added in the last step is used.
-
Optional but recommended: run rbenv's "doctor" program to check everything is set up correctly:
$ curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
rbenv-doctor will probably tell you that you don't have any ruby versions installed, but that's normal if you just installed rbenv.
-
Install the correct version of Ruby for this project by running:
$ rbenv install
-
Install Bundler:
$ gem install bundler
-
Use Bundler to install this project's dependencies:
$ bundle install
-
Create a markdown file.
For example, the following creates a simple file named
test.md
that has a first-level heading which says "Hello world":$ echo "# Hello world" | tee -a test.md
-
Run spiffy on the file to transform it into HTML:
$ bundle exec spiffy --html on --pdf off -- $FILE
... where
$FILE
is the path to the file you created in step 1.For example, if you created
test.md
above, you can transform it to HTML as follows:$ bundle exec spiffy --html on --pdf off -- test.md