all repos — h3rald @ b21e8543535c63ea4dcdd4d2eaa34819df538389

The sources of https://h3rald.com

Improved Glyph integration.
h3rald h3rald@h3rald.com
Wed, 15 Sep 2010 17:24:55 +0200
commit

b21e8543535c63ea4dcdd4d2eaa34819df538389

parent

e55d7389037e6e4c4fa14cb248ee21ed8d88269a

6 files changed, 133 insertions(+), 83 deletions(-)

jump to
M RulesRules

@@ -1,18 +1,18 @@

#!/usr/bin/env ruby compile /^\/(archives|home)\// do - rep.filter :erb + filter :erb layout 'default' end compile /^\/(projects|about)/ do - rep.filter :erb - rep.filter :redcloth + filter :erb + filter :redcloth layout 'default' end compile /(rss|atom)/ do - rep.filter :erb unless rep.binary? # e.g. rss.png image + filter :erb unless rep.binary? # e.g. rss.png image end compile '/styles/_*/' do

@@ -29,7 +29,7 @@ end

end compile "sitemap" do - rep.filter :erb + filter :erb end compile /^\/(js\/.+?)/ do

@@ -43,53 +43,26 @@

compile '*' do if item[:filters_pre] && !item[:filters_pre].empty? then item[:filters_pre].each do |f| - rep.filter f.to_sym + filter f.to_sym end layout 'default' else unless rep.binary? then case item[:extension] when 'textile' then - rep.filter :redcloth + filter :redcloth layout 'default' when 'md','markdown' then - rep.filter :bluecloth + filter :bluecloth layout 'default' when 'bbcode' then - rep.filter :bbcode + filter :bbcode layout 'default' when 'glyph' then - require 'glyph' - instance_eval Glyph.file_load("#{Dir.pwd}/lib/glyph.data") pdf_file = Pathname.new "#{Dir.pwd}/output#{item.identifier.gsub(/\/$/, '')}.pdf" - unless pdf_file.exist? then - # Create the PDF file - f = Pathname.new "#{Dir.pwd}/output#{item.identifier.gsub(/\/$/, '')}.glyph" - f.parent.mkpath - doc = %{ - h3rald.article[ - @identifier[#{item.identifier}] - @content[section[#{item.raw_content}]] - ] - } - # 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['site.root'] = ".." - Glyph.compile f.to_s - begin - f.unlink - Pathname.new(f.to_s.gsub(/\.glyph$/, '.html')).unlink - rescue - end - end - Glyph['site.root'] = "" - # Filter text rep - rep.filter :glyph - layout 'default' - Glyph.reset + glyph_config @item + glyph_pdf_for @item unless pdf_file.exist? + glyph_article_for @item end end end
M content/articles/h3rald-81.glyphcontent/articles/h3rald-81.glyph

@@ -10,14 +10,9 @@ :tags:

- website - webdevelopment :intro: | - Just "over a year ago":/articles/take-back-your-site-with-nanoc I released the 8th version of this web site. - The biggest change then was abandoning the Rails-powered "Typo":http://wiki.github.com/fdv/typo/ blogging - platform in favor of "nanoc":http://nanoc.stoneship.org/, arguably the most versatile static site generator out - there. + Just "over a year ago":/articles/take-back-your-site-with-nanoc I released the 8th version of this web site. The biggest change then was abandoning the Rails-powered "Typo":http://wiki.github.com/fdv/typo/ blogging platform in favor of "nanoc":http://nanoc.stoneship.org/, arguably the most versatile static site generator out there. - A year later, I am still very happy with nanoc, hence there's no need for another major release. Nonetheless, I - decided to improve the site's overall design and image, making it (hopefully) easier to use and more pleasant to - the eye. + A year later, I am still very happy with nanoc, hence there's no need for another major release. Nonetheless, I decided to improve the site's overall design and image, making it (hopefully) easier to use and more pleasant to the eye. :extended_intro: | TODO... -----
A content/images/logo.svg

@@ -0,0 +1,73 @@

