all repos — h3rald @ 3b51d55e7c54885f696101142e3ae1593a8f1bea

The sources of https://h3rald.com

Added PDF support
h3rald h3rald@h3rald.com
Fri, 23 Apr 2010 22:48:46 +0200
commit

3b51d55e7c54885f696101142e3ae1593a8f1bea

parent

6befb79d5a842334db3a874e2008e555d8c3790a

M README.textileREADME.textile

@@ -13,6 +13,7 @@ * *"extlib":http://rubyforge.org/projects/extlib/*, in some custom Rake tasks

* *"bb-ruby":http://rubyforge.org/projects/bb-ruby/*, for the BBCode filter * *"builder":http://rubyforge.org/projects/builder/*, to create RSS and ATOM feeds * *"haml":http://rubyforge.org/projects/haml/*, for the SASS filter +* *"glyph":http://www.h3rald.com/glyph*, for the Glyph filter Additionally, the following gems were necessary to migrate from the previous version of this web site, powered by "Typo":http://www.typosphere.org: * *"mysql":http://rubyforge.org/projects/mysql/*
M RulesRules

@@ -12,7 +12,10 @@ layout 'default'

end compile /(rss|atom)/ do + begin rep.filter :erb + rescue Exception + end end compile '/css/*' do

@@ -24,7 +27,10 @@ }

end compile 'sitemap' do + begin rep.filter :erb + rescue Exception + end end compile /^\/(js\/.+?)/ do

@@ -50,6 +56,48 @@ when 'bbcode' then

rep.filter :bbcode layout 'default' when 'glyph' then + # Create the PDF file + doc = %{ +document[ + head[ + style[default.css] + <style> + h1 { + font-size: 24px; + font-style:italic; + margin: 0.5em auto; + padding: 0.5em auto; + } + </style> + ] + body[ + titlepage[ + title[] + subtitle[] + author[] + <span class="pubdate">\\.$[document.date]</span> + <div><em>Originally published on =>[http://www.h3rald.com#{item.identifier}|H3RALD.com]</em></div> + ] + textile[ + #{item.raw_content} + ] + ] +] } + f = Pathname.new "#{Dir.pwd}/output#{item.identifier.gsub(/\/$/, '')}.glyph" + f.parent.mkpath + # Write the new raw file using Glyph's file_write method + file_write f, doc + # Now compile the PDF (works if Prince is installed) + target = Glyph['document.output'] + Glyph['document.output'] = 'pdf' + Glyph['document.author'] = "Fabio Cevasco" + Glyph['document.date'] = item[:date].strftime "%A, %d %B %Y" + Glyph['document.title'] = item[:title] + Glyph.compile f.to_s, f.to_s.gsub(/\.glyph$/, '.pdf') + f.unlink + Pathname.new(f.to_s.gsub(/\.glyph$/, '.html')).unlink + Glyph.reset + # Filter text rep rep.filter :glyph layout 'default' end
M content/articles/succeeding-with-agile-review.glyphcontent/articles/succeeding-with-agile-review.glyph

@@ -5,11 +5,69 @@ - book

