all repos — h3rald @ 5b5b3f89b3ee193fc26acd066817b92d434044af

The sources of https://h3rald.com

Releasing Glyph 0.2.0.
h3rald h3rald@h3rald.com
Sun, 09 May 2010 18:01:07 +0200
commit

5b5b3f89b3ee193fc26acd066817b92d434044af

parent

6f084e78f6a1cbccf078e4878f84be4f532973e9

M RulesRules

@@ -55,7 +55,7 @@ doc = %{

document[ head[ style[default.css] - style[css3.css] + style[pagination.css] <style> h1 { font-size: 24px;

@@ -95,7 +95,7 @@ Glyph['site.root'] = ".."

Glyph['document.date'] = item[:date].strftime "%A, %d %B %Y" Glyph['document.title'] = item[:title] Glyph['document.subtitle'] = "" - Glyph.compile f.to_s, f.to_s.gsub(/\.glyph$/, '.pdf') + Glyph.compile f.to_s begin f.unlink Pathname.new(f.to_s.gsub(/\.glyph$/, '.html')).unlink
A content/articles/glyph-020-released.glyph

@@ -0,0 +1,84 @@

+----- +:type: article +:tags: +- glyph +- ruby +- opensource +:permalink: glyph-020-released +:title: "Glyph 0.2.0 Released" +:summary: "The second release of Glyph is out! Featuring single-file compilation, programmatic usage and auto-regeneration, as well as plenty of bugfixes and stability improvements." +:toc: true +:pdf: true +:date: 2010-05-09 17:00:00.099000 +02:00 +----- +&:[G|Glyph] +textile[ +I am very pleased to announce the second release of the =>[$[site.root]/glyph/|&[G] Document Authoring Framework]. For those who don't know, &[G] is a pure-Ruby, extensible solution to author documents like books or articles using a simple, fully-customizable markup language. + +Since the =>[$[site.root]/articles/introducing-glyph/|first release], came out, last month, a lot happened. Plenty of bugs were fixed and new features implemented, as shown by the =>[http://github.com/h3rald/glyph/blob/master/CHANGELOG.textile|changelog]. Here's a brief rundown of the most notable changes. + + section[header[What &[G] code looks like] +Earlier this week I =>[http://blog.h3rald.com/making-a-custom-vim-syntax-file|blogged] about my new =>[http://github.com/h3rald/stash/blob/master/.vim/syntax/glyph.vim|&[G] vim syntax file]. I've been using it for a while, and all I can say is that it really helps! Here's what it looks like: + +!\.$[site.root]/img/pictures/glyph_syntax.png! + +I'm sorry for the Emacs and TextMate folks, but I only use Vim, so I only made a Vim syntax file. Anyhow, &[G] grammar is very simple, so rolling out your own syntax file for your favorite editor shouldn't be too hard. + ] + + section[header[Notable features] + + section[header[Single-file compilation] +Perhaps the most life-changing feature in this release is the possibility of compiling a single &[G] source file into an HTML or PDF file. This means you no longer need to create a full-blown project for writing a short article: just create a file anywhere and run @glyph compile filename.glyph@on it! + +The good thing is that with this new release you can also define snippets, configuration settings, and even macros right into your &[G] files, so you can do almost anything without having to create a project or fiddle with YAML files. + ] + + section[header[Programmatic usage] +The second most notable feature is the possibility to use &[G] as a Ruby library, i.e. as you'd use a filter like RedCloth or MarkDown. Additionally, it is also possible to compile single files programmatically, so you can, for example, create PDF files for your articles from the same source file. Don't believe me? Feel free to click the _Download PDF_ and _View Source_ links on this very page to see for yourself... + +For those of you using the awesome =>[http://nanoc.stoneship.org|nanoc] static site generator, here's a few source files you may want to take a look at: +* =>[http://github.com/h3rald/h3rald/blob/master/lib/glyph-data.rb|lib/glyph-data.rb] -- How to update configuration settings. +* =>[http://github.com/h3rald/h3rald/blob/master/lib/glyph-filter.rb|lib/glyph-data.rb] -- a simple &[G] filter. +* =>[http://github.com/h3rald/h3rald/blob/master/Rules|Rules] -- a rule using the @\.&[G]#compile@ method to generate PDF files. + ] + + section[header[Auto-regeneration] +Another very interesting feature is the possibility to auto-regenerate your output files automatically whenever a source file is changed. Just run @glyph compile --auto@ and you're away. I'd like to thank =>[http://koraktor.github.com|Sebastian Staudt] for proposing, implementing, and testing this feature. + ] + + section[header[Conditional macros] +Finally, although it may worry some, I added the possibility to evaluate conditional expressions directly in Glyph. The syntax is a bit verbose due to the extreme simplicity of &[G] parser, but it does the job: + +code[= +?[and[ + eq[$[document.output]\|pdf]\| + eq[$[tools.pdf_generator]\|prince] + ]\| + style[pagination.css]] +=] + +The snippet above can be used to include the @pagination.css@ stylesheet only when generating a PDF file with Prince XML. + ] + ] + + section[header[What's next?] +Release 0.3.0 is currently being planned, and so are its =>[http://github.com/h3rald/glyph/issues|features]. For now, I'd like to thank the following individuals for contributing to Glyph: +* =>[http://www.jabbslad.com|Jamie Atkinson] (Jabbslad), for spotting and fixing some bugs and providing feedback. +* =>[http://koraktor.github.com|Sebastian Staudt] (koraktor), for spotting and fixing some bugs, proposing and implementing new features. + +In particular, Sebastian is working on =>[http://wiki.github.com/h3rald/glyph/feature-bibliography-support|bibliogaphy support] for Glyph, looking forward to it! + +Although still in its infancy, Glyph is becoming more and more usable everyday. If you are interested, you can contribute in many different ways to the project, such as: +* By participating to discussions on the =>[http://groups.google.com/group/glyph-framework|user group] (it's a bit quiet of there for now...) +* By spreading the word on Twitter, on your blog, or wherever you like. +* By installing it, using it, reporting bugs and proposing new features (it's just a @gem install glyph@ away!). +* By actually contributing to its development (it's =>[http://wiki.github.com/h3rald/glyph/contribution-guidelines|easy]!). + +Additionally, if you don't like coding: +* feedback on the current documentation and on the =>[http://github.com/h3rald/glyph/raw/master/book/output/pdf/glyph.pdf|Glyph book] is appreciated +* if you are good with CSS, I'm looking for some nice new CSS styles to include in the standard Glyph distribution. +* if you're good with graphics, Glyph needs a good-looking logo... + +Any form of contribution will be credited in some way, e.g. by links and tweets. + ] +]
M content/articles/succeeding-with-agile-review.glyphcontent/articles/succeeding-with-agile-review.glyph

@@ -31,7 +31,7 @@ #{contents}

]} =] --[-----------------------------------] - +textile[ bq. "This is not a book for those who are completely new to &[S] or &[ag]. There are other books, classes, and even websites for that. If you are completely new to &[S], start with one of those." p(((((. -- &[author], &[book]

@@ -108,7 +108,4 @@ What's wrong with it then? Not much. Perhaps the only thing I really missed was an introductory 50-page-chapter on &[S] and &[ag]. I know this is not meant to be a book for beginners, but some basic glossary or &[S] cheat sheet would have made it accessible to an even wider audience, at virtually no cost for the author or the readers, who could have just skipped that part.

Anyhow, I give it a 9 out of 10. ] - - - - +]
M lib/glyph_filter.rblib/glyph_filter.rb

@@ -6,10 +6,8 @@ identifier :glyph

def run(content, args) doc = %{ - textile[ - section[ - #{content} - ] + section[ +#{content} ]} Glyph.filter doc end