+ +<!-- saved from url=(0074)http://github.com/h3rald/h3rald/raw/master/content/images/theme/h3rald.svg --> +<html><body><pre style="word-wrap: break-word; white-space: pre-wrap;">&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt; +&lt;!-- Created with Inkscape (http://www.inkscape.org/) --&gt; +&lt;svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="192.72461" + height="50" + id="svg2" + version="1.1" + inkscape:version="0.46" + sodipodi:docname="h3rald.svg" + sodipodi:version="0.32" + inkscape:output_extension="org.inkscape.output.svg.inkscape"&gt; + &lt;sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="5.6" + inkscape:cx="58.682399" + inkscape:cy="18.141886" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="739" + inkscape:window-height="667" + inkscape:window-x="1621" + inkscape:window-y="214" + inkscape:window-maximized="1" /&gt; + &lt;defs + id="defs4"&gt; + &lt;inkscape:perspective + id="perspective12" + inkscape:persp3d-origin="96.362305 : 14.717494 : 1" + inkscape:vp_z="192.72461 : 22.076241 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_x="0 : 22.076241 : 1" + sodipodi:type="inkscape:persp3d" /&gt; + &lt;/defs&gt; + &lt;metadata + id="metadata7"&gt; + &lt;rdf:RDF&gt; + &lt;cc:Work + rdf:about=""&gt; + &lt;dc:format&gt;image/svg+xml&lt;/dc:format&gt; + &lt;dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /&gt; + &lt;dc:title /&gt; + &lt;/cc:Work&gt; + &lt;/rdf:RDF&gt; + &lt;/metadata&gt; + &lt;g + transform="translate(-87.179131,-151.72462)" + id="layer1" + inkscape:groupmode="layer" + inkscape:label="Layer 1"&gt; + &lt;path + style="font-size:50px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Cardo;-inkscape-font-specification:Cardo" + d="M 68.84375 3.34375 C 67.037097 3.3437848 65.235991 3.3874046 63.4375 3.46875 C 61.63899 3.5501648 59.837885 3.5924826 58.03125 3.625 C 57.412757 3.6413105 56.935544 3.6793966 56.59375 3.6875 C 56.251951 3.6956725 55.991534 3.6793965 55.8125 3.6875 C 55.633462 3.6956724 55.494464 3.7187845 55.4375 3.71875 C 55.380533 3.7187844 55.360024 3.7187845 55.34375 3.71875 C 55.246093 3.7350604 55.172525 3.7718444 55.15625 3.8125 C 55.139973 3.8532244 55.156249 3.8737323 55.15625 3.90625 L 55.15625 4.5 C 55.156249 4.5325857 55.163085 4.5762053 55.1875 4.625 C 55.211913 4.6738616 55.262368 4.6875333 55.34375 4.6875 L 56.25 4.6875 C 56.396482 4.6875334 56.678708 4.7243171 57.09375 4.78125 C 57.508786 4.8382495 57.958655 4.9827804 58.40625 5.21875 C 58.853836 5.4547853 59.251948 5.809277 59.59375 6.28125 C 59.935541 6.7532866 60.093744 7.4049785 60.09375 8.21875 L 60.09375 34 C 60.093744 34.716149 59.928705 35.30111 59.5625 35.78125 C 59.196284 36.261395 58.52148 36.600914 57.59375 36.8125 C 57.512366 36.828777 57.382809 36.865562 57.1875 36.90625 C 56.992185 36.946941 56.790362 36.96745 56.5625 37 C 56.334633 37.032553 56.117836 37.09245 55.90625 37.125 C 55.864119 37.131482 55.850114 37.119809 55.8125 37.125 C 55.954377 36.800503 56.098543 36.462083 56.21875 36.125 C 56.667942 34.865245 56.906222 33.542982 56.90625 32.15625 C 56.906223 31.375015 56.822238 30.531266 56.65625 29.59375 C 56.490207 28.656267 56.167942 27.730488 55.71875 26.8125 C 55.269505 25.894551 54.632787 25.007834 53.8125 24.1875 C 52.992164 23.36721 51.94529 22.69143 50.65625 22.125 C 50.343729 21.988305 49.910135 21.857447 49.34375 21.75 C 48.777324 21.642602 48.16795 21.593775 47.5625 21.59375 C 47.425763 21.593774 47.302716 21.58401 47.15625 21.59375 C 47.009748 21.60354 46.86717 21.636744 46.75 21.65625 L 46.65625 21.65625 L 46.65625 21.625 C 46.656233 21.566431 46.787092 21.435572 47.03125 21.25 C 47.275373 21.064478 47.552716 20.849635 47.875 20.625 C 48.197247 20.400416 48.531231 20.193386 48.84375 19.96875 C 49.15623 19.744167 49.37498 19.554715 49.53125 19.4375 C 50.585916 18.38284 51.460915 17.308623 52.125 16.15625 C 52.789039 15.003937 53.124976 13.746126 53.125 12.4375 C 53.124976 11.402378 52.910132 10.474645 52.5 9.625 C 52.089821 8.7754278 51.490212 8.0644909 50.71875 7.46875 C 49.947245 6.873086 49.019511 6.3848051 47.90625 6.0625 C 46.792951 5.7402746 45.542952 5.5937903 44.15625 5.59375 C 43.179674 5.5937904 42.15819 5.7988682 41.09375 6.21875 C 40.029286 6.6387112 39.007803 7.2266011 38.03125 7.96875 C 37.05468 8.7109748 36.15429 9.5879269 35.34375 10.59375 C 35.020283 10.995172 34.737782 11.412789 34.46875 11.84375 L 34.46875 7.96875 C 34.468714 7.236359 34.561487 6.6351225 34.78125 6.1875 C 35.00094 5.7399412 35.321252 5.4004232 35.6875 5.15625 C 36.053674 4.9121426 36.442345 4.7458015 36.90625 4.65625 C 37.370079 4.5667653 37.855429 4.5312835 38.34375 4.53125 C 38.473919 4.5312836 38.53121 4.4726898 38.53125 4.375 L 38.53125 3.90625 C 38.53121 3.8737322 38.524374 3.8301125 38.5 3.78125 C 38.475546 3.7324563 38.42509 3.7187845 38.34375 3.71875 L 24.25 3.71875 C 24.136042 3.7187844 24.093724 3.7760761 24.09375 3.90625 L 24.09375 4.375 C 24.093725 4.505242 24.151016 4.5625334 24.28125 4.5625 C 24.753229 4.5950856 25.265924 4.6686531 25.84375 4.75 C 26.421522 4.8314135 27.00225 4.9459966 27.53125 5.125 C 28.060192 5.3040693 28.515595 5.5358398 28.90625 5.8125 C 29.296845 6.0892248 29.512339 6.4219066 29.59375 6.8125 C 29.609995 6.9264635 29.648081 7.0342106 29.65625 7.15625 C 29.664357 7.2783512 29.654917 7.4160462 29.6875 7.5625 L 29.6875 19.25 C 29.687469 19.412779 29.673797 19.513691 29.625 19.5625 C 29.576141 19.611347 29.475229 19.625019 29.3125 19.625 L 10.0625 19.625 C 9.8997286 19.625019 9.7988168 19.611347 9.75 19.5625 C 9.7011611 19.513691 9.6874888 19.41278 9.6875 19.25 L 9.6875 7.96875 C 9.6874892 7.236359 9.7884001 6.6351225 10 6.1875 C 10.211577 5.7399412 10.501941 5.4004232 10.84375 5.15625 C 11.185535 4.9121426 11.575508 4.7458015 12.03125 4.65625 C 12.486966 4.5667653 12.949204 4.5312835 13.4375 4.53125 C 13.567694 4.5312836 13.624985 4.4726898 13.625 4.375 L 13.625 3.90625 C 13.624985 3.8737322 13.618149 3.8301125 13.59375 3.78125 C 13.569321 3.7324563 13.518865 3.7187845 13.4375 3.71875 L 1.1875 3.71875 C 1.0735655 3.7187844 1.0312479 3.7760761 1.03125 3.90625 L 1.03125 4.375 C 1.0312479 4.505242 1.0885395 4.5625334 1.21875 4.5625 C 1.7721325 4.5950856 2.2630175 4.667351 2.71875 4.78125 C 3.1744749 4.8952155 3.5807245 5.0765303 3.90625 5.3125 C 4.2317655 5.5485352 4.477208 5.8444332 4.65625 6.21875 C 4.8352805 6.5931305 4.937494 7.0716455 4.9375 7.625 L 4.9375 33.65625 C 4.937494 34.437504 4.7997988 35.075525 4.53125 35.53125 C 4.26269 35.986981 3.8919221 36.318362 3.46875 36.5625 C 3.0455688 36.806642 2.6064416 36.98926 2.09375 37.0625 C 1.581052 37.135743 1.0670551 37.156252 0.5625 37.15625 C 0.48111821 37.156251 0.43066254 37.169924 0.40625 37.21875 C 0.38183446 37.267579 0.34374854 37.3112 0.34375 37.34375 L 0.34375 37.9375 C 0.34374854 37.970052 0.38183446 38.013673 0.40625 38.0625 C 0.43066254 38.111328 0.48111818 38.125001 0.5625 38.125 L 14.03125 38.125 C 14.112615 38.125 14.171208 38.111329 14.1875 38.0625 C 14.203761 38.013672 14.187484 37.970053 14.1875 37.9375 L 14.1875 37.34375 C 14.187485 37.311199 14.20376 37.26758 14.1875 37.21875 C 14.171209 37.169923 14.097641 37.156252 14 37.15625 C 13.4466 37.156251 12.927069 37.097658 12.40625 37 C 11.885404 36.902345 11.39875 36.759117 11 36.53125 C 10.601225 36.303387 10.306629 35.999352 10.0625 35.625 C 9.8183485 35.250654 9.6874888 34.77214 9.6875 34.21875 L 9.6875 22.34375 C 9.6874892 22.181006 9.7011606 22.080095 9.75 22.03125 C 9.7988172 21.982438 9.8997281 21.937517 10.0625 21.9375 L 29.3125 21.9375 C 29.47523 21.937516 29.576141 21.982439 29.625 22.03125 C 29.673797 22.080094 29.687469 22.181006 29.6875 22.34375 L 29.6875 34 C 29.687469 34.716149 29.463836 35.272465 29 35.6875 C 28.536103 36.102541 27.97165 36.405276 27.3125 36.625 C 26.653293 36.844728 25.981092 36.997398 25.28125 37.0625 C 24.581355 37.127605 23.988256 37.156252 23.5 37.15625 C 23.418595 37.156251 23.368139 37.169924 23.34375 37.21875 C 23.319312 37.267579 23.312475 37.3112 23.3125 37.34375 L 23.3125 37.9375 C 23.312476 37.970052 23.319311 38.013673 23.34375 38.0625 C 23.36814 38.111328 23.418595 38.125001 23.5 38.125 L 39.03125 38.125 C 39.161418 38.125 39.218709 38.067709 39.21875 37.9375 L 39.21875 37.34375 C 39.21871 37.213543 39.161418 37.156252 39.03125 37.15625 C 37.940716 37.123699 37.094037 36.994143 36.5 36.75 C 35.905887 36.505861 35.47913 36.201826 35.21875 35.84375 C 34.958297 35.518232 34.778284 35.177413 34.65625 34.84375 C 34.534144 34.510095 34.468714 34.141932 34.46875 33.71875 L 34.46875 14.78125 C 34.700722 14.362675 34.992358 13.862603 35.40625 13.21875 C 35.845697 12.53519 36.410149 11.873081 37.09375 11.21875 C 37.777335 10.564489 38.605459 10.000036 39.5625 9.53125 C 40.51952 9.0625369 41.617175 8.812537 42.90625 8.8125 C 43.648423 8.8125372 44.380844 8.9570681 45.09375 9.25 C 45.806624 9.5430052 46.443342 9.939489 47 10.4375 C 47.556623 10.935582 48.001934 11.501987 48.34375 12.15625 C 48.685528 12.81058 48.87498 13.527376 48.875 14.25 C 48.874981 15.304718 48.669902 16.269562 48.25 17.1875 C 47.83006 18.105497 47.289044 18.970731 46.625 19.78125 C 45.960921 20.591822 45.195296 21.361354 44.375 22.09375 C 43.554673 22.826195 42.738268 23.523461 41.9375 24.1875 C 41.859363 24.265647 41.738269 24.394554 41.5625 24.53125 C 41.386707 24.66799 41.207019 24.791038 41.03125 24.9375 C 40.855457 25.084005 40.720691 25.216818 40.59375 25.34375 C 40.466786 25.470724 40.406239 25.578146 40.40625 25.65625 C 40.406239 25.81252 40.45702 25.968771 40.59375 26.125 C 40.730457 26.28127 40.882801 26.37502 41 26.375 C 41.058582 26.37502 41.085925 26.339864 41.125 26.28125 C 41.320301 26.027364 41.585925 25.789084 41.9375 25.59375 C 42.28905 25.398458 42.681627 25.251975 43.0625 25.125 C 43.443345 24.998068 43.804673 24.902366 44.15625 24.84375 C 44.507797 24.785177 44.796859 24.750022 45.03125 24.75 C 45.890609 24.750021 46.744123 24.927756 47.59375 25.25 C 48.44334 25.572286 49.201152 26.056661 49.875 26.75 C 50.548807 27.443378 51.111306 28.365253 51.53125 29.46875 C 51.951149 30.572281 52.156227 31.894546 52.15625 33.4375 C 52.156227 34.707043 51.943336 35.984386 51.5625 37.3125 C 51.181619 38.640632 50.648416 39.865241 49.90625 40.96875 C 49.164043 42.07227 48.240215 43.007816 47.15625 43.75 C 46.072249 44.492189 44.824203 44.890627 43.4375 44.96875 C 42.636706 44.968751 41.890612 44.837893 41.1875 44.59375 C 40.484364 44.349611 39.833974 44.070315 39.21875 43.71875 C 38.603506 43.36719 38.00585 42.97266 37.46875 42.5625 C 36.931633 42.152348 36.449211 41.789068 36 41.4375 C 35.550775 41.085942 35.152338 40.765631 34.78125 40.53125 C 34.410151 40.296881 34.085932 40.187507 33.8125 40.1875 C 33.187496 40.187506 32.623043 40.332038 32.125 40.625 C 31.626951 40.917974 31.374998 41.433599 31.375 42.15625 C 31.57031 42.839847 31.873044 43.417972 32.3125 43.90625 C 32.75195 44.394533 33.300777 44.814455 33.90625 45.15625 C 34.511714 45.498047 35.162103 45.785157 35.875 46 C 36.587884 46.214844 37.308585 46.382813 38.03125 46.5 C 38.753897 46.617187 39.46288 46.679688 40.15625 46.71875 C 40.849598 46.757812 41.464831 46.78125 42.03125 46.78125 C 43.066393 46.781249 44.169907 46.613281 45.3125 46.28125 C 46.455061 45.949219 47.562481 45.468751 48.65625 44.84375 C 49.74998 44.218752 50.785134 43.47266 51.78125 42.59375 C 52.77732 41.714848 53.654272 40.74024 54.40625 39.65625 C 54.746745 39.165393 55.065321 38.651905 55.34375 38.125 C 55.370199 38.141276 55.396809 38.125 55.4375 38.125 L 70.4375 38.125 C 70.518864 38.125 70.569319 38.111329 70.59375 38.0625 C 70.618148 38.013672 70.656233 37.970053 70.65625 37.9375 L 70.65625 37.34375 C 70.656234 37.311199 70.641259 37.26758 70.625 37.21875 C 70.608708 37.169923 70.535139 37.156252 70.4375 37.15625 C 70.290999 37.156251 70.117822 37.157554 69.90625 37.125 C 69.694646 37.092449 69.500961 37.040692 69.28125 37 C 69.061509 36.959311 68.843409 36.938804 68.65625 36.90625 C 68.469061 36.873699 68.316392 36.828778 68.21875 36.8125 C 67.600247 36.731121 67.087552 36.615237 66.65625 36.46875 C 66.224923 36.322267 65.862293 36.142255 65.59375 35.90625 C 65.325184 35.67025 65.145171 35.388024 65.03125 35.0625 C 64.917307 34.736983 64.843739 34.345708 64.84375 33.90625 L 64.84375 22.65625 C 64.843739 22.558609 64.858713 22.501319 64.875 22.46875 C 64.891265 22.436214 64.919911 22.407569 64.96875 22.375 C 65.017567 22.342464 65.104806 22.312517 65.21875 22.3125 C 65.332671 22.312516 65.389962 22.312517 65.40625 22.3125 L 71.1875 22.59375 C 71.220035 22.610042 71.263654 22.638688 71.3125 22.6875 L 77.5625 32.5 C 78.034481 33.264979 78.49672 33.952153 78.96875 34.5625 C 79.44073 35.172855 79.94789 35.715498 80.46875 36.1875 C 81.542941 37.147787 82.65557 37.813152 83.84375 38.1875 C 85.03187 38.561849 86.335254 38.75 87.71875 38.75 C 87.995409 38.749999 88.182257 38.70638 88.3125 38.625 C 88.442674 38.543619 88.531215 38.369141 88.53125 38.125 C 88.531216 38.04362 88.493129 37.994467 88.46875 37.9375 C 88.444302 37.880534 88.380174 37.813803 88.25 37.78125 C 87.175748 37.358074 86.191374 36.764976 85.3125 36 C 84.433563 35.235029 83.68096 34.337895 83.0625 33.3125 L 75.6875 21.25 C 76.517556 20.875668 77.260719 20.440774 77.96875 19.96875 C 78.676733 19.496763 79.299779 18.96226 79.8125 18.34375 C 80.325169 17.725281 80.738254 17.00816 81.03125 16.21875 C 81.324192 15.429385 81.468722 14.540388 81.46875 13.53125 C 81.468723 12.11526 81.185194 10.798204 80.65625 9.59375 C 80.127253 8.3893527 79.419571 7.332713 78.5 6.4375 C 77.58038 5.5423503 76.486956 4.8496425 75.25 4.3125 C 74.013001 3.775425 72.712221 3.441441 71.3125 3.34375 L 68.84375 3.34375 z M 167.375 3.40625 C 166.27636 3.4062847 165.25651 3.4362327 164.3125 3.46875 L 156.5 3.625 L 155.9375 3.625 C 155.83984 3.6250345 155.79753 3.6618184 155.78125 3.71875 C 155.76497 3.7757505 155.75001 3.8275084 155.75 3.84375 L 155.75 4.53125 C 155.75 4.5475596 155.76498 4.5680673 155.78125 4.625 C 155.79752 4.6819996 155.83985 4.7187833 155.9375 4.71875 L 157.5 4.71875 C 157.85807 4.7187834 158.24935 4.777377 158.65625 4.875 C 159.06315 4.9726894 159.44759 5.1240563 159.78125 5.34375 C 160.1149 5.5635091 160.37402 5.8375973 160.59375 6.1875 C 160.81347 6.5374665 160.9375 6.9642237 160.9375 7.46875 L 160.9375 34.21875 C 160.93749 34.886071 160.77116 35.430017 160.4375 35.8125 C 160.10384 36.194989 159.69076 36.469078 159.21875 36.65625 C 158.74674 36.843426 158.25456 36.959312 157.75 37 C 157.24544 37.040691 156.8418 37.062502 156.5 37.0625 L 155.9375 37.0625 C 155.83984 37.062501 155.79753 37.099286 155.78125 37.15625 C 155.76497 37.213217 155.75001 37.233726 155.75 37.25 L 155.75 37.9375 C 155.75 37.953776 155.76498 38.005535 155.78125 38.0625 C 155.79752 38.119466 155.83985 38.125001 155.9375 38.125 L 173.75 38.125 C 175.44269 38.125 177.07616 37.930014 178.6875 37.53125 C 180.2988 37.132488 181.84894 36.584312 183.28125 35.84375 C 184.71351 35.103193 186.02244 34.191085 187.21875 33.125 C 188.41501 32.058925 189.4417 30.857755 190.3125 29.53125 C 191.18323 28.204763 191.85544 26.75815 192.34375 25.1875 C 192.83199 23.616877 193.09372 21.94533 193.09375 20.1875 C 193.09371 18.364603 192.76787 16.585308 192.125 14.84375 C 191.48206 13.102239 190.59991 11.526068 189.46875 10.09375 C 188.33753 8.6614878 186.99184 7.4466452 185.4375 6.4375 C 183.88311 5.4284181 182.18162 4.7181322 180.375 4.34375 C 179.43096 4.1484715 178.57746 3.9889665 177.8125 3.875 C 177.0475 3.7611021 176.31118 3.6670268 175.5625 3.59375 C 174.81378 3.5205424 174.03254 3.4931988 173.21875 3.46875 C 172.40493 3.4443706 171.46288 3.4062848 170.4375 3.40625 C 169.49347 3.4062847 168.47363 3.4062848 167.375 3.40625 z M 103.59375 3.71875 C 103.52863 3.7187844 103.49998 3.7624043 103.5 3.84375 C 103.49999 3.9251644 103.56672 4.0478855 103.65625 4.21875 C 103.74575 4.3896822 103.78123 4.5423512 103.78125 4.65625 C 103.78124 4.6888355 103.75812 4.7174812 103.75 4.75 L 93.78125 33.59375 C 93.504553 34.407556 93.156896 35.036137 92.75 35.5 C 92.343095 35.963869 91.931312 36.3265 91.5 36.5625 C 91.068683 36.798504 90.665037 36.95801 90.25 37.03125 C 89.83496 37.104493 89.465494 37.139976 89.15625 37.15625 C 89.026041 37.156251 88.968749 37.213543 88.96875 37.34375 L 88.96875 37.9375 C 88.96875 38.067708 89.026041 38.125001 89.15625 38.125 L 101.625 38.125 C 101.70637 38.125 101.75682 38.111329 101.78125 38.0625 C 101.80565 38.013672 101.81249 37.970053 101.8125 37.9375 L 101.8125 37.34375 C 101.81249 37.311199 101.80565 37.26758 101.78125 37.21875 C 101.75682 37.169923 101.70637 37.156252 101.625 37.15625 L 101 37.15625 C 100.62564 37.156251 100.19888 37.127606 99.71875 37.0625 C 99.238596 36.997397 98.768219 36.873374 98.3125 36.71875 C 97.856762 36.564129 97.443676 36.362307 97.09375 36.09375 C 96.743807 35.825198 96.5052 35.500655 96.375 35.09375 C 96.34244 35.012373 96.343742 34.940108 96.34375 34.875 C 96.343743 34.809899 96.343742 34.737634 96.34375 34.65625 L 100 23.9375 C 99.999989 23.921238 100.00552 23.832697 100.0625 23.71875 C 100.11945 23.604832 100.21483 23.520198 100.3125 23.40625 C 100.41014 23.292333 100.541 23.160172 100.6875 23.0625 C 100.83397 22.964859 101.00715 22.937516 101.21875 22.9375 L 109.875 22.9375 C 110.07029 22.937515 110.23663 22.96486 110.375 23.0625 C 110.51332 23.160171 110.62921 23.284195 110.71875 23.40625 C 110.80825 23.528335 110.86554 23.636083 110.90625 23.75 C 110.94692 23.863947 110.9837 23.936213 111 23.96875 L 114.6875 34.375 C 114.72003 34.505212 114.74997 34.621098 114.75 34.71875 C 114.74997 35.125654 114.61781 35.473311 114.40625 35.75 C 114.19464 36.026695 113.9505 36.235354 113.625 36.40625 C 113.29945 36.57715 112.92999 36.722984 112.53125 36.8125 C 112.13246 36.902019 111.73435 36.959312 111.34375 37 C 110.9531 37.040691 110.58364 37.077476 110.25 37.09375 C 109.91632 37.110027 109.67902 37.108726 109.5 37.125 C 109.46743 37.125001 109.40883 37.148114 109.34375 37.15625 C 109.27863 37.164389 109.22133 37.156252 109.15625 37.15625 C 109.07485 37.156251 109.02439 37.169924 109 37.21875 C 108.97557 37.267579 108.93748 37.3112 108.9375 37.34375 L 108.9375 37.9375 C 108.93748 37.970052 108.97557 38.013673 109 38.0625 C 109.02439 38.111328 109.07485 38.125001 109.15625 38.125 L 124.09375 38.125 C 124.17509 38.125 124.22555 38.111329 124.25 38.0625 C 124.27438 38.013672 124.28121 37.970053 124.28125 37.9375 L 124.28125 37.375 C 124.28121 37.326173 124.27438 37.26758 124.25 37.21875 C 124.22555 37.169923 124.17509 37.156252 124.09375 37.15625 C 123.73564 37.156251 123.35934 37.09896 122.96875 36.96875 C 122.57809 36.838543 122.25908 36.707685 122.03125 36.59375 C 121.51038 36.382163 121.10544 36.158531 120.8125 35.90625 C 120.5195 35.653974 120.27275 35.36361 120.09375 35.0625 C 119.91468 34.761397 119.76331 34.451827 119.625 34.09375 C 119.48662 33.735681 119.32158 33.314459 119.09375 32.875 L 108.75 3.90625 C 108.71743 3.8249041 108.68195 3.7663105 108.625 3.75 C 108.56801 3.7337583 108.53253 3.7350606 108.5 3.71875 L 103.59375 3.71875 z M 125.78125 3.71875 C 125.7548 3.730957 125.73096 3.7568532 125.71875 3.78125 C 125.69433 3.8301124 125.6875 3.8737323 125.6875 3.90625 L 125.6875 4.5 C 125.6875 4.5163097 125.69433 4.5368173 125.71875 4.59375 C 125.74316 4.6507496 125.79362 4.6875333 125.875 4.6875 L 126.40625 4.6875 C 126.73177 4.6875334 127.1735 4.7311531 127.71875 4.8125 C 128.26399 4.8939135 128.78353 5.0303064 129.3125 5.25 C 129.84147 5.4697592 130.30501 5.7819333 130.6875 6.15625 C 131.06998 6.5306306 131.25 7.0078435 131.25 7.59375 L 131.25 33.4375 C 131.24999 34.07227 131.12044 34.643559 130.84375 35.15625 C 130.56705 35.668948 130.16341 36.080732 129.59375 36.40625 C 129.33333 36.552736 128.99935 36.683596 128.625 36.78125 C 128.25065 36.878908 127.88118 36.943036 127.53125 37 C 127.18131 37.056967 126.89355 37.100588 126.625 37.125 C 126.35644 37.149415 126.17383 37.156252 126.125 37.15625 L 125.5625 37.15625 C 125.46484 37.156251 125.39127 37.169924 125.375 37.21875 C 125.35872 37.267579 125.34375 37.3112 125.34375 37.34375 L 125.34375 37.9375 C 125.34375 37.970052 125.38183 38.013673 125.40625 38.0625 C 125.43066 38.111328 125.48112 38.125001 125.5625 38.125 L 150.1875 38.125 C 150.30141 38.125 150.38735 38.081381 150.46875 38 C 150.5501 37.91862 150.62238 37.817709 150.6875 37.6875 L 154.375 30.46875 C 154.4238 30.371102 154.46873 30.285165 154.46875 30.1875 C 154.46872 29.97592 154.38149 29.875009 154.21875 29.875 C 154.13734 29.875008 154.04197 29.888681 153.96875 29.9375 C 153.89548 29.986336 153.83136 30.044931 153.75 30.09375 C 153.57093 30.240242 153.36912 30.47885 153.125 30.8125 C 152.88083 31.146166 152.59047 31.51433 152.28125 31.9375 C 151.97198 32.360683 151.62433 32.794277 151.25 33.25 C 150.87562 33.705734 150.47068 34.117518 150.03125 34.5 C 149.59177 34.88249 149.13768 35.193363 148.625 35.4375 C 148.11228 35.681643 147.56965 35.812503 147 35.8125 L 137.34375 35.8125 C 137.01822 35.812502 136.72916 35.681644 136.46875 35.4375 C 136.20832 35.193362 136.0638 34.932947 136.03125 34.65625 L 136.03125 7.59375 C 136.03124 6.8613594 136.0817 6.3323884 136.1875 6.03125 C 136.29328 5.7301756 136.5319 5.5364908 136.90625 5.40625 C 137.39452 5.2272465 138.03124 5.0527673 138.8125 4.90625 C 139.59373 4.759799 140.43228 4.6875333 141.34375 4.6875 L 142.40625 4.6875 C 142.48761 4.6875334 142.53807 4.6738615 142.5625 4.625 C 142.5869 4.5762054 142.59374 4.5325856 142.59375 4.5 L 142.59375 3.90625 C 142.59373 3.8737322 142.5869 3.8301125 142.5625 3.78125 C 142.53807 3.7324563 142.48762 3.7187845 142.40625 3.71875 L 125.875 3.71875 C 125.83431 3.7187672 125.8077 3.706543 125.78125 3.71875 z M 166.3125 4.5625 L 172.9375 4.5625 C 175.2324 4.5625336 177.31704 4.9824549 179.15625 5.8125 C 180.99542 6.6426096 182.54978 7.7783505 183.84375 9.21875 C 185.13766 10.659207 186.14386 12.367539 186.84375 14.3125 C 187.54359 16.257509 187.87497 18.347677 187.875 20.59375 C 187.87497 23.149104 187.4837 25.442396 186.71875 27.46875 C 185.95374 29.495126 184.87791 31.208992 183.4375 32.625 C 181.99704 34.04102 180.2464 35.126306 178.1875 35.875 C 176.12856 36.623699 173.79165 37.000002 171.1875 37 C 170.45506 37.000001 169.76106 36.985028 169.09375 36.96875 C 168.42642 36.952475 167.84016 36.872072 167.34375 36.75 C 166.84732 36.627931 166.45735 36.447919 166.15625 36.1875 C 165.85513 35.927086 165.6875 35.565759 165.6875 35.09375 L 165.6875 5.21875 C 165.68749 4.9909186 165.73112 4.8245774 165.8125 4.71875 C 165.89387 4.6129892 166.06836 4.5625334 166.3125 4.5625 z M 67.4375 4.59375 C 67.632799 4.5856455 67.834621 4.5937834 68.0625 4.59375 C 69.266912 4.5937835 70.395817 4.7900723 71.4375 5.15625 C 72.479148 5.5224936 73.360006 6.0420241 74.125 6.75 C 74.889953 7.4580385 75.498025 8.333363 75.9375 9.375 C 76.376931 10.416694 76.593727 11.602891 76.59375 12.9375 C 76.593728 14.223331 76.457334 15.372745 76.15625 16.40625 C 75.855122 17.439799 75.34796 18.315125 74.65625 19.03125 C 73.964498 19.747414 73.05239 20.328144 71.9375 20.71875 C 70.822574 21.109392 69.486312 21.281268 67.875 21.28125 C 67.61457 21.281267 67.331041 21.297544 67.0625 21.28125 C 66.793933 21.264991 66.540352 21.235044 66.3125 21.21875 C 66.084623 21.202491 65.889636 21.172544 65.71875 21.15625 C 65.54784 21.139991 65.440092 21.156268 65.375 21.15625 C 65.195953 21.139991 65.088205 21.074562 65.03125 20.96875 C 64.974273 20.862973 64.922515 20.723977 64.90625 20.59375 L 64.84375 19.875 L 64.84375 5.09375 C 64.843739 4.9147468 64.939116 4.7907233 65.09375 4.75 C 65.248361 4.7093433 65.371082 4.6875333 65.46875 4.6875 C 65.745431 4.6712574 65.999011 4.6644214 66.21875 4.65625 C 66.438464 4.6481455 66.648425 4.6331714 66.84375 4.625 C 67.03905 4.6168955 67.242174 4.6019214 67.4375 4.59375 z M 105.375 8.75 C 105.45636 8.7500294 105.58722 8.9668259 105.75 9.40625 L 109.375 19.40625 C 109.40753 19.487649 109.45245 19.559915 109.46875 19.625 C 109.48501 19.690123 109.49998 19.762389 109.5 19.84375 C 109.49998 19.941424 109.4632 20.020527 109.40625 20.09375 C 109.34926 20.16701 109.24152 20.218769 109.0625 20.21875 L 101.84375 20.21875 C 101.69725 20.218768 101.61131 20.181985 101.5625 20.125 C 101.51366 20.068052 101.46874 20.003925 101.46875 19.90625 C 101.46874 19.824888 101.48371 19.737649 101.5 19.65625 C 101.51626 19.574888 101.52993 19.48765 101.5625 19.40625 L 105 9.4375 C 105.08136 9.2259404 105.13866 9.0595993 105.1875 8.9375 C 105.23631 8.815459 105.2936 8.7500293 105.375 8.75 z " + transform="translate(87.179131,151.72462)" + id="text2816" /&gt; + &lt;/g&gt; +&lt;/svg&gt; +</pre></body></html>
M lib/data.glyphlib/data.glyph