- review :permalink: succeeding-with-agile-review :title: "Book Review: Succeeding with Agile" +:summary: "" :toc: true +:pdf: true :date: 2010-04-22 14:16:28.099000 +02:00 ----- -article[ -$:[document.draft|true] -![*TBD*] -] +&:[book|_Succeeding with Agile_] +&:[author|Mike Cohn] +&:[url|![URL to the book's web site]...] +&:[links|![Links to agile resources]...] +&:[l_book|=>[&[url]|&[book]]] +&:[S|_Scrum_] +&:[ag|_agile_] +%:[=pt| + n, title, contents = @params + interpret %{section[header[Part #{n}: #{title}] + #{contents} + ]} +=] +--[-----------------------------------] + +bq. "This is not a book for those who are completely new to Scrum or agile. There are other books, classes, and even websites for that. If you are completely new to Scrum, start with one of those." + +p(((((. -- &[author], &[book] + +Great. That's just great. Good job I started with the _Introduction_ first, otherwise the first chapters of this book would have been way too overwhelming! + +&[l_book] is a book that _doesn't_ teach you about &[S] or &[ag] methodologies, it won't give you a definition of ScrumMaster, sprint, or backlog... instead, it takes all that for granted and teaches how to pragmatically adopt -- or better, ADAPT(Awareness, Desire, Ability, Promotion, Transfer) to -- &[S], in the context of yourself, your team, and even your entire organization. + +bq. "\[...\] this book draws on my experience with &[S] over the past 15 years, but especialle the last 4. For the last 4 years, every evening after I spent the day with one of my clients, I would go back to my hotel room and make notes about problems they were facng, the question they asked, and the advice I gave." + +Indeed, this book is a gold mine of information, anecdotes, tips and tricks about everything you could possibly want to know about making Scrum work, at any level. If you have some knowledge about &[ag] development you definitely have some questions: _will it work?_ ... _is it really more productive?_ ... _how can I make my boss understant this?_ Well, I'm not exaggerating when I say that this book has all the answers you need. Most definitely it also answer questions you didn't think of (yet). + +If you don't know what all this is about, then you'd better do your homework first: +&[links] + +section[header[Contents] + +The book is organized into five parts of different length, ranging from 20 to over 100 pages. If you read the book from the start till the very end, you'll notice that the start of each part is like a new milestone in Scrum adoption: first the author makes sure that _you_ are prepared (Part 1), then move on to deal with individuals and initial resistance (Part 2), then teams (Part 3) and finally the whole organization (Part 4), until you can finally see the fruits of you labor (PArt 5). + +In a way, you may well want to carry this book in your briefcase every day you go to work, and read it bit by bit, as you make progress in your quest for Scrum adoption. + + pt[I|Getting Started| +... + ] --[End of part I] + + pt[II|Individuals| + + ] --[End of part II] + + pt[III|Teams| + + ] --[End of part III] + + pt[IV|The Organization| + + ] --[End of part IV] + + pt[V|Next Steps| + + ] --[End of part V] +] --[End of Contents section] + + + +
M content/css/_code.sasscontent/css/_code.sass

@@ -1,5 +1,3 @@

------ ------ @import definitions .highlight
M content/css/_definitions.sasscontent/css/_definitions.sass

@@ -1,6 +1,3 @@

------ ------ - // Variables !red = #A4282D !gray = #555
M content/css/_elements.sasscontent/css/_elements.sass

@@ -1,5 +1,3 @@

------ ------ @import definitions #content img
M content/css/_fancybox-gallery.sasscontent/css/_fancybox-gallery.sass

@@ -1,5 +1,3 @@

------ ------ #gallery padding: 1em width: 750px
M content/css/_fancybox.sasscontent/css/_fancybox.sass

@@ -1,5 +1,3 @@

------ ------ html, body height: 100%
M content/css/_layout.sasscontent/css/_layout.sass

@@ -1,5 +1,3 @@

------ ------ @import definitions *
M content/css/_text.sasscontent/css/_text.sass

@@ -1,5 +1,3 @@

------ ------ @import definitions /* TEXT */
M content/css/main.sasscontent/css/main.sass

@@ -1,5 +1,3 @@

------ ------ @import layout.sass @import elements.sass @import text.sass
M layouts/default.erblayouts/default.erb

@@ -79,6 +79,9 @@ <span><script type="text/javascript" src="http://w.sharethis.com/button/sharethis.js#publisher=6e34d60c-b14e-4c19-9b2f-7c35a9f0ab09&amp;type=website&amp;linkfg=%23a4282d"></script></span>

<% if @item[:feed] then %> <span><a href="<%= @item[:feed_url] || @item[:feed]+"rss/" %>" type="application/rss+xml" rel="alternate"><img src="/images/theme/feed.png" alt="#"/>RSS Feed</a></span> <% end %> + <% if @item[:feed] then %> + <span><a href="<%= @item.identifier.chop %>.pdf" ><img src="/images/theme/pdf.png" alt="#"/>PDF</a></span> + <% end %> <span><a href="http://github.com/h3rald/h3rald/raw/master/<%= @item[:file].path %>?iframe" class="fancybox"><img src="/images/theme/source.png" alt="#"/>View Source</a></span> </div>
M lib/bbcode_filter.rblib/bbcode_filter.rb

@@ -1,11 +1,14 @@

require 'rubygems' -require 'bb-ruby' +begin +require 'bb-ruby' +rescue Exception +end class BbcodeFilter < Nanoc3::Filter identifier :bbcode def run(content, args) - content.bbcode_to_html + content.bbcode_to_html rescue content end end
M lib/glyph_filter.rblib/glyph_filter.rb

@@ -5,7 +5,13 @@ class GlyphFilter < Nanoc3::Filter

identifier :glyph def run(content, args) - Glyph.filter content + doc = %{ + textile[ + section[ + #{content} + ] + ]} + Glyph.filter doc end end
D lib/glyph_macros.rb

@@ -1,12 +0,0 @@

-require 'rubygems' -require 'glyph' - -Glyph.class_eval do - - macro :article do - interpret %{textile[ - #@value - ]} - end - -end