Neruda is a little Sinatra app, which aims to offer a quick access for writers to web publication. It is named in memory of Pablo Neruda.
Source code is available on my cgit instance, while issues should be followed on my redmine instance.
Install
These installation instructions use rvm as ruby provider. If you want to use rbenv or your system ruby, please refer to their specific documentation to know how to install ruby 2.4.
First we need to upgrade rvm (always do that from time to time):
$ rvm get latest
$ rvm install ruby-2.4.1
Then the installation itself:
$ mkdir mysite
$ rvm use ruby-2.4.1@neruda --create
$ gem install neruda
Finally, you need to configure it to your needs.
$ pablo init
Running it
For testing it, you should just run:
$ pablo start
For production use, just pass the right environnement variable:
$ APP_ENV=production pablo start
To stop it, just enter ctrl+C if you are in development mode or enter pablo stop in production mode.
Pablo command
In order to manage you Neruda installation, this gem provides a little helper called pablo. You already used it to init, start and stop your local installation. It can do a little more.
New
pablo new [article title] will open your favorite text editor to let you write a new chapter to your book.
If you don't provide a title to the command, pablo will ask you for one before launching your editor.
If you don't have configured the EDITOR or VISUAL environnement variable, pablo will default to Gnu Emacs.
Compile
pablo compile will first convert your orphaned org files (the ones without a corresponding epub file), then producing the global epub book, made with all your chapters.
Capify
pablo capify will add the correct references to Neruda rake tasks in your Capfile, what will allow you to call them as part of your deployment workflow.
You can add the chapters:sync task:
after 'deploy:finishing', 'chapters:sync'
This task depends on all the following. Or you can just select a bunch of them:
after 'deploy:finishing', 'chapters:build_epubs'
after 'deploy:finishing', 'chapters:upload_epubs'
after 'deploy:finishing', 'chapters:upload_book'
after 'deploy:finishing', 'chapters:purge:remote'
Don't forget to restart the remote sinatra server:
after 'deploy:finished', 'sinatra:restart:remote'
Known issues
See issues on redmine.