diff --git a/client/homebrew/phbStyle/phb.style.less b/client/homebrew/phbStyle/phb.style.less index 545107310..95e8ee0d9 100644 --- a/client/homebrew/phbStyle/phb.style.less +++ b/client/homebrew/phbStyle/phb.style.less @@ -1,4 +1,4 @@ - +@import (less) 'shared/naturalCrit/styles/reset.less'; @import (less) './client/homebrew/phbStyle/phb.fonts.css'; @import (less) './client/homebrew/phbStyle/phb.assets.less'; //Colors @@ -24,8 +24,8 @@ z-index : 15; box-sizing : border-box; overflow : hidden; - height : 27.5cm; - width : 21cm; + height : 279.4mm; + width : 215.9mm; padding : 1.0cm 1.7cm; column-count : 2; column-fill : auto; diff --git a/phb.standalone.css b/phb.standalone.css index 52f9ed580..997f67585 100644 --- a/phb.standalone.css +++ b/phb.standalone.css @@ -1,3 +1,126 @@ +/* Eric Meyer's Reset CSS v2.0 - http://cssreset.com */ +html, +body, +div, +span, +applet, +object, +iframe, +h1, +h2, +h3, +h4, +h5, +h6, +p, +blockquote, +pre, +a, +abbr, +acronym, +address, +big, +cite, +code, +del, +dfn, +em, +img, +ins, +kbd, +q, +s, +samp, +small, +strike, +strong, +sub, +sup, +tt, +var, +b, +u, +i, +center, +dl, +dt, +dd, +ol, +ul, +li, +fieldset, +form, +label, +legend, +table, +caption, +tbody, +tfoot, +thead, +tr, +th, +td, +article, +aside, +canvas, +details, +embed, +figure, +figcaption, +footer, +header, +hgroup, +menu, +nav, +output, +ruby, +section, +summary, +time, +mark, +audio, +video { + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; + margin: 0; + padding: 0; +} +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +menu, +nav, +section { + display: block; +} +body { + line-height: 1; +} +ol, +ul { + list-style: none; +} +blockquote, +q { + quotes: none; +} +blockquote:before, +blockquote:after, +q:before, +q:after { + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} /* Main Font */ @font-face { font-family: BookSanity; @@ -55,8 +178,8 @@ z-index: 15; box-sizing: border-box; overflow: hidden; - height: 27.5cm; - width: 21cm; + height: 279.4mm; + width: 215.9mm; padding: 1.0cm 1.7cm; column-count: 2; column-fill: auto; diff --git a/server/homebrew.api.js b/server/homebrew.api.js index 02e5462ce..692345e3c 100644 --- a/server/homebrew.api.js +++ b/server/homebrew.api.js @@ -1,3 +1,4 @@ +var _ = require('lodash'); var vitreumRender = require('vitreum/render'); var HomebrewModel = require('./homebrew.model.js').model; @@ -97,6 +98,31 @@ module.exports = function(app){ }) }); + //Print Page + var Markdown = require('marked'); + var PHBStyle = '' + app.get('/homebrew/print/:id', function(req, res){ + HomebrewModel.find({shareId : req.params.id}, function(err, objs){ + if(err) return res.status(404).send(); + + var resObj = null; + var errObj = {text: "# oops\nCould not find the homebrew."} + if(objs.length){ + resObj = objs[0]; + } + + var content = _.map(resObj.text.split('\\page'), function(pageText){ + return '