glyph 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +7 -0
- data/AUTHORS.textile +8 -7
- data/CHANGELOG.textile +89 -8
- data/LICENSE.textile +1 -2
- data/README.textile +89 -61
- data/Rakefile +12 -10
- data/VERSION +1 -1
- data/benchmark.rb +1 -1
- data/book/config.yml +18 -4
- data/book/document.glyph +269 -45
- data/book/images/glyph/commands_tasks.png +0 -0
- data/book/images/{document_generation.png → glyph/document_generation.png} +0 -0
- data/book/images/glyph/glyph.eps +123 -0
- data/book/images/glyph/glyph.png +0 -0
- data/book/images/glyph/glyph.svg +29 -0
- data/book/lib/commands/commands.rb +11 -0
- data/book/lib/layouts/bookindex.glyph +127 -0
- data/book/lib/layouts/bookpage.glyph +129 -0
- data/book/lib/layouts/project.glyph +26 -0
- data/book/lib/macros/reference.rb +27 -7
- data/book/lib/tasks/tasks.rake +52 -0
- data/book/snippets.yml +1 -1
- data/book/text/{acknowledgement.glyph → acknowledgements.glyph} +4 -2
- data/book/text/changelog.glyph +29 -3
- data/book/text/compiling/compiling.glyph +44 -20
- data/book/text/compiling/lite_mode.glyph +0 -4
- data/book/text/compiling/programmatic_usage.glyph +1 -5
- data/book/text/config/document.glyph +35 -0
- data/book/text/config/filters.glyph +28 -0
- data/book/text/config/options.glyph +25 -0
- data/book/text/config/output.glyph +83 -0
- data/book/text/extending/bookmarks_headers.glyph +0 -5
- data/book/text/extending/command.glyph +56 -0
- data/book/text/extending/commands_tasks.glyph +39 -0
- data/book/text/extending/further_reading.glyph +0 -3
- data/book/text/extending/internals.glyph +3 -5
- data/book/text/extending/interpreting.glyph +0 -4
- data/book/text/extending/layouts.glyph +68 -0
- data/book/text/extending/macro_def.glyph +0 -5
- data/book/text/extending/output_format.glyph +78 -0
- data/book/text/extending/params_attrs.glyph +0 -3
- data/book/text/extending/placeholders.glyph +0 -4
- data/book/text/extending/task.glyph +46 -0
- data/book/text/extending/validators.glyph +5 -6
- data/book/text/getting_started/configuration.glyph +1 -5
- data/book/text/getting_started/create_project.glyph +1 -5
- data/book/text/getting_started/structure.glyph +0 -4
- data/book/text/introduction.glyph +100 -75
- data/book/text/license.glyph +1 -2
- data/book/text/macros/macros_block.glyph +8 -4
- data/book/text/macros/macros_core.glyph +0 -3
- data/book/text/macros/macros_filters.glyph +2 -7
- data/book/text/macros/macros_inline.glyph +0 -4
- data/book/text/macros/macros_structure.glyph +0 -4
- data/book/text/ref_commands.glyph +29 -7
- data/book/text/stats/bookmarks.glyph +49 -0
- data/book/text/stats/links.glyph +90 -0
- data/book/text/stats/macros.glyph +73 -0
- data/book/text/stats/snippets.glyph +50 -0
- data/book/text/stats/stats.glyph +79 -0
- data/book/text/text_editing/attribute_intro.glyph +22 -0
- data/book/text/text_editing/code.glyph +0 -5
- data/book/text/text_editing/conditionals.glyph +0 -4
- data/book/text/text_editing/esc_quot.glyph +64 -0
- data/book/text/text_editing/evaluation.glyph +0 -3
- data/book/text/text_editing/glyph_files.glyph +0 -3
- data/book/text/text_editing/images.glyph +0 -5
- data/book/text/text_editing/inclusions.glyph +0 -4
- data/book/text/text_editing/links.glyph +2 -7
- data/book/text/text_editing/macro_intro.glyph +1 -98
- data/book/text/text_editing/raw_html.glyph +0 -87
- data/book/text/text_editing/section_aliases.glyph +28 -0
- data/book/text/text_editing/sections.glyph +1 -32
- data/book/text/text_editing/stylesheets.glyph +3 -5
- data/book/text/text_editing/topics.glyph +33 -0
- data/book/text/text_editing/xml_fallback.glyph +73 -0
- data/book/text/troubleshooting/errors_command.glyph +0 -3
- data/book/text/troubleshooting/errors_generic.glyph +21 -6
- data/book/text/troubleshooting/errors_macro.glyph +11 -8
- data/book/text/troubleshooting/errors_parser.glyph +0 -3
- data/config.yml +60 -25
- data/glyph.gemspec +90 -36
- data/layouts/web/index.glyph +16 -0
- data/layouts/web/topic.glyph +15 -0
- data/layouts/web5/index.glyph +16 -0
- data/layouts/web5/topic.glyph +17 -0
- data/lib/glyph.rb +36 -49
- data/lib/glyph/analyzer.rb +253 -0
- data/lib/glyph/bookmark.rb +92 -0
- data/lib/glyph/commands.rb +9 -221
- data/lib/glyph/commands/add.rb +8 -0
- data/lib/glyph/commands/compile.rb +93 -0
- data/lib/glyph/commands/config.rb +38 -0
- data/lib/glyph/commands/init.rb +6 -0
- data/lib/glyph/commands/outline.rb +45 -0
- data/lib/glyph/commands/stats.rb +48 -0
- data/lib/glyph/commands/todo.rb +29 -0
- data/lib/glyph/config.rb +2 -0
- data/lib/glyph/document.rb +61 -30
- data/lib/glyph/interpreter.rb +2 -2
- data/lib/glyph/macro.rb +14 -5
- data/lib/glyph/macro_helpers.rb +280 -0
- data/lib/glyph/macro_validators.rb +37 -2
- data/lib/glyph/reporter.rb +182 -0
- data/lib/glyph/syntax_node.rb +37 -10
- data/lib/glyph/system_extensions.rb +8 -45
- data/lib/glyph/utils.rb +148 -0
- data/macros/core.rb +10 -15
- data/macros/filters.rb +4 -5
- data/macros/html/block.rb +46 -30
- data/macros/html/inline.rb +9 -35
- data/macros/html/structure.rb +59 -72
- data/macros/html5/block.rb +69 -0
- data/macros/html5/inline.rb +24 -0
- data/macros/html5/structure.rb +139 -0
- data/macros/xml.rb +1 -1
- data/spec/files/custom_command.rb +6 -0
- data/spec/files/custom_tasks.rake +6 -0
- data/spec/files/document_for_stats.glyph +12 -0
- data/spec/files/references.glyph +4 -0
- data/spec/files/web1.glyph +11 -0
- data/spec/files/web2.glyph +10 -0
- data/spec/files/web_doc.glyph +23 -0
- data/spec/lib/analyzer_spec.rb +137 -0
- data/spec/lib/bookmark_spec.rb +64 -0
- data/spec/lib/commands_spec.rb +30 -5
- data/spec/lib/document_spec.rb +49 -9
- data/spec/lib/glyph_spec.rb +21 -1
- data/spec/lib/macro_spec.rb +6 -6
- data/spec/lib/macro_validators_spec.rb +24 -0
- data/spec/lib/reporter_spec.rb +132 -0
- data/spec/macros/core_spec.rb +2 -3
- data/spec/macros/filters_spec.rb +2 -2
- data/spec/macros/html5_spec.rb +101 -0
- data/spec/macros/macros_spec.rb +16 -6
- data/spec/macros/web5_spec.rb +32 -0
- data/spec/macros/web_spec.rb +59 -0
- data/spec/macros/xml_spec.rb +1 -1
- data/spec/spec_helper.rb +24 -4
- data/spec/tasks/generate_spec.rb +54 -0
- data/spec/tasks/load_spec.rb +29 -3
- data/spec/tasks/project_spec.rb +21 -3
- data/styles/default.css +40 -4
- data/styles/pagination.css +59 -41
- data/tasks/generate.rake +110 -31
- data/tasks/load.rake +39 -7
- data/tasks/project.rake +9 -7
- metadata +115 -34
- data/book/images/glyph.png +0 -0
- data/book/images/glyph.svg +0 -351
- data/book/output/html/glyph.html +0 -4482
- data/book/output/html/images/document_generation.png +0 -0
- data/book/output/html/images/glyph.png +0 -0
- data/book/output/html/images/glyph.svg +0 -351
- data/book/output/pdf/glyph.pdf +4 -10254
- data/book/script/authors +0 -1
- data/book/script/changelog +0 -1
- data/book/script/license +0 -1
- data/book/script/readme +0 -1
- data/book/text/ref_config.glyph +0 -100
- data/book/text/ref_macros.glyph +0 -6
- data/book/text/troubleshooting/errors_intro.glyph +0 -3
data/.gitignore
ADDED
data/AUTHORS.textile
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
Glyph was designed and developed by <a href="http://www.h3rald.com">Fabio Cevasco</a> (h3rald)
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
<p>Glyph was designed and developed by <a href="http://www.h3rald.com">Fabio Cevasco</a> (h3rald).</p>
|
2
|
+
<p>Special thanks to the following individuals who contributed to Glyph by reporting and fixing issues and/or proposing and implementing new features:</p>
|
3
|
+
<ul>
|
4
|
+
<li><a href="http://www.jabbslad.com">Jamie Atkinson</a> (Jabbslad)</li>
|
5
|
+
<li><a href="http://koraktor.github.com">Sebastian Staudt</a> (koraktor)</li>
|
6
|
+
<li><a href="http://balcone.eveel.ru">Dmitry A. Ustalov</a> (eveel)</li>
|
7
|
+
<li><a href="http://www.stuartellis.eu">Stuart Ellis</a> (stuartellis)</li>
|
8
|
+
</ul>
|
8
9
|
|
data/CHANGELOG.textile
CHANGED
@@ -4,9 +4,90 @@
|
|
4
4
|
|
5
5
|
|
6
6
|
<div class="section">
|
7
|
-
<h2 id="h_1">v0.
|
7
|
+
<h2 id="h_1">v0.4.0 – September 3th 2010</h2>
|
8
8
|
<div class="section">
|
9
|
-
<h3 id="h_2">
|
9
|
+
<h3 id="h_2">13 Features Implemented</h3>
|
10
|
+
<table><tr><th>ID</th>
|
11
|
+
<th>Description</th></tr>
|
12
|
+
|
13
|
+
|
14
|
+
<tr><td><a href="http://github.com/h3rald/glyph/issues/closed#issue/40">#40</a></td>
|
15
|
+
<td><p>A new stats command can be used to display statistics about project files, snippets, macros, bookmarks and links.</p></td></tr>
|
16
|
+
|
17
|
+
<tr><td><a href="http://github.com/h3rald/glyph/issues/closed#issue/73">#73</a></td>
|
18
|
+
<td><p>It is now possible to validate online <span class="caps">HTTP</span> links.</p></td></tr>
|
19
|
+
|
20
|
+
<tr><td><a href="http://github.com/h3rald/glyph/issues/closed#issue/112">#112</a></td>
|
21
|
+
<td><p>It is now possible to use <em>wkhtmltopdf</em> instead of Prince to generate <span class="caps">PDF</span> files from <span class="caps">HTML</span> files.</p></td></tr>
|
22
|
+
|
23
|
+
<tr><td><a href="http://github.com/h3rald/glyph/issues/closed#issue/114">#114</a></td>
|
24
|
+
<td><p>It is now possible to generate documents comprised of multiple files (topics).</p></td></tr>
|
25
|
+
|
26
|
+
<tr><td><a href="http://github.com/h3rald/glyph/issues/closed#issue/115">#115</a></td>
|
27
|
+
<td><p>It is now possible to define layouts (used when generating multi-file outputs) using Glyph macros.</p></td></tr>
|
28
|
+
|
29
|
+
<tr><td><a href="http://github.com/h3rald/glyph/issues/closed#issue/120">#120</a></td>
|
30
|
+
<td><p>It is now possible to compile your project to a single HTML5 file (<code>html5</code> output) or multiple files (<code>web5</code> output)</p></td></tr>
|
31
|
+
|
32
|
+
<tr><td><a href="http://github.com/h3rald/glyph/issues/closed#issue/135">#135</a></td>
|
33
|
+
<td><p>Stylesheets can now be linked and imported as well as embedded.</p></td></tr>
|
34
|
+
|
35
|
+
<tr><td><a href="http://github.com/h3rald/glyph/issues/closed#issue/138">#138</a></td>
|
36
|
+
<td><p><code>web</code> and <code>web5</code> output formats inherit <code>html</code> macros.</p></td></tr>
|
37
|
+
|
38
|
+
<tr><td><a href="http://github.com/h3rald/glyph/issues/closed#issue/142">#142</a></td>
|
39
|
+
<td><p>A new navigation macro can be used in <code>web</code> and <code>web5</code> outputs to navigate through topics.</p></td></tr>
|
40
|
+
|
41
|
+
<tr><td><a href="http://github.com/h3rald/glyph/issues/closed#issue/143">#143</a></td>
|
42
|
+
<td><p>A topic-based <span class="caps">TOC</span> is generated when compiling to <code>web</code> or <code>web5</code></p></td></tr>
|
43
|
+
|
44
|
+
<tr><td><a href="http://github.com/h3rald/glyph/issues/closed#issue/144">#144</a></td>
|
45
|
+
<td><p>Two new validators are now available to check whether a macro has (or doesn’t have) a certain ancestor: <code>within</code> and <code>not_within</code>.</p></td></tr>
|
46
|
+
|
47
|
+
<tr><td><a href="http://github.com/h3rald/glyph/issues/closed#issue/147">#147</a></td>
|
48
|
+
<td><p>The default stylesheets provided by Glyph are now compatible with HTML5 outputs (html5 and web5).</p></td></tr>
|
49
|
+
|
50
|
+
<tr><td><a href="http://github.com/h3rald/glyph/issues/closed#issue/148">#148</a></td>
|
51
|
+
<td><p>It is now possible to create custom tasks and commands to extend Glyph functionality.</p></td></tr></table>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
55
|
+
|
56
|
+
<div class="section">
|
57
|
+
<h3 id="h_3">7 Bugs Fixed</h3>
|
58
|
+
<table><tr><th>ID</th>
|
59
|
+
<th>Description</th></tr>
|
60
|
+
|
61
|
+
|
62
|
+
<tr><td><a href="http://github.com/h3rald/glyph/issues/closed#issue/133">#133</a></td>
|
63
|
+
<td><p>Added <span class="caps">HTML</span> charset to Glyph documents (utf-8).</p></td></tr>
|
64
|
+
|
65
|
+
<tr><td><a href="http://github.com/h3rald/glyph/issues/closed#issue/136">#136</a></td>
|
66
|
+
<td><p>Moved utility functions to separate <code>Glyph::Utils</code> module.</p></td></tr>
|
67
|
+
|
68
|
+
<tr><td><a href="http://github.com/h3rald/glyph/issues/closed#issue/139">#139</a></td>
|
69
|
+
<td><p>Heavily restructured Glyph configuration.</p></td></tr>
|
70
|
+
|
71
|
+
<tr><td><a href="http://github.com/h3rald/glyph/issues/closed#issue/140">#140</a></td>
|
72
|
+
<td><p>Added <code>Glyph::Macro::Helpers</code> module to avoid code duplication in macros for different output formats.</p></td></tr>
|
73
|
+
|
74
|
+
<tr><td><a href="http://github.com/h3rald/glyph/issues/closed#issue/141">#141</a></td>
|
75
|
+
<td><p>Prevented non-rb files to be loaded as macros.</p></td></tr>
|
76
|
+
|
77
|
+
<tr><td><a href="http://github.com/h3rald/glyph/issues/closed#issue/145">#145</a></td>
|
78
|
+
<td><p>Dotfiles are now ignored by init command.</p></td></tr>
|
79
|
+
|
80
|
+
<tr><td><a href="http://github.com/h3rald/glyph/issues/closed#issue/167">#167</a></td>
|
81
|
+
<td><p>Fixed <span class="caps">PDF</span> book download links.</p></td></tr></table>
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
<div class="section">
|
88
|
+
<h2 id="h_4">v0.3.0 – June 13th 2010</h2>
|
89
|
+
<div class="section">
|
90
|
+
<h3 id="h_5">13 Features Implemented</h3>
|
10
91
|
<table><tr><th>ID</th>
|
11
92
|
<th>Description</th></tr>
|
12
93
|
|
@@ -42,7 +123,7 @@
|
|
42
123
|
<td><p>A new alias macro has been implemented to create macro aliases.</p></td></tr>
|
43
124
|
|
44
125
|
<tr><td><a href="http://github.com/h3rald/glyph/issues/closed#issue/128">#128</a></td>
|
45
|
-
<td><p>A blacklist for <span class="caps">XML</span> tags has been exposed via the language.options.xml_blacklist setting.</p></td></tr>
|
126
|
+
<td><p>A blacklist for <span class="caps">XML</span> tags has been exposed via the <code>language.options.xml_blacklist</code> setting.</p></td></tr>
|
46
127
|
|
47
128
|
<tr><td><a href="http://github.com/h3rald/glyph/issues/closed#issue/129">#129</a></td>
|
48
129
|
<td><p>The include macro can now be used in lite mode, it can evaluate ruby files and requires relative paths.</p></td></tr>
|
@@ -54,7 +135,7 @@
|
|
54
135
|
|
55
136
|
|
56
137
|
<div class="section">
|
57
|
-
<h3 id="
|
138
|
+
<h3 id="h_6">3 Bugs Fixed</h3>
|
58
139
|
<table><tr><th>ID</th>
|
59
140
|
<th>Description</th></tr>
|
60
141
|
|
@@ -73,9 +154,9 @@
|
|
73
154
|
</div>
|
74
155
|
|
75
156
|
<div class="section">
|
76
|
-
<h2 id="
|
157
|
+
<h2 id="h_7">v0.2.0 – May 9th 2010</h2>
|
77
158
|
<div class="section">
|
78
|
-
<h3 id="
|
159
|
+
<h3 id="h_8">11 Features Implemented</h3>
|
79
160
|
<table><tr><th>ID</th>
|
80
161
|
<th>Description</th></tr>
|
81
162
|
|
@@ -117,7 +198,7 @@
|
|
117
198
|
|
118
199
|
|
119
200
|
<div class="section">
|
120
|
-
<h3 id="
|
201
|
+
<h3 id="h_9">8 Bugs Fixed</h3>
|
121
202
|
<table><tr><th>ID</th>
|
122
203
|
<th>Description</th></tr>
|
123
204
|
|
@@ -151,7 +232,7 @@
|
|
151
232
|
</div>
|
152
233
|
|
153
234
|
<div class="section">
|
154
|
-
<h2 id="
|
235
|
+
<h2 id="h_10">v0.1.0 – April 8th 2010</h2>
|
155
236
|
Initial release.
|
156
237
|
|
157
238
|
</div>
|
data/LICENSE.textile
CHANGED
data/README.textile
CHANGED
@@ -1,58 +1,27 @@
|
|
1
|
-
|
2
1
|
Glyph is a _Rapid Document Authoring Framework_.
|
3
2
|
|
4
|
-
With Glyph, you
|
5
|
-
|
6
|
-
<div class="section">
|
3
|
+
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.
|
4
|
+
|
5
|
+
<div class="section">
|
7
6
|
<h2 id="h_1">Main Features</h2>
|
8
|
-
Glyph comes with its very own macro system to perform a wide variety of advanced tasks:
|
9
|
-
* Generate block-level HTML tags not commonly managed by lightweight markups, like @head@, @body@, @div@ and @table@.
|
10
|
-
* Create and validate internal and external links.
|
11
|
-
* Include and validate images and figures.
|
12
|
-
* Automatically determine header levels based on the document structure.
|
13
|
-
* Automatically generate a Table of Contents based on the document structure.
|
14
|
-
* Store common snippets of text in a single YAML file and use them anywhere in your document, as many times as you need.
|
15
|
-
* Store configuration settings in a YAML file and use them anywhere in your document, as many times as you need.
|
16
|
-
* Evaluate Ruby code within your document.
|
17
|
-
* Include content only if certain conditions are satisfied.
|
18
|
-
* Define macros, snippets and configuration settings directly within your document.
|
19
|
-
* Highlight source code.
|
20
|
-
* Call macros from other macros (including snippets), avoiding mutual calls.
|
21
|
-
* Include text files within other text files.
|
22
|
-
* Include the value of any configuration setting (like author, title) in the document.
|
23
|
-
* Filter input explicitly or implicitly (based on file extensions).
|
24
|
-
* Manage draft comments and todo items.
|
25
|
-
* Provide a simple, less-verbose syntax to write XML code.
|
26
|
-
|
27
|
-
</div>
|
28
|
-
|
29
7
|
<div class="section">
|
30
|
-
<
|
31
|
-
@gem install glyph@ -- simple, as always.
|
32
|
-
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div class="section">
|
36
|
-
<h2 id="h_3">Essential Glyph commands</h2>
|
8
|
+
<h3 id="h_2">Command Line Interface</h3>
|
37
9
|
Glyph is 100% command line. Its interface resambles <a href="http://git-scm.com/">Git's</a> for its simplicity and power (thanks to the <a href="http://github.com/davetron5000/gli">gli</a> gem). Here are some example commands:
|
38
10
|
|
39
11
|
* @glyph init@ -- to initialize a new Glyph project in the current (empty) directory.
|
40
12
|
* @glyph add introduction.textile@ -- to create a new file called _introduction.textile_.
|
41
13
|
* @glyph compile@ -- to compile the current document into a single HTML file.
|
42
14
|
* @glyph compile --auto@ -- to keep recompiling the current document every time a file is changed.
|
43
|
-
* @glyph compile -f pdf@ -- to compile the current document into HTML and then transform it into PDF
|
15
|
+
* @glyph compile -f pdf@ -- to compile the current document into HTML and then transform it into PDF.
|
44
16
|
* @glyph compile readme.glyph@ -- to compile a _readme.glyph_ located in the current directory into a single HTML file.
|
45
17
|
* @glyph outline -l 2@ -- Display the document outline, up to second-level headers.
|
18
|
+
* @glyph stats@ -- Display project statistics.
|
46
19
|
|
47
20
|
</div>
|
48
|
-
|
49
|
-
<
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
**Glyph Source:**
|
54
|
-
|
55
|
-
|
21
|
+
<div class="section">
|
22
|
+
<h3 id="h_3">Minimalist Syntax</h3>
|
23
|
+
Glyph syntax rules can be explained using Glyph itself:
|
24
|
+
|
56
25
|
<div class="code">
|
57
26
|
<pre>
|
58
27
|
<code>
|
@@ -63,26 +32,24 @@ You can use Glyph macros in conjunction
|
|
63
32
|
with _Textile_ or _Markdown_ to
|
64
33
|
produce HTML files effortlessly.
|
65
34
|
]
|
66
|
-
p[
|
67
|
-
Alternatively, you can just use em[Glyph itself]
|
68
|
-
to generate HTML tags.
|
69
|
-
]
|
35
|
+
p[Alternatively, you can just use em[Glyph itself] to generate HTML tags.]
|
70
36
|
section[
|
71
37
|
@title[What about PDFs?]
|
72
38
|
@id[pdf]
|
39
|
+
p[
|
73
40
|
Once you have a single, well-formatted HTML
|
74
41
|
file, converting it to PDF is
|
75
|
-
extremely easy with a 3rd-party
|
76
|
-
renderer like =>[http://www.princexml.com|Prince]
|
42
|
+
extremely easy with a free 3rd-party
|
43
|
+
renderer like =>[http://www.princexml.com|Prince]
|
44
|
+
or =>[http://code.google.com/p/wkhtmltopdf/|wkhtmltopdf].
|
45
|
+
]
|
77
46
|
]
|
78
47
|
]
|
79
48
|
</code>
|
80
49
|
</pre>
|
81
50
|
</div>
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
51
|
+
The Glyph code above corresponds to the following HTML code:
|
52
|
+
|
86
53
|
<div class="code">
|
87
54
|
<pre>
|
88
55
|
<code>
|
@@ -93,17 +60,18 @@ renderer like =>[http://www.princexml.com|Prince].
|
|
93
60
|
<em>Textile</em> or <em>Markdown</em> to
|
94
61
|
produce HTML files effortlessly.
|
95
62
|
</p>
|
63
|
+
<p>
|
64
|
+
Alternatively, you can just use <em>Glyph itself</em>
|
65
|
+
to generate HTML tags.
|
66
|
+
</p>
|
96
67
|
<div class="section">
|
97
68
|
<h3 id="pdf">What about PDFs?</h3>
|
98
69
|
<p>
|
99
70
|
Once you have a single, well-formatted HTML
|
100
71
|
file, converting it to PDF is
|
101
|
-
extremely easy with a 3rd-party renderer
|
102
|
-
like <a href="http://www.princexml.com">Prince</a
|
103
|
-
|
104
|
-
<p>
|
105
|
-
Alternatively, you can just use <em>Glyph itself</em>
|
106
|
-
to generate HTML tags.
|
72
|
+
extremely easy with a free 3rd-party renderer
|
73
|
+
like <a href="http://www.princexml.com">Prince</a>
|
74
|
+
or <a href="http://code.google.com/p/wkhtmltopdf/\">wkhtmltopdf</a>.
|
107
75
|
</p>
|
108
76
|
</div>
|
109
77
|
</div>
|
@@ -112,16 +80,76 @@ renderer like =>[http://www.princexml.com|Prince].
|
|
112
80
|
</div>
|
113
81
|
|
114
82
|
</div>
|
83
|
+
<div class="section">
|
84
|
+
<h3 id="h_4">Content Reuse</h3>
|
85
|
+
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!):
|
86
|
+
|
87
|
+
<div class="code">
|
88
|
+
<pre>
|
89
|
+
<code>
|
90
|
+
snippet:[entities|snippets and macros]
|
91
|
+
snippet:[custom_definitions|
|
92
|
+
p[Glyph allows you to define your own &[entities].]
|
93
|
+
]
|
94
|
+
&[custom_definitions]
|
95
|
+
</code>
|
96
|
+
</pre>
|
97
|
+
</div>
|
98
|
+
...which results in:
|
99
|
+
|
100
|
+
<div class="code">
|
101
|
+
<pre>
|
102
|
+
<code>
|
103
|
+
<p>Glyph allows you to define your own snippets and macros.</p>
|
104
|
+
</code>
|
105
|
+
</pre>
|
106
|
+
</div>
|
107
|
+
If yourself dreaming about _parametric_ snippets, just create your own macros (see the <a href="http://github.com/h3rald/glyph/blob/master/book/text/changelog.glyph">source</a> of Glyph's changelog, just to have an idea).
|
115
108
|
|
116
|
-
|
117
|
-
<
|
109
|
+
</div>
|
110
|
+
<div class="section">
|
111
|
+
<h3 id="h_5">Automation of Common Tasks</h3>
|
112
|
+
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).
|
113
|
+
|
114
|
+
</div>
|
115
|
+
<div class="section">
|
116
|
+
<h3 id="h_6">Reference Validation</h3>
|
117
|
+
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.
|
118
|
+
|
119
|
+
</div>
|
120
|
+
<div class="section">
|
121
|
+
<h3 id="h_7">Extreme Extensibility</h3>
|
122
|
+
* You miss a <code>!!!</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.
|
123
|
+
* 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.
|
124
|
+
* 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.
|
125
|
+
|
126
|
+
</div>
|
127
|
+
<div class="section">
|
128
|
+
<h3 id="h_8">Convention over Configuration</h3>
|
129
|
+
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.
|
130
|
+
|
131
|
+
Nonetheless, you also have 1 (_one_) configuration file to customize to your heart's content (with smart defaults).
|
132
|
+
|
133
|
+
</div>
|
134
|
+
<div class="section">
|
135
|
+
<h3 id="h_9">Free and Open Source</h3>
|
136
|
+
Glyph is 100% Open Source Software, developed using the Ruby Programming Language and licensed under the very permissive terms of the <a href="http://www.opensource.org/licenses/mit-license.php">MIT License</a>.
|
137
|
+
|
138
|
+
If you have Ruby installed, just run @gem install glyph@. That's all it takes.
|
139
|
+
|
140
|
+
</div>
|
141
|
+
|
142
|
+
</div>
|
143
|
+
<div class="section">
|
144
|
+
<h2 id="h_10">Resources</h2>
|
118
145
|
* Home Page: <a href="http://www.h3rald.com/glyph/">http://www.h3rald.com/glyph/</a>
|
119
146
|
* Repository: <a href="http://www.github.com/h3rald/glyph/">http://www.github.com/h3rald/glyph/</a>
|
120
147
|
* Bug Tracking: <a href="http://www.github.com/h3rald/glyph/issues">http://www.github.com/h3rald/glyph/issues</a>
|
121
148
|
* Development Wiki <a href="http://wiki.github.com/h3rald/glyph">http://wiki.github.com/h3rald/glyph</a>
|
122
149
|
* RubyGem Download <a href="http://www.rubygems.org/gems/glyph">http://www.rubygems.org/gems/glyph</a>
|
123
|
-
* Book (PDF): <a href="http://github.com/h3rald/glyph/
|
124
|
-
*
|
150
|
+
* Book (PDF): <a href="http://github.com/downloads/h3rald/glyph/glyph.pdf">http://github.com/downloads/h3rald/glyph/glyph.pdf</a>
|
151
|
+
* Book (Web): <a href="http://www.h3rald.com/glyph/book/">http://www.h3rald.com/glyph/book/</a>
|
152
|
+
* Reference Documentation: <a href="http://rubydoc.info/gems/glyph/">http://rubydoc.info/gems/glyph/</a>
|
125
153
|
* User Group: <a href="http://groups.google.com/group/glyph-framework">http://groups.google.com/group/glyph-framework</a>
|
126
154
|
|
127
155
|
</div>
|
data/Rakefile
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
|
2
|
+
lib = File.expand_path(File.dirname(__FILE__) + '/lib')
|
3
|
+
$: << lib
|
3
4
|
require 'rubygems'
|
4
5
|
require 'rake/clean'
|
5
|
-
require
|
6
|
+
require "#{lib}/glyph.rb"
|
6
7
|
|
7
8
|
task :default => :spec
|
8
9
|
|
@@ -27,16 +28,17 @@ begin
|
|
27
28
|
s.email = "h3rald@h3rald.com"
|
28
29
|
s.homepage = "http://www.h3rald.com/glyph/"
|
29
30
|
s.authors = ["Fabio Cevasco"]
|
30
|
-
s.files.
|
31
|
-
s.files.
|
32
|
-
s.
|
33
|
-
s.add_dependency '
|
31
|
+
s.files.exclude 'book/output/web/**/*'
|
32
|
+
s.files.exclude 'book/output/web5/**/*'
|
33
|
+
s.files.exclude 'book/output/html5/**/*'
|
34
|
+
s.add_dependency 'gli', '>= 1.1.1' # Command line interface
|
35
|
+
s.add_dependency 'extlib', '>= 0.9.15' # Extension methods
|
34
36
|
s.add_dependency 'rake', '>= 0.8.7' # Glyph rasks
|
35
|
-
s.add_development_dependency 'rspec', '>= 1.
|
36
|
-
s.add_development_dependency 'yard', '>=
|
37
|
+
s.add_development_dependency 'rspec', '>= 1.3.0' # Test suite
|
38
|
+
s.add_development_dependency 'yard', '>= 0.6.0' # Documentation suite
|
37
39
|
s.add_development_dependency 'jeweler', '1.4.0' # Gem management
|
38
40
|
s.add_development_dependency 'directory_watcher', ">= 1.3.2" # Auto-regeneration
|
39
|
-
s.add_development_dependency 'haml', ">= 3.0.
|
41
|
+
s.add_development_dependency 'haml', ">= 3.0.15" # Sass filter
|
40
42
|
s.add_development_dependency 'RedCloth', ">= 4.2.3" # Textile filter
|
41
43
|
s.add_development_dependency 'bluecloth', ">= 2.0.7" # Markdown filter
|
42
44
|
s.add_development_dependency 'coderay', ">= 0.9.3" # Syntax Highlighting
|
@@ -47,7 +49,7 @@ rescue LoadError
|
|
47
49
|
end
|
48
50
|
|
49
51
|
begin
|
50
|
-
require
|
52
|
+
require "spec/rake/spectask"
|
51
53
|
Spec::Rake::SpecTask.new('spec') do |t|
|
52
54
|
t.spec_files = FileList['spec/**/*_spec.rb']
|
53
55
|
t.spec_opts = ["--color"]
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.0
|
data/benchmark.rb
CHANGED
data/book/config.yml
CHANGED
@@ -1,11 +1,25 @@
|
|
1
1
|
---
|
2
2
|
:document:
|
3
3
|
:output: html
|
4
|
-
:title: Glyph
|
5
4
|
:subtitle: Rapid Document Authoring Framework
|
6
5
|
:author: Fabio Cevasco
|
7
|
-
:revision: "v0.3.0"
|
8
|
-
:filename: glyph
|
9
6
|
:draft: true
|
10
|
-
:
|
7
|
+
:revision: v0.4.0
|
8
|
+
:filename: glyph
|
9
|
+
:title: Glyph
|
10
|
+
:styles: link
|
11
|
+
:output:
|
12
|
+
:h3rald:
|
13
|
+
:multifile: true
|
14
|
+
:extension: '.html'
|
15
|
+
:filter_target: 'html'
|
16
|
+
:base: '/glyph/book/'
|
17
|
+
:macro_dirs: ['html']
|
18
|
+
:layout_dirs: ['web']
|
19
|
+
:layouts:
|
20
|
+
:topic: bookpage
|
21
|
+
:index: bookindex
|
22
|
+
:pdf:
|
23
|
+
:generator: prince
|
24
|
+
:filters:
|
11
25
|
:highlighter: ultraviolet
|