@@ -1,5 +1,4 @@

&:[G|Glyph] -rw:[nanoc.item|%[puts Glyph\['nanoc.item'\]\["{{0}}"\]]] rw:[h3rald.article| article[ @pubdate[$[document.date]]

@@ -21,7 +20,7 @@ }

</style> ] @pre-title[ - =>[http://www.h3rald.com/archives/|image[@width[25%]@height[25%]$[site.root]/images/theme/h3rald.svg]] + =>[http://www.h3rald.com/archives/|image[@width[25%]@height[25%]$[site.root]/images/logo.svg]] ] @post-title[ div[em[Originally published on =>[http://www.h3rald.com{{identifier}}|H3RALD.com]]]
D lib/glyph.data

@@ -1,35 +0,0 @@

-Glyph['document.intro'] = RedCloth.new("#{@item[:intro]}\n\n#{@item[:extended_intro]}").to_html -Glyph['document.date'] = @item[:date].strftime "%A, %d %B %Y" -Glyph['document.title'] = @item[:title] -Glyph['document.subtitle'] = @item[:subtitle] -Glyph['document.author'] = "Fabio Cevasco" -Glyph['output.pdf.generator'] = "prince" -Glyph.rewrite "h3rald.article", %{article[ - @pubdate[$[document.date]] - @head[ - style[default.css] - style[pagination.css] - <style> - h1 { - font-size: 24px; - margin: 0.5em auto; - padding: 0.5em auto; - } - .contents { - text-align:justify; - margin-bottom: 2em; - padding-bottom: 2em; - border-bottom: 1px solid #000; - } - </style> - ] - @pre-title[ - =>[http://www.h3rald.com/archives/|image[@width[25%]@height[25%]$[site.root]/images/theme/h3rald.svg]] - ] - @post-title[ - div[em[Originally published on =>[http://www.h3rald.com{{identifier}}|H3RALD.com]]] - toc[] - ] - {{content}} - ] -]}
A lib/glyph_context.rb

@@ -0,0 +1,45 @@

+class Nanoc3::RuleContext + + require 'glyph' + + def glyph_config(item) + Glyph['document.intro'] = RedCloth.new("#{item[:intro]}\n\n#{item[:extended_intro]}").to_html + Glyph['document.date'] = item[:date].strftime "%A, %d %B %Y" + Glyph['document.title'] = item[:title] + Glyph['document.subtitle'] = item[:subtitle] + Glyph['document.author'] = "Fabio Cevasco" + Glyph['site.root'] = "" + Glyph.filter Glyph.file_load("#{Dir.pwd}/lib/data.glyph") + end + + def glyph_pdf_for(item) + Glyph['output.pdf.generator'] = "prince" + Glyph['document.output'] = 'pdf' + Glyph['site.root'] = ".." + f = Pathname.new "#{Dir.pwd}/output#{item.identifier.gsub(/\/$/, '')}.glyph" + f.parent.mkpath + doc = %{ + h3rald.article[ + @identifier[#{item.identifier}] + @content[section[#{item.raw_content}]] + ] + } + # Write the new raw file using Glyph's file_write method + Glyph.file_write f, doc + # Now compile the PDF (works if Prince is installed) + Glyph.compile f.to_s + begin + f.unlink + Pathname.new(f.to_s.gsub(/\.glyph$/, '.html')).unlink + rescue + end + end + + def glyph_article_for(item) + Glyph['document.output'] = 'html5' + filter :glyph + layout 'default' + Glyph.reset + end + +end