glyph 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. data/.gitignore +7 -0
  2. data/AUTHORS.textile +8 -7
  3. data/CHANGELOG.textile +89 -8
  4. data/LICENSE.textile +1 -2
  5. data/README.textile +89 -61
  6. data/Rakefile +12 -10
  7. data/VERSION +1 -1
  8. data/benchmark.rb +1 -1
  9. data/book/config.yml +18 -4
  10. data/book/document.glyph +269 -45
  11. data/book/images/glyph/commands_tasks.png +0 -0
  12. data/book/images/{document_generation.png → glyph/document_generation.png} +0 -0
  13. data/book/images/glyph/glyph.eps +123 -0
  14. data/book/images/glyph/glyph.png +0 -0
  15. data/book/images/glyph/glyph.svg +29 -0
  16. data/book/lib/commands/commands.rb +11 -0
  17. data/book/lib/layouts/bookindex.glyph +127 -0
  18. data/book/lib/layouts/bookpage.glyph +129 -0
  19. data/book/lib/layouts/project.glyph +26 -0
  20. data/book/lib/macros/reference.rb +27 -7
  21. data/book/lib/tasks/tasks.rake +52 -0
  22. data/book/snippets.yml +1 -1
  23. data/book/text/{acknowledgement.glyph → acknowledgements.glyph} +4 -2
  24. data/book/text/changelog.glyph +29 -3
  25. data/book/text/compiling/compiling.glyph +44 -20
  26. data/book/text/compiling/lite_mode.glyph +0 -4
  27. data/book/text/compiling/programmatic_usage.glyph +1 -5
  28. data/book/text/config/document.glyph +35 -0
  29. data/book/text/config/filters.glyph +28 -0
  30. data/book/text/config/options.glyph +25 -0
  31. data/book/text/config/output.glyph +83 -0
  32. data/book/text/extending/bookmarks_headers.glyph +0 -5
  33. data/book/text/extending/command.glyph +56 -0
  34. data/book/text/extending/commands_tasks.glyph +39 -0
  35. data/book/text/extending/further_reading.glyph +0 -3
  36. data/book/text/extending/internals.glyph +3 -5
  37. data/book/text/extending/interpreting.glyph +0 -4
  38. data/book/text/extending/layouts.glyph +68 -0
  39. data/book/text/extending/macro_def.glyph +0 -5
  40. data/book/text/extending/output_format.glyph +78 -0
  41. data/book/text/extending/params_attrs.glyph +0 -3
  42. data/book/text/extending/placeholders.glyph +0 -4
  43. data/book/text/extending/task.glyph +46 -0
  44. data/book/text/extending/validators.glyph +5 -6
  45. data/book/text/getting_started/configuration.glyph +1 -5
  46. data/book/text/getting_started/create_project.glyph +1 -5
  47. data/book/text/getting_started/structure.glyph +0 -4
  48. data/book/text/introduction.glyph +100 -75
  49. data/book/text/license.glyph +1 -2
  50. data/book/text/macros/macros_block.glyph +8 -4
  51. data/book/text/macros/macros_core.glyph +0 -3
  52. data/book/text/macros/macros_filters.glyph +2 -7
  53. data/book/text/macros/macros_inline.glyph +0 -4
  54. data/book/text/macros/macros_structure.glyph +0 -4
  55. data/book/text/ref_commands.glyph +29 -7
  56. data/book/text/stats/bookmarks.glyph +49 -0
  57. data/book/text/stats/links.glyph +90 -0
  58. data/book/text/stats/macros.glyph +73 -0
  59. data/book/text/stats/snippets.glyph +50 -0
  60. data/book/text/stats/stats.glyph +79 -0
  61. data/book/text/text_editing/attribute_intro.glyph +22 -0
  62. data/book/text/text_editing/code.glyph +0 -5
  63. data/book/text/text_editing/conditionals.glyph +0 -4
  64. data/book/text/text_editing/esc_quot.glyph +64 -0
  65. data/book/text/text_editing/evaluation.glyph +0 -3
  66. data/book/text/text_editing/glyph_files.glyph +0 -3
  67. data/book/text/text_editing/images.glyph +0 -5
  68. data/book/text/text_editing/inclusions.glyph +0 -4
  69. data/book/text/text_editing/links.glyph +2 -7
  70. data/book/text/text_editing/macro_intro.glyph +1 -98
  71. data/book/text/text_editing/raw_html.glyph +0 -87
  72. data/book/text/text_editing/section_aliases.glyph +28 -0
  73. data/book/text/text_editing/sections.glyph +1 -32
  74. data/book/text/text_editing/stylesheets.glyph +3 -5
  75. data/book/text/text_editing/topics.glyph +33 -0
  76. data/book/text/text_editing/xml_fallback.glyph +73 -0
  77. data/book/text/troubleshooting/errors_command.glyph +0 -3
  78. data/book/text/troubleshooting/errors_generic.glyph +21 -6
  79. data/book/text/troubleshooting/errors_macro.glyph +11 -8
  80. data/book/text/troubleshooting/errors_parser.glyph +0 -3
  81. data/config.yml +60 -25
  82. data/glyph.gemspec +90 -36
  83. data/layouts/web/index.glyph +16 -0
  84. data/layouts/web/topic.glyph +15 -0
  85. data/layouts/web5/index.glyph +16 -0
  86. data/layouts/web5/topic.glyph +17 -0
  87. data/lib/glyph.rb +36 -49
  88. data/lib/glyph/analyzer.rb +253 -0
  89. data/lib/glyph/bookmark.rb +92 -0
  90. data/lib/glyph/commands.rb +9 -221
  91. data/lib/glyph/commands/add.rb +8 -0
  92. data/lib/glyph/commands/compile.rb +93 -0
  93. data/lib/glyph/commands/config.rb +38 -0
  94. data/lib/glyph/commands/init.rb +6 -0
  95. data/lib/glyph/commands/outline.rb +45 -0
  96. data/lib/glyph/commands/stats.rb +48 -0
  97. data/lib/glyph/commands/todo.rb +29 -0
  98. data/lib/glyph/config.rb +2 -0
  99. data/lib/glyph/document.rb +61 -30
  100. data/lib/glyph/interpreter.rb +2 -2
  101. data/lib/glyph/macro.rb +14 -5
  102. data/lib/glyph/macro_helpers.rb +280 -0
  103. data/lib/glyph/macro_validators.rb +37 -2
  104. data/lib/glyph/reporter.rb +182 -0
  105. data/lib/glyph/syntax_node.rb +37 -10
  106. data/lib/glyph/system_extensions.rb +8 -45
  107. data/lib/glyph/utils.rb +148 -0
  108. data/macros/core.rb +10 -15
  109. data/macros/filters.rb +4 -5
  110. data/macros/html/block.rb +46 -30
  111. data/macros/html/inline.rb +9 -35
  112. data/macros/html/structure.rb +59 -72
  113. data/macros/html5/block.rb +69 -0
  114. data/macros/html5/inline.rb +24 -0
  115. data/macros/html5/structure.rb +139 -0
  116. data/macros/xml.rb +1 -1
  117. data/spec/files/custom_command.rb +6 -0
  118. data/spec/files/custom_tasks.rake +6 -0
  119. data/spec/files/document_for_stats.glyph +12 -0
  120. data/spec/files/references.glyph +4 -0
  121. data/spec/files/web1.glyph +11 -0
  122. data/spec/files/web2.glyph +10 -0
  123. data/spec/files/web_doc.glyph +23 -0
  124. data/spec/lib/analyzer_spec.rb +137 -0
  125. data/spec/lib/bookmark_spec.rb +64 -0
  126. data/spec/lib/commands_spec.rb +30 -5
  127. data/spec/lib/document_spec.rb +49 -9
  128. data/spec/lib/glyph_spec.rb +21 -1
  129. data/spec/lib/macro_spec.rb +6 -6
  130. data/spec/lib/macro_validators_spec.rb +24 -0
  131. data/spec/lib/reporter_spec.rb +132 -0
  132. data/spec/macros/core_spec.rb +2 -3
  133. data/spec/macros/filters_spec.rb +2 -2
  134. data/spec/macros/html5_spec.rb +101 -0
  135. data/spec/macros/macros_spec.rb +16 -6
  136. data/spec/macros/web5_spec.rb +32 -0
  137. data/spec/macros/web_spec.rb +59 -0
  138. data/spec/macros/xml_spec.rb +1 -1
  139. data/spec/spec_helper.rb +24 -4
  140. data/spec/tasks/generate_spec.rb +54 -0
  141. data/spec/tasks/load_spec.rb +29 -3
  142. data/spec/tasks/project_spec.rb +21 -3
  143. data/styles/default.css +40 -4
  144. data/styles/pagination.css +59 -41
  145. data/tasks/generate.rake +110 -31
  146. data/tasks/load.rake +39 -7
  147. data/tasks/project.rake +9 -7
  148. metadata +115 -34
  149. data/book/images/glyph.png +0 -0
  150. data/book/images/glyph.svg +0 -351
  151. data/book/output/html/glyph.html +0 -4482
  152. data/book/output/html/images/document_generation.png +0 -0
  153. data/book/output/html/images/glyph.png +0 -0
  154. data/book/output/html/images/glyph.svg +0 -351
  155. data/book/output/pdf/glyph.pdf +4 -10254
  156. data/book/script/authors +0 -1
  157. data/book/script/changelog +0 -1
  158. data/book/script/license +0 -1
  159. data/book/script/readme +0 -1
  160. data/book/text/ref_config.glyph +0 -100
  161. data/book/text/ref_macros.glyph +0 -6
  162. data/book/text/troubleshooting/errors_intro.glyph +0 -3
