Skip to content
This repository has been archived by the owner on Mar 16, 2018. It is now read-only.

Commit

Permalink
Make the bookmark a little more printer friendly.
Browse files Browse the repository at this point in the history
I've stolen the layout template from
https://github.com/freerange/printer-mail, which is based on the
[sample](http://printer.gofreerange.com/sample.html).
  • Loading branch information
chrisroos committed Apr 11, 2012
1 parent 68496e1 commit 0ba5366
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
10 changes: 9 additions & 1 deletion NOTES.md
Expand Up @@ -10,4 +10,12 @@ I used cURL to download an amazon book page so that I could play around with ext


After playing around a little I was able to create a script (generate-bookmark.rb) that took the URL of an Amazon book page, or the location of a local file, and emit the html of a simple bookmark. After playing around a little I was able to create a script (generate-bookmark.rb) that took the URL of an Amazon book page, or the location of a local file, and emit the html of a simple bookmark.


The next step is to create a simple web interface that allows the bookmarks to be generated and, finally, printed. ./generate-bookmark.rb "http://www.amazon.co.uk/Vanishing-Point-Danielle-Ramsay/dp/1847562337/ref=tmm_pap_title_0"

The next step is to create a simple web interface that allows the bookmarks to be generated and, finally, printed.

I've now got my sinatra app that allows me to dynamically generate bookmarks for a given Amazon page, e.g. http://printer-bookmarks.dev/bookmark?url=http://www.amazon.co.uk/gp/product/1849014752/ref=s9_simh_gw_p14_d0_g14_i4?pf_rd_m=A3P5ROKL5A1OLE&pf_rd_s=center-2&pf_rd_r=1JDCZ1FRTRETGVAZZ5XX&pf_rd_t=101&pf_rd_p=467128533&pf_rd_i=468294

I've also got the app deployed to heroku at http://printer-bookmarks.heroku.com/

Now I need to make the bookmark a little more printer friendly.
16 changes: 5 additions & 11 deletions templates/bookmark.haml
@@ -1,11 +1,5 @@
!!! 5 %img#cover-image{:src => book.cover_image_url}

%h1#book-title= book.title
%html %p Started:
%head %p Finished:
%title Bookmark %p Notes
%body
%img#cover-image{:src => book.cover_image_url}
%h1#book-title= book.title
%p Started:
%p Finished:
%p Notes
9 changes: 9 additions & 0 deletions templates/layout.haml
@@ -0,0 +1,9 @@
!!! 5

%html
%head
%link{:rel => "stylesheet", :href => "http://printer.gofreerange.com/stylesheets/print.css", :type => "text/css", :media => "screen", :charset => "utf-8"}
%body.preview
.paper
.content
= yield

0 comments on commit 0ba5366

Please sign in to comment.