all repos — h3rald @ 9504a69adcee918506f2e81007520b76e07505bc

The sources of https://h3rald.com

content/articles/glyph-020-released.glyph

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 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[@title[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:

image[\.$[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[@title[Notable features]

		section[@title[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[@title[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[@title[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[@title[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[@title[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.
	]
]