@@ -0,0 +1,28 @@
1
+ txt[
2
+ There are _a lot_ of macros that can be used in the same way as @section@, one for each element commonly used in =>[http://en.wikipedia.org/wiki/Book_design|book design]. Each one of them is a simple wrapper for a @<div>@ tag with a @class@ attribute set to its name.
3
+
4
+ The following table lists the identifiers of all section-like macros, divided according to the part of the book they should be placed in:
5
+ ]
6
+ table[
7
+ tr[
8
+ th[Frontmatter]
9
+ td[txt[@imprint@ ^&dagger;^, @dedication@ ^&dagger;^, @inspiration@ ^&dagger;^, @foreword@ ^&Dagger;^, @introduction@ ^&Dagger;^, @acknowledgement@ ^&Dagger;^, @prologue@ ^&Dagger;^, @toc@ ^*^]]
10
+ ]
11
+ tr[
12
+ th[Bodymatter]
13
+ td[txt[@volume@, @book@, @part@, @chapter@]]
14
+ ]
15
+ tr[
16
+ th[Backmatter]
17
+ td[txt[@epilogue@ ^&Dagger;^, @afterword@ ^&Dagger;^, @postscript@ ^&dagger;^, @appendix@, @addendum@ ^&Dagger;^, @glossary@ ^**&Dagger;^, @colophon@ ^&dagger;^, @bibliography@ ^**&Dagger;^, @promotion@ ^&dagger;^, @references@ ^**&Dagger;^, @index@ ^**&Dagger;^, @lot@ ^**&Dagger;^, @lof@ ^**&Dagger;^]]
18
+ ]
19
+ ]
20
+
21
+ p[strong[*]: The %>[toc] is used to generate the Table of Contents automatically, and it takes no parameters.]
22
+ p[strong[**]: This macro is likely to be extended in future versions to generate/aggregate content automatically.]
23
+ p[strong[&dagger;]: This section is not listed in the Table of Contents.]
24
+ p[strong[&Dagger;]: Any subsection of this section is not listed in the Table of Contents.]
25
+
26
+ note[
27
+ code[frontmatter], code[bodymatter] and code[backmatter] are also macro identifiers, but they are exposed as attributes for the %>[book] and the %>[article], so if you're using either of these two macros as your root macro for your document, there's no need to use them explicitly.
28
+ ]
@@ -1,6 +1,3 @@
1
- section[
2
- @title[Sections and Headers]
3
- @id[sec_head]
4
1
 
5
2
  p[Glyph documents are normally organized as a hierarchical tree of nested chapters, appendixes, sections, etc. To define a section, use the %>[section], like so:]
6
3
 
@@ -15,7 +12,7 @@ This section is nested into the previous one.
15
12
  ] --[End of Section #1]
16
13
  =]
17
14
 
18
- txt[This example defines two nested sections. If the code[@title] attribute is specified like in this case, it will be converted to a proper HTML header and it will appear in the table of contents (see the %>[toc]).
15
+ txt[This example defines two nested sections. If the code[@title] attribute is specified like in this case, it will be converted to a proper HTML header and it will appear in the Table of Contents (see the %>[toc]).
19
16
 
20
17
  Note an important difference from HTML: there is no need for an explicit level for the headers, as it will be determined at runtime when the document is compiled, based on how sections are nested. The previous code snippet (taken as it is), for example, will be transformed into the following HTML code:]
21
18
 
@@ -32,32 +29,4 @@ Note an important difference from HTML: there is no need for an explicit level f
32
29
 
33
30
  txt[
34
31
  By default, in Glyph the first header level is _2_, so the two headers are rendered as @h2@ and @h3@, respectively (@--\[...\]@ macros are _comments_, therefore they are not included in the final output).
35
-
36
- There are _a lot_ of macros that can be used in the same way as @section@, one for each element commonly used in =>[http://en.wikipedia.org/wiki/Book_design|book design]. Each one of them is a simple wrapper for a @<div>@ tag with a @class@ attribute set to its name.
37
-
38
- The following table lists the identifiers of all section-like macros, divided according to the part of the book they should be placed in:
39
- ]
40
- table[
41
- tr[
42
- th[Frontmatter]
43
- td[txt[@imprint@ ^&dagger;^, @dedication@ ^&dagger;^, @inspiration@ ^&dagger;^, @foreword@ ^&Dagger;^, @introduction@ ^&Dagger;^, @acknowledgement@ ^&Dagger;^, @prologue@ ^&Dagger;^, @toc@ ^*^]]
44
- ]
45
- tr[
46
- th[Bodymatter]
47
- td[txt[@volume@, @book@, @part@, @chapter@]]
48
- ]
49
- tr[
50
- th[Backmatter]
51
- td[txt[@epilogue@ ^&Dagger;^, @afterword@ ^&Dagger;^, @postscript@ ^&dagger;^, @appendix@, @addendum@ ^&Dagger;^, @glossary@ ^**&Dagger;^, @colophon@ ^&dagger;^, @bibliography@ ^**&Dagger;^, @promotion@ ^&dagger;^, @references@ ^**&Dagger;^, @index@ ^**&Dagger;^, @lot@ ^**&Dagger;^, @lof@ ^**&Dagger;^]]
52
- ]
53
- ]
54
-
55
- p[strong[*]: The %>[toc] is used to generate the Table of Contents automatically, and it takes no parameters.]
56
- p[strong[**]: This macro is likely to be extended in future versions to generate/aggregate content automatically.]
57
- p[strong[&dagger;]: This section is not listed in the Table of Contents.]
58
- p[strong[&Dagger;]: Any subsection of this section is not listed in the Table of Contents.]
59
-
60
- note[
61
- code[frontmatter], code[bodymatter] and code[backmatter] are also macro identifiers, but they are exposed as attributes for the %>[book] and the %>[article], so if you're using either of these two macros as your root macro for your document, there's no need to use them explicitly.
62
32
  ]
63
- ]
@@ -1,10 +1,10 @@
1
- section[
2
- @title[Adding Stylesheets]
3
- @id[stylesheets]
4
1
  p[Currently, Glyph does not provide any native way to format text and pages. The reason is that there's absolutely no need for that: CSS does the job just fine. In particular, CSS3 offers specific attributes and elements that can be used specifically for paginated documents. That's no replacement for LaTeX by any means, but it is enough if you're not looking for advanced typographical features.]
5
2
  p[You can embed CSS files using the %>[style], like this:]
6
3
  p[code[= style[default.css] =]]
7
4
  txt[In this case, the %>[style] looks for a @default.css@ file in the @/styles@ folder of your Glyph project _and_ among the default Glyph stylesheets, and embeds it within a @<style>@ tag. If you supply a file with a @.sass@ extension, it will interpret it as a Sass file and convert it to CSS automatically (if the _Haml_ gem is installed).]
5
+ tip[
6
+ By default, stylesheets are embedded within text files. If necessary, you can choose to link them or import them by changing the values of the $>[document.styles].
7
+ ]
8
8
  section[
9
9
  @title[Default Stylesheets]
10
10
  @id[default_stylesheets]
@@ -32,5 +32,3 @@ section[
32
32
  ]
33
33
  ]
34
34
  ]
35
- ]
36
-
@@ -0,0 +1,33 @@
1
+ txt[
2
+ Sections can also be used to create _topics_. In a technical writing context, the term topic identifies a single page of an online help (e.g. a Compiled HTML file, or CHM). Topics should generally be:
3
+ * self-contained, in the sense that they should make sense on their own, ideally without the need to be read in sequence
4
+ * be used for either _concepts_, _tasks_ or _references_
5
+ * be divided into meaningful sections like _Introduction_, _Procedure_, _Result_
6
+
7
+ Glyph does not formally enforce the correctness of topic composition and usage, but it does enable authors to create them as a sort of external sections. Consider the following Glyph code:
8
+ ]
9
+ highlight[=html|
10
+ section[
11
+ @title[My First Topic]
12
+ @id[first_topic]
13
+ @src[test/first_topic.glyph]
14
+ ]
15
+ =]
16
+ txt[
17
+ This is an ordinary section with a title and an explicit ID, but it has no contents. Instead, its code[@src] attribute references an external file. If you are generating a single-file document, like a standalone HTML file or a PDF file, the code snippet above is exactly the same as the following:
18
+ ]
19
+ highlight[=html|
20
+ section[
21
+ @title[My First Topic]
22
+ @id[first_topic]
23
+ include[test/first_topic.glyph]
24
+ ]
25
+ =]
26
+ txt[
27
+ On the other hand, if you are planning on producing a document comprised of multiple files (see =>[#web_output]), the code[@src] attribute tells Glyph to create a _topic_ for the section. In this case:
28
+ * The code[@title] attribute must be specified and is used as the topic title
29
+ * The body of the topic is constituted by the contents of the file referenced by the code[@src] attribute.
30
+ * The topic file is rendered according to a specific =>[#layouts|layout].
31
+ * The location of the topic is the same as the location of the included file, mirrored in the output folder.
32
+ * Glyph takes care of changing the file extensions and resolving links automatically, regardless of the output target.
33
+ ]
@@ -0,0 +1,73 @@
1
+ p[Sure Textile and Markdown are great, but sometimes you may want to just use HTML, without the extra verbosity, of course. Take tables for example: Textile offers an easy way to create them, but things may get dirty when you need to have multiple paragraphs or lists within cells.]
2
+ p[Very early versions of Glyph used to offered some simple code[table], code[tr], code[tr], code[td] macros just for that. Of course the problem was that thy didn't offer any way to customize the markup by adding, for example, CSS classes.]
3
+ p[Instead, by default, Glyph can convert any unrecognized macro to the corresponding XML element and macro attributes to XML attributes.]
4
+ box[Example|
5
+ p[&[gcode]]
6
+ highlight[=html|
7
+ table[@class[features]
8
+ tr[
9
+ th[ID]
10
+ th[Priority]
11
+ th[Description]
12
+ ]
13
+ tr[
14
+ td[27]
15
+ td[span[@style[color:red;font-weight:bold;] HIGH]]
16
+ td[HTML output]
17
+ ]
18
+ tr[
19
+ td[42]
20
+ td[span[@style[color:green;font-weight:bols;] LOW]]
21
+ td[
22
+ p[Support for less-used tags:]
23
+ ul[
24
+ li[cite]
25
+ li[sup]
26
+ li[...]
27
+ ]
28
+ ]
29
+ ]
30
+ ]
31
+ =]
32
+ p[&[htmlcode]]
33
+ highlight[=html|
34
+ <table class="features">
35
+ <tr>
36
+ <th>ID</th>
37
+ <th>Priority</th>
38
+ <th>Description</th>
39
+ </tr>
40
+ <tr>
41
+ <td>27</td>
42
+ <td><span style="color:red;font-weight:bold;">HIGH</span></td>
43
+ <td>HTML output</td>
44
+ </tr>
45
+ <tr>
46
+ <td>42</td>
47
+ <td><span style="color:green;font-weight:bold;">LOW</span></td>
48
+ <td>
49
+ <p>Support for less-used tags:</p>
50
+ <ul>
51
+ <li>cite</li>
52
+ <li>sup</li>
53
+ <li>...</li>
54
+ </ul>
55
+ </td>
56
+ </tr>
57
+ </table>
58
+ =]
59
+ ]
60
+ p[Basically, if the $>[options.xml_fallback] is set to code[true], any macro unknown to Glyph with at most one parameter will be converted to an XML tag with the same name and any attribute will be converted to the corresponding XML attribute.]
61
+ important[While macro names and attributes are validated so that an error is returned if they contain illegal character, no check is performed against any particular XML schema.]
62
+ txt[Additionally, it is possible to force macro-to-XML conversion by prepending an equal sign to any macro, so for example code[=\.=snippet[test]=] will be converted into @<snippet>test</snippet>@.]
63
+ section[
64
+ @title[Blacklisted XML tags]
65
+ @id[xml_blacklist]
66
+ txt[
67
+ By default, the following tags are blacklisted and will be ignored:
68
+ %[=Glyph['options.xml_blacklist'].map{\|v\| "* @#{v}@"}.join("\n")=]
69
+
70
+ tip[You can change this list by modifying the $>[options.xml_blacklist].]
71
+ ]
72
+
73
+ ]
@@ -1,5 +1,3 @@
1
- section[
2
- @title[Command Errors]
3
1
  error_table[
4
2
  ref_error[Source file '\.em[source_file]' does not exist|
5
3
  Returned if Glyph is running in =>[#lite_mode|lite mode] and the specified source file was not found.
@@ -36,4 +34,3 @@ The name of an unknown setting was specified for the #>[config].
36
34
  Returned by the #>[config] when attempting to override a setting in the code[system.*] namespace.
37
35
  ]
38
36
  ]
39
- ]
@@ -1,8 +1,6 @@
1
- section[
2
- @title[Generic Errors]
3
1
  error_table[
4
2
  ref_error[Invalid alias: macro '\.em[macro_name]' already exists|
5
- The alias name supplied to the @macro_alias@ method has already been used for another macro or alias.
3
+ The alias name supplied to the code[macro_alias] method has already been used for another macro or alias.
6
4
  ]
7
5
  ref_error[Undefined macro '\.em[macro_name]'|
8
6
  The document contains a macro that does not exist, i.e. it is not a standard or used-defined =>[#macro_ref|Glyph macro or alias].
@@ -10,8 +8,8 @@ The document contains a macro that does not exist, i.e. it is not a standard or
10
8
  ref_error[An error occurred when generating _file-name_.pdf|
11
9
  Returned if Prince could not generate the PDF file or if Prince is not installed. Normally, Prince provides additional details on the specific error(s).
12
10
  ]
13
- ref_error[Glyph cannot generate PDF. Please specify a valid tools.pdf_generator setting|
14
- Returned if the $>[tools.pdf_generator] has not be set to a valid PDF renderer. Currently, the only supported value for this setting is code[prince].
11
+ ref_error[Glyph cannot generate PDF. Please specify a valid output.pdf.generator setting|
12
+ Returned if the $>[output.pdf.generator] has not be set to a valid PDF renderer. Currently, the only supported values for this setting are code[prince] and code[wkhtmltopdf].
15
13
  ]
16
14
  ref_error[The current directory is not a valid Glyph project|
17
15
  Returned if a glyph command was executed outside a valid glyph project directory.
@@ -25,5 +23,22 @@ The code[snippet.yml] file contains invalid data. Most likely, it does not evalu
25
23
  ref_error[File '\.em[file_name]' already exists|
26
24
  Returned if the name of an existing file was specified as a parameter for the #>[add].
27
25
  ]
26
+ ref_error[Unknown macro '\.em[macro_name]'|
27
+ Returned by the #>[stats] if the specified macro was not found.
28
+ ]
29
+ ref_error[Macro '\.em[macro_name]' is not used in this document|
30
+ Returned by the #>[stats] if the specified macro is defined but unused.
31
+ ]
32
+ ref_error[Bookmark '\.em[bookmark_name]' does not exist|
33
+ Returned by the #>[stats] if the specified bookmark does not exist.
34
+ ]
35
+ ref_error[No link matching /\.em[regexp]/ was found|
36
+ Returned by the #>[stats] if the no link target matches the supplied regular expression.
37
+ ]
38
+ ref_error[Unknown snippet '\.em[snippet_name]'|
39
+ Returned by the #>[stats] if the specified snippet was not found.
40
+ ]
41
+ ref_error[Snippet '\.em[snippet_name]' is not used in this document|
42
+ Returned by the #>[stats] if the specified snippet is defined but unused.
43
+ ]
28
44
  ]
29
- ]
@@ -1,5 +1,3 @@
1
- section[
2
- @title[Macro Errors]
3
1
  txt[
4
2
  The following errors are displayed in the form:
5
3
 
@@ -29,7 +27,7 @@ Returned if the macro was called with a different number of parameters than.
29
27
  Returned by the %>[include] if used in =>[#lite_mode|lite mode].
30
28
  ]
31
29
  ref_error[Filter macro '\.em[extension]' not available|
32
- Returned by a filter macro if $>[filters.by_file_extension] is set to @true@, but the extension was not recognized.
30
+ Returned by a filter macro if $>[options.filters_by_file_extension] is set to @true@, but the extension was not recognized.
33
31
  ]
34
32
  ref_error[Invalid regular expression: em[regexp]|
35
33
  Returned by the %>[match] if an invalid regular expression was supplied.
@@ -56,7 +54,7 @@ Returned by the %>[snippet] if an invalid snippet ID was supplied.
56
54
  Returned by the %>[include] if an invalid file was supplied.
57
55
  ]
58
56
  ref_error[Filter macro '\.em[macro_name]' not found|
59
- Returned by the %>[include] if the $>[filters.by_file_extension] is set to @true@ but the file extension of the included file is not recognized as a filter macro.
57
+ Returned by the %>[include] if the $>[options.filters_by_file_extension] is set to @true@ but the file extension of the included file is not recognized as a filter macro.
60
58
  ]
61
59
  ref_error[RedCloth gem not installed. Please run: gem install RedCloth|
62
60
  Returned by the %>[textile] if the RedCloth gem is not installed.
@@ -89,10 +87,15 @@ An invalid XML attribute name was supplied to the code[\|xml\|] system macro (se
89
87
  Returned if a forbidden macro was used in safe mode (see =>[#modes]).
90
88
  ]
91
89
  ref_error[Cannot reset 'system.\.em[setting_name]' setting (system use only).|
92
- Returned by the =>[config:] when attempting to override a setting in the code[system.*] namespace.
90
+ Returned by the =>[#m_config_] when attempting to override a setting in the code[system.*] namespace.
93
91
  ]
94
92
  ref_error[Macro '\.em[macro_name]' cannot be defined by itself|
95
- Returned by the =>[rewrite:] if it contains a macro with the same name.
96
- ]
93
+ Returned by the =>[#m_rewrite_] if it contains a macro with the same name.
94
+ ]
95
+ ref_error[Macro '\.em[macro_a]' must be within a '\.em[macro_b]' macro|
96
+ Returned if a macro was used in the wrong place.
97
+ ]
98
+ ref_error[Macro '\.em[macro_a]' must not be within a '\.em[macro_b]' macro|
99
+ Returned if a macro was used in the wrong place.
100
+ ]
97
101
  ]
98
- ]
@@ -1,5 +1,3 @@
1
- section[
2
- @title[Parsing Errors]
3
1
  error_table[
4
2
  ref_error[Macro delimiter '\.em[delimiter]' not escaped|
5
3
  Returned in case of unescaped code[\[]or code[\]].
@@ -26,4 +24,3 @@ Returned if an escaping macro contains another escaping macro.
26
24
  Returned if a parameter delimiter is outside a macro or inside an attribute.
27
25
  ]
28
26
  ]
29
- ]
data/config.yml CHANGED
@@ -6,32 +6,68 @@
6
6
  :filename: ""
7
7
  :revision: ""
8
8
  :draft: false
9
- :output: 'html'
10
- :language:
11
- :set: 'glyph' # xml, core, filters
12
- :options:
13
- :xml_fallback: true
14
- :xml_blacklist:
15
- - applet
16
- - base
17
- - basefont
18
- - embed
19
- - frame
20
- - frameset
21
- - iframe
22
- - isindex
23
- - meta
24
- - noframes
25
- - noscript
26
- - object
27
- - param
28
- - title
29
- :tools:
30
- :pdf_generator: 'prince'
9
+ :output: html
10
+ :styles: embed # link, import
11
+ :options:
12
+ :url_validation: false
13
+ :macro_set: 'glyph' # core, xml, filters
14
+ :safe_mode: false
15
+ :filter_by_file_extension: true
16
+ :xml_fallback: true
17
+ :xml_blacklist:
18
+ - applet
19
+ - base
20
+ - basefont
21
+ - embed
22
+ - frame
23
+ - frameset
24
+ - iframe
25
+ - isindex
26
+ - meta
27
+ - noframes
28
+ - noscript
29
+ - object
30
+ - param
31
+ - title
32
+ :output:
33
+ :html:
34
+ :multifile: false
35
+ :extension: '.html'
36
+ :filter_target: 'html'
37
+ :macro_dirs: ['html']
38
+ :html5:
39
+ :multifile: false
40
+ :extension: '.html'
41
+ :filter_target: 'html'
42
+ :macro_dirs: ['html', 'html5']
43
+ :pdf:
44
+ :multifile: false
45
+ :extension: '.pdf'
46
+ :filter_target: 'html'
47
+ :generator: 'wkhtmltopdf'
48
+ :macro_dirs: ['html']
49
+ :web:
50
+ :multifile: true
51
+ :extension: '.html'
52
+ :filter_target: 'html'
53
+ :macro_dirs: ['html']
54
+ :layout_dirs: ['web']
55
+ :layouts:
56
+ :topic: 'topic'
57
+ :index: 'index'
58
+ :base: "/"
59
+ :web5:
60
+ :multifile: true
61
+ :extension: '.html'
62
+ :filter_target: 'html'
63
+ :macro_dirs: ['html', 'html5']
64
+ :layout_dirs: ['web5']
65
+ :layouts:
66
+ :topic: 'topic'
67
+ :index: 'index'
68
+ :base: "/"
31
69
  :filters:
32
- :by_file_extension: true
33
70
  :highlighter: 'coderay'
34
- :target: 'html'
35
71
  :markdown:
36
72
  :converter: 'bluecloth'
37
73
  :redcloth:
@@ -44,7 +80,6 @@
44
80
  :theme: 'lazy'
45
81
  :system:
46
82
  :quiet: false
47
- :output_targets: [:html, :pdf]
48
83
  :structure:
49
84
  :hidden:
50
85
  - :imprint
data/glyph.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{glyph}
8
- s.version = "0.3.0"
8
+ s.version = "0.4.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Fabio Cevasco"]
12
- s.date = %q{2010-06-13}
12
+ s.date = %q{2010-09-03}
13
13
  s.default_executable = %q{glyph}
14
14
  s.description = %q{Glyph is a framework for structured document authoring.}
15
15
  s.email = %q{h3rald@h3rald.com}
@@ -19,7 +19,8 @@ Gem::Specification.new do |s|
19
19
  "README.textile"
20
20
  ]
21
21
  s.files = [
22
- "AUTHORS.textile",
22
+ ".gitignore",
23
+ "AUTHORS.textile",
23
24
  "CHANGELOG.textile",
24
25
  "LICENSE.textile",
25
26
  "README.textile",
@@ -29,33 +30,40 @@ Gem::Specification.new do |s|
29
30
  "bin/glyph",
30
31
  "book/config.yml",
31
32
  "book/document.glyph",
32
- "book/images/document_generation.png",
33
- "book/images/glyph.png",
34
- "book/images/glyph.svg",
33
+ "book/images/glyph/commands_tasks.png",
34
+ "book/images/glyph/document_generation.png",
35
+ "book/images/glyph/glyph.eps",
36
+ "book/images/glyph/glyph.png",
37
+ "book/images/glyph/glyph.svg",
38
+ "book/lib/commands/commands.rb",
39
+ "book/lib/layouts/bookindex.glyph",
40
+ "book/lib/layouts/bookpage.glyph",
41
+ "book/lib/layouts/project.glyph",
35
42
  "book/lib/macros/reference.rb",
36
- "book/output/html/glyph.html",
37
- "book/output/html/images/document_generation.png",
38
- "book/output/html/images/glyph.png",
39
- "book/output/html/images/glyph.svg",
40
- "book/output/pdf/glyph.pdf",
43
+ "book/lib/tasks/tasks.rake",
41
44
  "book/resources/document_generation.txt",
42
- "book/script/authors",
43
- "book/script/changelog",
44
- "book/script/license",
45
- "book/script/readme",
46
45
  "book/snippets.yml",
47
- "book/text/acknowledgement.glyph",
46
+ "book/text/acknowledgements.glyph",
48
47
  "book/text/changelog.glyph",
49
48
  "book/text/compiling/compiling.glyph",
50
49
  "book/text/compiling/lite_mode.glyph",
51
50
  "book/text/compiling/programmatic_usage.glyph",
51
+ "book/text/config/document.glyph",
52
+ "book/text/config/filters.glyph",
53
+ "book/text/config/options.glyph",
54
+ "book/text/config/output.glyph",
52
55
  "book/text/extending/bookmarks_headers.glyph",
56
+ "book/text/extending/command.glyph",
57
+ "book/text/extending/commands_tasks.glyph",
53
58
  "book/text/extending/further_reading.glyph",
54
59
  "book/text/extending/internals.glyph",
55
60
  "book/text/extending/interpreting.glyph",
61
+ "book/text/extending/layouts.glyph",
56
62
  "book/text/extending/macro_def.glyph",
63
+ "book/text/extending/output_format.glyph",
57
64
  "book/text/extending/params_attrs.glyph",
58
65
  "book/text/extending/placeholders.glyph",
66
+ "book/text/extending/task.glyph",
59
67
  "book/text/extending/validators.glyph",
60
68
  "book/text/getting_started/configuration.glyph",
61
69
  "book/text/getting_started/create_project.glyph",
@@ -68,10 +76,15 @@ Gem::Specification.new do |s|
68
76
  "book/text/macros/macros_inline.glyph",
69
77
  "book/text/macros/macros_structure.glyph",
70
78
  "book/text/ref_commands.glyph",
71
- "book/text/ref_config.glyph",
72
- "book/text/ref_macros.glyph",
79
+ "book/text/stats/bookmarks.glyph",
80
+ "book/text/stats/links.glyph",
81
+ "book/text/stats/macros.glyph",
82
+ "book/text/stats/snippets.glyph",
83
+ "book/text/stats/stats.glyph",
84
+ "book/text/text_editing/attribute_intro.glyph",
73
85
  "book/text/text_editing/code.glyph",
74
86
  "book/text/text_editing/conditionals.glyph",
87
+ "book/text/text_editing/esc_quot.glyph",
75
88
  "book/text/text_editing/evaluation.glyph",
76
89
  "book/text/text_editing/glyph_files.glyph",
77
90
  "book/text/text_editing/images.glyph",
@@ -79,41 +92,71 @@ Gem::Specification.new do |s|
79
92
  "book/text/text_editing/links.glyph",
80
93
  "book/text/text_editing/macro_intro.glyph",
81
94
  "book/text/text_editing/raw_html.glyph",
95
+ "book/text/text_editing/section_aliases.glyph",
82
96
  "book/text/text_editing/sections.glyph",
83
97
  "book/text/text_editing/stylesheets.glyph",
98
+ "book/text/text_editing/topics.glyph",
99
+ "book/text/text_editing/xml_fallback.glyph",
84
100
  "book/text/troubleshooting/errors_command.glyph",
85
101
  "book/text/troubleshooting/errors_generic.glyph",
86
- "book/text/troubleshooting/errors_intro.glyph",
87
102
  "book/text/troubleshooting/errors_macro.glyph",
88
103
  "book/text/troubleshooting/errors_parser.glyph",
89
104
  "config.yml",
90
105
  "document.glyph",
91
106
  "glyph.gemspec",
107
+ "layouts/web/index.glyph",
108
+ "layouts/web/topic.glyph",
109
+ "layouts/web5/index.glyph",
110
+ "layouts/web5/topic.glyph",
92
111
  "lib/glyph.rb",
112
+ "lib/glyph/analyzer.rb",
113
+ "lib/glyph/bookmark.rb",
93
114
  "lib/glyph/commands.rb",
115
+ "lib/glyph/commands/add.rb",
116
+ "lib/glyph/commands/compile.rb",
117
+ "lib/glyph/commands/config.rb",
118
+ "lib/glyph/commands/init.rb",
119
+ "lib/glyph/commands/outline.rb",
120
+ "lib/glyph/commands/stats.rb",
121
+ "lib/glyph/commands/todo.rb",
94
122
  "lib/glyph/config.rb",
95
123
  "lib/glyph/document.rb",
96
124
  "lib/glyph/interpreter.rb",
97
125
  "lib/glyph/macro.rb",
126
+ "lib/glyph/macro_helpers.rb",
98
127
  "lib/glyph/macro_validators.rb",
99
128
  "lib/glyph/node.rb",
100
129
  "lib/glyph/parser.rb",
130
+ "lib/glyph/reporter.rb",
101
131
  "lib/glyph/syntax_node.rb",
102
132
  "lib/glyph/system_extensions.rb",
133
+ "lib/glyph/utils.rb",
103
134
  "macros/core.rb",
104
135
  "macros/filters.rb",
105
136
  "macros/html/block.rb",
106
137
  "macros/html/inline.rb",
107
138
  "macros/html/structure.rb",
139
+ "macros/html5/block.rb",
140
+ "macros/html5/inline.rb",
141
+ "macros/html5/structure.rb",
108
142
  "macros/xml.rb",
109
143
  "spec/files/article.glyph",
110
144
  "spec/files/container.textile",
145
+ "spec/files/custom_command.rb",
146
+ "spec/files/custom_tasks.rake",
111
147
  "spec/files/document.glyph",
148
+ "spec/files/document_for_stats.glyph",
112
149
  "spec/files/document_with_toc.glyph",
113
150
  "spec/files/included.textile",
114
151
  "spec/files/ligature.jpg",
115
152
  "spec/files/markdown.markdown",
153
+ "spec/files/references.glyph",
116
154
  "spec/files/test.sass",
155
+ "spec/files/web1.glyph",
156
+ "spec/files/web2.glyph",
157
+ "spec/files/web_doc.glyph",
158
+ "spec/lib/analyzer_spec.rb",
159
+ "spec/lib/bookmark_spec.rb",
117
160
  "spec/lib/commands_spec.rb",
118
161
  "spec/lib/config_spec.rb",
119
162
  "spec/lib/document_spec.rb",
@@ -123,11 +166,15 @@ Gem::Specification.new do |s|
123
166
  "spec/lib/macro_validators_spec.rb",
124
167
  "spec/lib/node_spec.rb",
125
168
  "spec/lib/parser_spec.rb",
169
+ "spec/lib/reporter_spec.rb",
126
170
  "spec/lib/syntax_node_spec.rb",
127
171
  "spec/macros/core_spec.rb",
128
172
  "spec/macros/filters_spec.rb",
173
+ "spec/macros/html5_spec.rb",
129
174
  "spec/macros/macros_spec.rb",
130
175
  "spec/macros/textile_spec.rb",
176
+ "spec/macros/web5_spec.rb",
177
+ "spec/macros/web_spec.rb",
131
178
  "spec/macros/xml_spec.rb",
132
179
  "spec/spec_helper.rb",
133
180
  "spec/tasks/generate_spec.rb",
@@ -164,17 +211,22 @@ Gem::Specification.new do |s|
164
211
  s.homepage = %q{http://www.h3rald.com/glyph/}
165
212
  s.rdoc_options = ["--charset=UTF-8"]
166
213
  s.require_paths = ["lib"]
167
- s.rubygems_version = %q{1.3.6}
214
+ s.rubygems_version = %q{1.3.7}
168
215
  s.summary = %q{Glyph -- A Ruby-powered Document Authoring Framework}
169
216
  s.test_files = [
170
217
  "spec/macros/core_spec.rb",
218
+ "spec/macros/web_spec.rb",
219
+ "spec/macros/html5_spec.rb",
171
220
  "spec/macros/filters_spec.rb",
221
+ "spec/macros/web5_spec.rb",
172
222
  "spec/macros/textile_spec.rb",
173
223
  "spec/macros/xml_spec.rb",
174
224
  "spec/macros/macros_spec.rb",
175
225
  "spec/lib/interpreter_spec.rb",
226
+ "spec/lib/analyzer_spec.rb",
176
227
  "spec/lib/commands_spec.rb",
177
228
  "spec/lib/node_spec.rb",
229
+ "spec/lib/bookmark_spec.rb",
178
230
  "spec/lib/macro_spec.rb",
179
231
  "spec/lib/macro_validators_spec.rb",
180
232
  "spec/lib/config_spec.rb",
@@ -182,9 +234,11 @@ Gem::Specification.new do |s|
182
234
  "spec/lib/parser_spec.rb",
183
235
  "spec/lib/syntax_node_spec.rb",
184
236
  "spec/lib/document_spec.rb",
237
+ "spec/lib/reporter_spec.rb",
185
238
  "spec/tasks/load_spec.rb",
186
239
  "spec/tasks/generate_spec.rb",
187
240
  "spec/tasks/project_spec.rb",
241
+ "spec/files/custom_command.rb",
188
242
  "spec/spec_helper.rb"
189
243
  ]
190
244
 
@@ -192,40 +246,40 @@ Gem::Specification.new do |s|
192
246
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
193
247
  s.specification_version = 3
194
248
 
195
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
196
- s.add_runtime_dependency(%q<gli>, [">= 0.3.1"])
197
- s.add_runtime_dependency(%q<extlib>, [">= 0.9.12"])
249
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
250
+ s.add_runtime_dependency(%q<gli>, [">= 1.1.1"])
251
+ s.add_runtime_dependency(%q<extlib>, [">= 0.9.15"])
198
252
  s.add_runtime_dependency(%q<rake>, [">= 0.8.7"])
199
- s.add_development_dependency(%q<rspec>, [">= 1.1.11"])
200
- s.add_development_dependency(%q<yard>, [">= 1.5.4"])
253
+ s.add_development_dependency(%q<rspec>, [">= 1.3.0"])
254
+ s.add_development_dependency(%q<yard>, [">= 0.6.0"])
201
255
  s.add_development_dependency(%q<jeweler>, ["= 1.4.0"])
202
256
  s.add_development_dependency(%q<directory_watcher>, [">= 1.3.2"])
203
- s.add_development_dependency(%q<haml>, [">= 3.0.6"])
257
+ s.add_development_dependency(%q<haml>, [">= 3.0.15"])
204
258
  s.add_development_dependency(%q<RedCloth>, [">= 4.2.3"])
205
259
  s.add_development_dependency(%q<bluecloth>, [">= 2.0.7"])
206
260
  s.add_development_dependency(%q<coderay>, [">= 0.9.3"])
207
261
  else
208
- s.add_dependency(%q<gli>, [">= 0.3.1"])
209
- s.add_dependency(%q<extlib>, [">= 0.9.12"])
262
+ s.add_dependency(%q<gli>, [">= 1.1.1"])
263
+ s.add_dependency(%q<extlib>, [">= 0.9.15"])
210
264
  s.add_dependency(%q<rake>, [">= 0.8.7"])
211
- s.add_dependency(%q<rspec>, [">= 1.1.11"])
212
- s.add_dependency(%q<yard>, [">= 1.5.4"])
265
+ s.add_dependency(%q<rspec>, [">= 1.3.0"])
266
+ s.add_dependency(%q<yard>, [">= 0.6.0"])
213
267
  s.add_dependency(%q<jeweler>, ["= 1.4.0"])
214
268
  s.add_dependency(%q<directory_watcher>, [">= 1.3.2"])
215
- s.add_dependency(%q<haml>, [">= 3.0.6"])
269
+ s.add_dependency(%q<haml>, [">= 3.0.15"])
216
270
  s.add_dependency(%q<RedCloth>, [">= 4.2.3"])
217
271
  s.add_dependency(%q<bluecloth>, [">= 2.0.7"])
218
272
  s.add_dependency(%q<coderay>, [">= 0.9.3"])
219
273
  end
220
274
  else
221
- s.add_dependency(%q<gli>, [">= 0.3.1"])
222
- s.add_dependency(%q<extlib>, [">= 0.9.12"])
275
+ s.add_dependency(%q<gli>, [">= 1.1.1"])
276
+ s.add_dependency(%q<extlib>, [">= 0.9.15"])
223
277
  s.add_dependency(%q<rake>, [">= 0.8.7"])
224
- s.add_dependency(%q<rspec>, [">= 1.1.11"])
225
- s.add_dependency(%q<yard>, [">= 1.5.4"])
278
+ s.add_dependency(%q<rspec>, [">= 1.3.0"])
279
+ s.add_dependency(%q<yard>, [">= 0.6.0"])
226
280
  s.add_dependency(%q<jeweler>, ["= 1.4.0"])
227
281
  s.add_dependency(%q<directory_watcher>, [">= 1.3.2"])
228
- s.add_dependency(%q<haml>, [">= 3.0.6"])
282
+ s.add_dependency(%q<haml>, [">= 3.0.15"])
229
283
  s.add_dependency(%q<RedCloth>, [">= 4.2.3"])
230
284
  s.add_dependency(%q<bluecloth>, [">= 2.0.7"])
231
285
  s.add_dependency(%q<coderay>, [">= 0.9.3"])