Permalink
Browse files

Released Glyph 0.5.0.

  • Loading branch information...
1 parent 3177bff commit 8354f51dd1763cbb13aaeb255cfc257e85f55e60 @h3rald committed Aug 28, 2011
@@ -0,0 +1,116 @@
+-----
+:type: article
+:tags:
+- glyph
+- ruby
+- opensource
+:permalink: glyph-050-released
+:title: "Glyph 0.5.0 Released"
+:subtitle: Featuring Calibre integration, macro composition, Turing-completeness, and more
+:pdf: false
+:date: 2011-08-28 21:18:00.000000 +02:00
+:intro: |
+ Too much time passed since the last Glyph release. Way too much. Finally I found the time and will to tidy up the last few remaining bugs, update the docs, and release it!
+:extended_intro: |
+ This new release was mainly focused on extending the features of Glyph as a _language_. Besides a few improvements that make writing Glyph code easier and more readable (e.g. macro composition), Glyph is now Turing-complete. It supports iterations, recursion, variable assignments, basic arithmetics... you can even write a program to compute the factorial of an integer, if you wanted to.
+
+ Additionally, it also features enhanced content reuse through fragments and output-independent macros, and a few bugfixes.
+-----
+$[document.intro]
+
+§[
+ @title[Calibre Integration]
+ txt[
+=>[https://github.com/tammycravit|Tammy Cravit] proposed (and more or less implemented) an interesting new feature: integrate =>[http://calibre-ebook.com/|Calibre] to generate ebooks in EPUB and MOBI format from Glyph's native standalone HTML output format.
+
+Although the support is still somewhat rough, you can, as a matter of fact, generate ebooks with Glyph, using Calibre.
+ ]
+]
+§[
+ @title[Macro Composition]
+ txt[
+This release features an update at syntax-level: the possibility of "composing" macros, thereby eliminating nesting provided that containers take only one parameter and no attributes. What? This:
+ ]
+ highlight[=html|
+?[
+ not[output?[pdf]]\|
+ ...
+]
+ =]
+
+p[Can be written like this:]
+
+ highlight[=html|
+?[
+ not/output?[pdf]\|
+ ...
+]
+ =]
+
+txt[
+In this case, the @not@ macro was composed with the @output?@ macro, thus removing one level of nesting.
+
+Additionally, I used this features to create an @xml@ macro dispatcher that can be used to render raw XML tags, and an @s@ macro dispatcher that basically is able to call nearly all the instance methods of the Ruby String class. So you can write things like code[=s/sub[This feature makes my life easier\|/my/\|your]=] and similar.
+ ]
+]
+§[
+ @title[Turing-Completeness]
+ txt[
+As of this version, Glyph can be considered _Turing-complete_, as it satisfies the following =>[http://c2.com/cgi/wiki?LanguageRequirementsForTuringCompleteness|requirements for Turing-completeness]:
+* A conditional construct, implemented via the @condition@ macro.
+* Variable assignment, by setting the value of snippets using the @snippet:@ macro and of attributes using the @attribute:@ macro.
+* (infinite) iteration implemented through the new @while@ macro or recursion, which is possible thanks to the new @define:@ macro.
+* A memory model which emulates an infinite store: there are no enforced limits on attribute/snippets allocations and number of algorithms or parameters.
+
+Plus, Glyph now understand basic integer arithmetic:
+ ]
+ highlight[=html|
+def:[factorial\|
+ ?[
+ eq[{{0}}\|0]\|1\|
+ multiply[
+ {{0}} \| factorial[subtract[{{0}}\|1]]
+ ]
+ ]
+]
+ =]
+ txt[
+Not that you _need_ to be able to calculate factorials in your documents, but know that now you _can_. An you can also define lexically scoped variables, err... _attributes_, like this:
+ ]
+ highlight[=html|
+let[
+ @:[a\|bits]
+ @:[b\|bobs]
+ section[
+ @title[Something more about attributes]
+Attributes are like lexically scoped variables. You can use them to store @[a] and @[b].
+ ]
+]
+ =]
+ p[Handy enough.]
+]
+§[
+ @title[Embeddable fragments]
+ txt[
+Too lazy to create snippets? Feel the urge to re-use something you already wrote somewhere? Use a _fragment_ and embed it, as follows:
+ ]
+ highlight[=html|
+Snippets and fragments ##[good_way\|are a good way to reuse] small chunks of content,
+while the include and load macros <=[good_way] entire files.
+ =]
+ txt[...And you can also use a new @load@ macro, to embed entire files without performing any evaluation (like @include@ does).]
+]
+§txt[
+ @title[Incompatibilities with previous versions]
+To sum up:
+* @snippets.yml@ is no more, define all your snippets inside your document instead.
+* New "invisible space separator": @\\/@ instead of @\\.@. Because it's slightly prettier, nothing else.
+* The @rewrite:@ macro has been replaced by the @define:@ macro, which also allows recursion, so be careful!
+* If you want to render raw XML tags, use @xml/tag_name@ instead of @=tag_name@.
+* No more @match@ macro, use @s/match@ instead.
+
+For the full list of the issues fixed in this release, see the =>[http://localhost:8080/glyph/book/changelog.html|Changelog].
+
+Hope you'll enjoy this new release of Glyph. If you want to contribute, go ahead and =>[https://github.com/h3rald/glyph|fork the repo]!
+]
+
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,254 @@
+* {
+ font-family: inherit;
+ border: none;
+ font-size: 100%;
+ font-style: inherit;
+ margin: 0;
+ padding: 0; }
+
+html {
+ background: #fff; }
+
+ol, ul {
+ margin: 0.3em 0; }
+
+p {
+ margin: 1em 0; }
+
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+ margin: auto;
+ margin-top: 1em; }
+
+body {
+ line-height: 1.2em;
+ margin: 0;
+ padding: 0;
+ padding: 0 1em;
+ text-align: justify; }
+
+/* Structure */
+.halftitlepage {
+ margin: auto;
+ text-align: center; }
+
+.titlepage {
+ margin: auto;
+ text-align: center; }
+ .titlepage h1 {
+ font-size: 2.5em;
+ line-height: 1.2em;
+ font-weight: bold;
+ margin-bottom: 0.2em; }
+
+.halftitlepage h1 {
+ font-size: 2.5em;
+ font-weight: bold;
+ margin-bottom: 0.2em; }
+.halftitlepage h2 {
+ font-size: 1.1em;
+ font-style: italic;
+ font-weight: bold;
+ padding-top: 0;
+ margin-top: 0;
+ line-height: 2.5em;
+ margin-bottom: 0.5em;
+ prince-bookmark-level: none; }
+
+.titlepage h2 {
+ font-size: 1.1em;
+ font-style: italic;
+ font-weight: bold;
+ padding-top: 0;
+ margin-top: 0;
+ line-height: 2.5em;
+ margin-bottom: 0.5em;
+ prince-bookmark-level: none; }
+
+.author {
+ font-size: 1em; }
+
+.pubdate {
+ font-size: 0.8em; }
+
+li {
+ list-style-type: square;
+ margin: 0.4em 0;
+ margin-left: 1.5em; }
+
+ol li {
+ list-style-type: decimal; }
+
+.contents li {
+ list-style-type: none; }
+
+img {
+ margin: 0 5px;
+ padding: 2px; }
+
+dt {
+ font-weight: bold;
+ margin-top: 1em; }
+
+dd {
+ font-style: italic; }
+
+blockquote {
+ margin: 1em 1em;
+ font-style: italic;
+ color: #121212; }
+
+table {
+ border: 1px solid #e6e6e6; }
+
+th {
+ background: #EEE; }
+
+tr, td, th {
+ padding: 5px; }
+
+td, tr {
+ border: 1px solid #e6e6e6; }
+
+sup {
+ font-size: 0.7em;
+ font-weight: bold;
+ margin-left: -0.4em; }
+
+/* BLOCKS */
+.center {
+ margin: auto;
+ text-align: center; }
+
+.left {
+ margin: auto;
+ text-align: left; }
+
+.right {
+ margin: auto;
+ text-align: center; }
+
+code {
+ font-size: 0.8em;
+}
+
+.note, .important, .tip, .caution, .box {
+ border: 1px solid #CCC;
+ display: block;
+ margin: 0.5em auto;
+ padding: 1em;
+ padding-top: 0em;
+ width: 600px;
+ background: #EEE;
+ color: #1F1F1F; }
+
+.note > p, .important > p, .tip > p, .caution > p {
+ margin: 0;
+ padding: 0; }
+
+.note-title {
+ font-weight: bold;
+ margin-right: 1em; }
+
+.box-title {
+ display: block;
+ text-align: center;
+ font-weight: bold;
+ font-size: 120%;
+ margin: 0.5em;
+}
+
+.comment {
+ display: block;
+ border: 1px solid #004D00;
+ background: #7AFF7A;
+ padding: 3px;
+ margin: 1px; }
+ .comment .comment-pre {
+ color: #004D00; }
+
+.todo {
+ display: block;
+ border: 1px solid #990000;
+ background: #FF9999;
+ padding: 3px;
+ margin: 1px; }
+ .todo .todo-pre {
+ color: #990000; }
+
+/* TEXT */
+body {
+ color: #000;
+ font-size: 1em; }
+
+h2, section section h1, h1.toc-header {
+ display: block;
+ font-size: 2em;
+ font-weight: bold;
+ margin: 3em 0 1em 0; }
+
+h3, section section section h1 {
+ font-size: 1.6em;
+ font-weight: bold;
+ margin: 3em 0 1em 0; }
+
+h4, section section section section h1 {
+ font-size: 1.3em;
+ font-weight: bold;
+ margin: 3em 0 1em 0; }
+
+h5, section section section section section h1 {
+ font-size: 1.2em;
+ font-weight: bold;
+ margin: 3em 0 1em 0; }
+
+em {
+ font-style: italic; }
+
+a {
+ color: #007bc4;
+ text-decoration: none; }
+ a:hover {
+ color: #005b91; }
+
+span.line-numbers {
+ margin: 0;
+ padding: 3px; }
+
+nav, .navigation {
+ display: block;
+ margin: 1em auto;
+ text-align: center;
+ border: 1px solid #e6e6e6; }
+
+nav.contents {
+ margin: auto;
+ text-align: left;
+ border: none; }
+nav a {
+ margin: 1em; }
+
+.navigation a {
+ margin: 1em; }
+
+nav.contents a {
+ margin: 0; }
+
+mark {
+ font-weight: bolder;
+ font-style: italic;
+ background: none; }
+
+td p, td ul, td ol {
+ margin: 0; }
+
+.topic {
+ margin: 2em auto; }
+
+/* FONTS */
+body {
+ font-family: 'Crimson Text', 'Palatino', 'Bookman', 'Georgia', 'Times'; }
+
+code, pre {
+ font-family: "Droid Sans Mono", "Consolas", "Monaco", "Courier", "Monospace"; }
Oops, something went wrong.

0 comments on commit 8354f51

Please sign in to comment.