Permalink
Browse files

Updated stylesheets, minor edits to the book.

  • Loading branch information...
h3rald committed Jul 22, 2012
1 parent 4080962 commit 2fe3a515b3def8cf30b8ccfe4d154676b838ce88
View
@@ -1,5 +1,11 @@
#!/usr/bin/env ruby
+Dir.chdir '../styles'
+
+system 'sh "generate"'
+
+Dir.chdir '../book'
+
require_relative '../lib/glyph.rb'
require_relative '../lib/glyph/commands.rb'
@@ -24,8 +24,6 @@ def:[release|
section[
@title[v{{0}} – {{1}}]
{{2}}
-
- p/em[→ View closed issues on =>[https://github.com/h3rald/glyph/issues?direction=asc&labels={{0}}&sort=created&state=closed|GitHub].]
]
]
def:[issue|
@@ -25,7 +25,6 @@ Currently, Glyph supports:
By default, Glyph attempts to use wkhtmltopdf. To change this, set the $>[output_pdf_generator] to code[prince].
]
note[Glyph expects PDF generators to be installed on the local machine and callable via command line using the code[wkhtmltopdf] or the code[prince] commands. Just install them as you would with any other program, depending on your operating system (yes, they both offer Windows installers).]
- tip[Glyph's default CSS file use the free em[Gentium] font for all text. You can download it from =>[http://www.sil.org/~gaultney/gentium/|here].]
]
section[
@@ -73,7 +73,7 @@ macro :issue do
end
=]
p[The code[issue] macro is only rewriting existing Glyph code around the two parameters provided. In this case, it is possible to do exactly the same thing using the %>[define:] (aliased by @def:@):]
- highlight[=html|
+ highlight[=plain|
define:[issue\|
tr[
td[\/=>[http://github.com/h3rald/glyph/issues/closed#issue/{{0}}\|#{{0}}]]
@@ -8,14 +8,14 @@ else
interpret "txt[#{raw_value}]"
end
=]
-]?txt[Glyph is a _Rapid Document Authoring Framework_.
+]section[txt[Glyph is a _Rapid Document Authoring Framework_.
-With Glyph, creating and maintaining any kind of document becomes as easy as... _programming_. Glyph enables you to minimize text duplication, focus on content rather than presentation, manage references seamlessly and automate tedious tasks through a simple but effective macro language, specifically geared towards customization and extensibility.
+With Glyph, creating and maintaining any kind of document becomes as easy as... _programming_. Glyph enables you to minimize text duplication, focus on content rather than presentation, manage references seamlessly and automate tedious tasks through a simple but effective macro language, specifically geared towards customization and extensibility.]
section[
@title[Main Features]
- section[
+ §txt[
@title[Command Line Interface]
Glyph is 100% command line. Its interface resambles =>[http://git-scm.com/|Git's] for its simplicity and power (thanks to the =>[http://github.com/davetron5000/gli|gli] gem). Here are some example commands:
@@ -29,10 +29,11 @@ Glyph is 100% command line. Its interface resambles =>[http://git-scm.com/|Git's
* @glyph stats@ -- Display project statistics.
]
- section[
+ §[
@title[Minimalist Syntax]
-Glyph syntax rules can be explained using Glyph itself:
- codeblock[=
+p[Glyph syntax rules can be explained using Glyph itself:]
+
+ highlight[=plain|
section[
@title[Something about Glyph]
txt[
@@ -54,8 +55,8 @@ or =>[http://code.google.com/p/wkhtmltopdf/\|wkhtmltopdf].
]
]
=]
-The Glyph code above corresponds to the following HTML code:
- codeblock[=
+p[The Glyph code above corresponds to the following HTML code:]
+ highlight[=html|
<div class="section">
<h2 id="h_10">Something about Glyph</h2>
<p>
@@ -81,50 +82,48 @@ The Glyph code above corresponds to the following HTML code:
=]
]
- section[
+ §[
@title[Content Reuse]
-Finding yourself repeating the same sentence over an over? Glyph allows you to create snippets. Within snippets. Within other snippets (and so on, for a long long time...) as long as you don't define a snippet by defining itself, which would be kinda nasty (and Glyph would complain!):
- codeblock[=
+ txt[Finding yourself repeating the same sentence over an over? Glyph allows you to create snippets. Within snippets. Within other snippets (and so on, for a long long time...) as long as you don't define a snippet by defining itself, which would be kinda nasty (and Glyph would complain!):]
+ highlight[=plain|
snippet:[entities\|snippets and macros]
snippet:[custom_definitions\|
p[Glyph allows you to define your own &[entities].]
]
&[custom_definitions]
=]
- ...which results in:
- codeblock[=
-<p>Glyph allows you to define your own snippets and macros.</p>
- =]
- If yourself dreaming about _parametric_ snippets, just create your own macros (see the =>[http://github.com/h3rald/glyph/blob/master/book/text/changelog.glyph|source] of Glyph's changelog, just to have an idea).
+ p[...which results in:]
+ highlight[=html|<p>Glyph allows you to define your own snippets and macros.</p>=]
+ txt[If yourself dreaming about _parametric_ snippets, just create your own macros (see the =>[http://github.com/h3rald/glyph/blob/master/book/text/changelog.glyph|source] of Glyph's changelog, just to have an idea).]
]
- section[
+ §txt[
@title[Automation of Common Tasks]
If you're writing a book, you shouldn't have to worry about pagination, headers, footers, table of contents, section numbering or similar. Glyph understands you, and will take care of everything for you (with a little help from CSS3, sometimes).
]
- section[
+ §txt[
@title[Reference Validation]
Feel free to add plenty of links, snippets, bookmarks, ... if Glyph doesn't find something, it will definitely complain. Broken references are a thing on the past, and you don't need to worry about it.
]
- section[
+ §txt[
@title[Extreme Extensibility]
* You miss a code[=!!!=] macro to format really, _really_ important things? Create it. In under 3 seconds, in Ruby or Glyph itself. And yes, you can use special characters, too.
* You want your own, very special special @glyph create --everything@ command to create all _you_ need in a Glyph project? You can do it. Using your own Rake tasks, too.
* You want Glyph to output ODF files? You can do it, and you'll be able to run @glyph generate -f odf@. This would probably require a little more time, but it's trivial, from a technical point of view.
]
- section[
+ §txt[
@title[Convention over Configuration]
Put your text files in @/text@, your images in @/images@, add custom macros in a @macro@ folder within your @/lib@ folder... you get the picture: Glyph has its special places.
Nonetheless, you also have 1 (_one_) configuration file to customize to your heart's content (with smart defaults).
]
- section[
+ §txt[
@title[Free and Open Source]
Glyph is 100% Open Source Software, developed using the Ruby Programming Language and licensed under the very permissive terms of the =>[http://www.opensource.org/licenses/mit-license.php|MIT License].
If you have Ruby installed, just run @gem install glyph@. That's all it takes.
]
]
- section[
+ §txt[
@title[Resources]
* Home Page: =>[http://www.h3rald.com/glyph/]
* Repository: =>[http://www.github.com/h3rald/glyph/]
View
@@ -1,4 +1,4 @@
-p[Copyright &copy; 2010-2011 strong[Fabio Cevasco], =>[http://www.h3rald.com]]
+p[Copyright &copy; 2010-2012 strong[Fabio Cevasco], =>[http://www.h3rald.com]]
p[Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@@ -2,7 +2,7 @@ def:[stats_for|
section[
@title[Displaying stats about {{title}}]
txt[To display statistics about {{object}}, execute code[glyph stats {{command}}]. Glyph displays something like this:]
- highlight[=html|
+ highlight[=plain|
{{example}}
=]
section[
@@ -8,14 +8,14 @@ As of version 0.5.0, Glyph can be considered _Turing-complete_, as it satisfies
* A memory model which emulates an infinite store: there are no enforced limits on attribute/snippets allocations and number of algorithms or parameters.
]
- §txt[
+ §[
@title[Operations on integer values]
-Glyph can be used to perform operation on integer values (additions, subtractions and multiplications). For example, code[=\/add[2\|3\|7]=] will evaluate to @12@, and code[=\/multiply[add[3\|7]\|subtract[5\|1\|2]]=] will return 20.
+p[Glyph can be used to perform operation on integer values (additions, subtractions and multiplications). For example, code[=\/add[2\|3\|7]=] will evaluate to @12@, and code[=\/multiply[add[3\|7]\|subtract[5\|1\|2]]=] will return 20.]
-As a more complex example, consider the following @factorial@ macro, which is able to calculate the factorial of a number recursively:
+p[As a more complex example, consider the following @factorial@ macro, which is able to calculate the factorial of a number recursively:]
-highlight[=html|
+ highlight[=html|
def:[factorial\|
?[
eq[{{0}}\|0]\|1\|
@@ -24,9 +24,9 @@ def:[factorial\|
]
]
]
-=]
+ =]
-If you try executing code[=factorial[5]=], it will evaluate to @120@.
+p[If you try executing code[=factorial[5]=], it will evaluate to @120@.]
]
§txt[
@@ -28,7 +28,7 @@ While including the context of an entire file is definitely a useful feature for
Snippets can be defined using the %>[snippet:] (aliased by @&:@) and called by using the %>[snippet] (aliased by @&@). Consider the following simple example:
]
- highlight[=html|
+ highlight[=plain|
&:[markups\|Textile or Markdown]
Glyph supports &[markups].
@@ -44,7 +44,7 @@ Snippets (or any other macro) can be nested within other snippets. Glyph takes c
@id[fragments]
txt[As an even simpler alternative to snippets, consider using _fragments_. The %>[fragment:] (aliased by @##@) can be used to mark a section of Glyph code as a fragment that can then be _embedded_ using the %>[embed] (aliased by @<=@), like this:]
- highlight[=html|
+ highlight[=plain|
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.
=]
]
@@ -9,7 +9,7 @@ If you care about link validation and you want to save some keystrokes, then you
]
box[Example|
p[&[gcode]]
- highlight[=html|
+ highlight[=plain|
This is a link to link[#test].
...
This is link[#wrong].
@@ -23,7 +23,7 @@ This is a #[test\\\|test anchor].
<p>This is a <a id="test">test anchor</a>.</p>
=]
p[Additionally, the following warning message is displayed when =>[#compile|compiling]:]
- highlight[=html|
+ highlight[=plain|
warning: Bookmark 'wrong' does not exist
-> source: @: authoring.textile
-> path: document/body/bodymatter/chapter/@/textile/section/section/box/link
@@ -37,7 +37,7 @@ Basically, if you use the %>[link] and the %>[anchor], Glyph makes sure that:
Besides using the %>[anchor], you can also create an anchor for a header by passing an code[@id] attribute the the %>[section], like this:
]
- highlight[=html|
+ highlight[=plain|
section[
@title[My Section]
@id[my_section]
View
@@ -146,11 +146,8 @@ def macro_aliases_for(name)
# Returns a list of macro names corresponding to sections
# that commonly have a title
def titled_sections
- (Glyph['system.structure.frontmatter']+
- Glyph['system.structure.bodymatter']+
- Glyph['system.structure.backmatter']+
- Glyph.macro_aliases_for(:section)+
- [:section]).uniq
+ (Glyph.macro_aliases_for(:section)+
+ [:section]-[:frontmatter, :bodymatter, :backmatter]).uniq
end
# Returns true if the macro names point to the same definition
View
@@ -27,6 +27,7 @@
:definition => @source_file,
:file => (attr(:src) || @source_file)
@node[:header] = bmk
+ @data[:toc] = !attr(:notoc)
@data[:title] = attr :title
@data[:level] = level
@data[:id] = bmk.code
View
@@ -3,12 +3,13 @@
*/
.CodeRay {
background-color: #FFF;
- border: 1px solid #CCC;
+ border: 1px solid #ECECEC;
line-height: 1.3em;
font-size: 12px;
- font-family: Monospace;
+ font-family: 'Inconsolata', Monospace;
color: #000;
- padding: 1em 0px 1em 1em; }
+ padding: 10px;
+ margin: 1em 0; }
.CodeRay pre, .CodeRay code {
padding: 0;
@@ -32,11 +33,10 @@ table.CodeRay td {
vertical-align: top; }
.CodeRay .line-numbers, .CodeRay .no {
- border: 1px solid #ECECEC;
- margin: 0 inherit;
+ margin: 0 2px 0 0;
background-color: #ECECEC;
color: #AAA;
- padding: 0px 7px;
+ width: 20px;
text-align: right; }
.CodeRay .line-numbers tt {
@@ -90,7 +90,9 @@ ol.CodeRay li {
.CodeRay .comment {
color: #998;
- font-style: italic; }
+ font-style: italic;
+ border: 0;
+ background: transparent; }
.CodeRay .char {
color: #04D; }
View
@@ -4,12 +4,13 @@
*/
.CodeRay {
background-color: #FFF;
- border: 1px solid #CCC;
+ border: 1px solid #ECECEC;
line-height: 1.3em;
font-size: 12px;
- font-family: Monospace;
+ font-family: 'Inconsolata', Monospace;
color: #000;
- padding: 1em 0px 1em 1em;
+ padding: 10px;
+ margin: 1em 0;
}
.CodeRay pre, .CodeRay code {
padding: 0;
@@ -29,11 +30,10 @@ table.CodeRay td {
}
.CodeRay .line-numbers, .CodeRay .no {
- border: 1px solid #ECECEC;
- margin: 0 inherit;
+ margin: 0 2px 0 0;
background-color: #ECECEC;
color: #AAA;
- padding: 0px 7px;
+ width: 20px;
text-align: right;
}
.CodeRay .line-numbers tt { font-weight: bold }
@@ -55,7 +55,7 @@ ol.CodeRay li { white-space: pre }
.CodeRay .attribute-value { color:#700 }
.CodeRay .attribute-value-fat { color:#C00 }
.CodeRay .binary { color:#509; font-weight:bold }
-.CodeRay .comment { color:#998; font-style: italic;}
+.CodeRay .comment { color:#998; font-style: italic; border: 0; background: transparent;}
.CodeRay .char { color:#04D }
.CodeRay .ch .content { color:#04D }
Oops, something went wrong.

0 comments on commit 2fe3a51

Please sign in to comment.