Code Monkey home page Code Monkey logo

pinboard-bookmachine's Introduction

Bookmachine

Bookmachine takes your Pinboard links and makes paperback books of them: one 6"x9" book a year.

Installation

Bookmachine is a Sinatra app. Check out the code and then run

bundle install

to set up all dependencies. You'll need Ruby/Bundler, obviously.

You'll need to create the SQLite database, next:

rake db:migrate

(Note that you might need to prefix all rake commands, and rackup, with bundle exec. Because bundler, alas.)

You will also need PrinceXML. Get that from http://www.princexml.com/download/ and install the free version as per instructions. "prince" should be in your path before you begin to publish books.

Usage

Bookmachine has two components: a series of rake tasks, and a Sinatra webapp.

  • First, place the output from https://api.pinboard.in/v1/posts/all into data/pinboard_all.xml . You'll need to authenticate via HTTP Basic.
  • Then run rake. This will ingest all your links into a database.
  • Now run rackup. This will start a Sinatra app on port 9292.
  • If you visit localhost:9292 in a browser, you'll see all the books Bookmachine is going to make. Click on one to look at it in your browser. Note that the contents and index won't have page numbers - those will be added by PrinceXML later.
  • With the webapp running, run rake publish:all from the shell to make PDFs of all years. Alternatively, to make a single year, run `rake publish:year YEAR=1999`` (for example).

If you look at the website, you won't see anything to do with pagination: not in the contents, the index, or in any headers. Do not worry: these elements will be added when Prince generates the book.

Modification

If you want to play with the format of the app, print.scss and application.scss are the SASS stylesheets that define how books look. There's lots of Prince-specific formatting in there. (Why are they two sheets? I forget; I think application.scss was what I wrote on top of somebody else's print.scss. It's a bit scrappy).

Covers

Covers are left as an exercise to the reader. I uploaded PNGs designed according to the dimensions Lulu gave me; you might just want to use Lulu's cover editor.

Printing

I used lulu.com to print my books; the PDFs are set up for the "American Trade Paperback" format. Other printers are available.

Notes

Much of the SCSS and Prince code is inspired by or taken directly from:

pinboard-bookmachine's People

Contributors

infovore avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.