glyph 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. data/README.textile +80 -0
  2. data/Rakefile +51 -0
  3. data/VERSION +1 -0
  4. data/bin/glyph +7 -0
  5. data/book/config.yml +5 -0
  6. data/book/document.glyph +55 -0
  7. data/book/images/glyph.png +0 -0
  8. data/book/images/glyph.svg +351 -0
  9. data/book/lib/macros/reference.rb +98 -0
  10. data/book/output/html/glyph.html +1809 -0
  11. data/book/output/html/images/glyph.png +0 -0
  12. data/book/output/html/images/glyph.svg +351 -0
  13. data/book/output/pdf/glyph.pdf +4277 -0
  14. data/book/snippets.yml +13 -0
  15. data/book/styles/css3.css +220 -0
  16. data/book/styles/default.css +190 -0
  17. data/book/text/authoring.textile +351 -0
  18. data/book/text/extending.textile +148 -0
  19. data/book/text/getting_started.textile +152 -0
  20. data/book/text/introduction.textile +88 -0
  21. data/book/text/ref_commands.textile +74 -0
  22. data/book/text/ref_config.textile +0 -0
  23. data/book/text/ref_macros.textile +256 -0
  24. data/book/text/troubleshooting.textile +118 -0
  25. data/config.yml +63 -0
  26. data/document.glyph +29 -0
  27. data/glyph.gemspec +138 -0
  28. data/lib/glyph.rb +128 -0
  29. data/lib/glyph/commands.rb +124 -0
  30. data/lib/glyph/config.rb +152 -0
  31. data/lib/glyph/document.rb +145 -0
  32. data/lib/glyph/glyph_language.rb +530 -0
  33. data/lib/glyph/glyph_language.treetop +27 -0
  34. data/lib/glyph/interpreter.rb +84 -0
  35. data/lib/glyph/macro.rb +69 -0
  36. data/lib/glyph/node.rb +126 -0
  37. data/lib/glyph/system_extensions.rb +77 -0
  38. data/macros/common.rb +66 -0
  39. data/macros/filters.rb +69 -0
  40. data/macros/html/block.rb +119 -0
  41. data/macros/html/inline.rb +43 -0
  42. data/macros/html/structure.rb +138 -0
  43. data/spec/files/container.textile +5 -0
  44. data/spec/files/document.glyph +2 -0
  45. data/spec/files/document_with_toc.glyph +3 -0
  46. data/spec/files/included.textile +4 -0
  47. data/spec/files/ligature.jpg +449 -0
  48. data/spec/files/markdown.markdown +8 -0
  49. data/spec/files/test.sass +2 -0
  50. data/spec/lib/commands_spec.rb +83 -0
  51. data/spec/lib/config_spec.rb +79 -0
  52. data/spec/lib/document_spec.rb +100 -0
  53. data/spec/lib/glyph_spec.rb +76 -0
  54. data/spec/lib/interpreter_spec.rb +90 -0
  55. data/spec/lib/macro_spec.rb +60 -0
  56. data/spec/lib/node_spec.rb +76 -0
  57. data/spec/macros/filters_spec.rb +42 -0
  58. data/spec/macros/macros_spec.rb +159 -0
  59. data/spec/spec_helper.rb +92 -0
  60. data/spec/tasks/generate_spec.rb +31 -0
  61. data/spec/tasks/load_spec.rb +37 -0
  62. data/spec/tasks/project_spec.rb +41 -0
  63. data/styles/css3.css +220 -0
  64. data/styles/default.css +190 -0
  65. data/tasks/generate.rake +57 -0
  66. data/tasks/load.rake +55 -0
  67. data/tasks/project.rake +33 -0
  68. metadata +192 -0
@@ -0,0 +1,148 @@
1
+ Glyph was created wih extensibility in mind. You can freely extend &[glang] by creating or overriding macros, to do whatever you like. Macro definitions are written in pure Ruby code and placed in @.rb@ files within the @/lib/macros@ folder of your project.
2
+
3
+ section[header[Anatomy of a Macro]
4
+
5
+ This is the source code of a fairly simple macro used to format a note :
6
+
7
+ <notextile>
8
+ code[=
9
+ macro :note do
10
+ %{<div class="#{@name}"><span class="note-title">#{@name.to_s.capitalize}</span>#{@value}
11
+
12
+ </div>}
13
+ end
14
+ =]
15
+ </notextile>
16
+
17
+ The @macro@ method takes a single Symbol or String parameter, corresponding to the name of the macro. In this case, the entire block (or _body_ of the macro) is a String corresponding to what we want the macro to evaluate to: a @<div>@ tag containing a note.
18
+
19
+ The body of the macro is evaluated in the context of the =>[http://yardoc.org/docs/h3rald-glyph/Glyph/Macro|Glyph::Macro] class, therefore its instance variables (like codeph[@name] or codeph[@value]) can be used directly.
20
+
21
+ box[Why using codeph[@name] instead of just "note"?|
22
+ For the @note@ macro, it absolutely makes no difference. However, by using codeph[@name] it is possible to re-use the same code for the @tip@, @important@ and @caution@ macros as well, which are in fact only aliases of the @note@ macro:
23
+
24
+ @macro_alias :important => :note@
25
+ @macro_alias :tip => :note@
26
+ @macro_alias :caution => :note@
27
+ ] --[End box]
28
+
29
+ The following table lists all the instance variables that can be used inside macros:
30
+
31
+ table[
32
+ tr[
33
+ th[Variable]
34
+ th[Description]
35
+ ]
36
+ tr[
37
+ td[codeph[@node]]
38
+ td[A =>[http://yardoc.org/docs/h3rald-glyph/Node|Node] containing information about the macro, within the document syntax tree. Useful for accessing parent and child macros, and the current =>[http://yardoc.org/docs/h3rald-glyph/Glyph/Document|document]. Normally, macro nodes contain the following keys:
39
+ - @:name@, the name of the macro
40
+ - @:value@, the value (i.e. the contents, within the delimiters) of the macro
41
+ - @:source@, a String identifying the source of the macro (a file, a snippet, etc.)
42
+ - @:document@, the parsed document tree
43
+
44
+ Note that the first three keys can also be accessed via instance variables.]
45
+ ]
46
+ tr[
47
+ td[codeph[@name]]
48
+ td[The name of the macro]
49
+ ]
50
+ tr[
51
+ td[codeph[@value]]
52
+ td[The full contents (including parameters and nested macros) within the macro delimiters.]
53
+ ]
54
+ tr[
55
+ td[codeph[@source]]
56
+ td[A String identifying the source of the macro (a file, a snippet, etc.) ]
57
+ ]
58
+ tr[
59
+ td[codeph[@params]]
60
+ td[The parameters passed to the macro. In other words, the value of the macro split by pipes (@|@).]
61
+ ]
62
+ ] --[End Table]
63
+
64
+ ]
65
+
66
+ section[header[Bookmarks and Headers]
67
+
68
+ The =>[http://yardoc.org/docs/h3rald-glyph/Glyph/Macro|Glyph::Macro] class also includes a few methods to check and store bookmarks and headers. Consider for example the following source code for the @anchor@ macro:
69
+
70
+ <notextile>
71
+ code[=
72
+ macro :anchor do
73
+ ident, title = @params
74
+ macro_error "Bookmark '#{ident}' already exists" if bookmark? ident
75
+ bookmark :id => ident, :title => title
76
+ %{<a id="#{ident}">#{title}</a>}
77
+ end
78
+ =] </notextile>
79
+
80
+ The @bookmark?@ method can be used to check the existance of a particular ID within the whole document, while the @bookmark@ method is used to store bookmark IDs and titles. In a similar way, you can use @header?@ and @header@ methods to check the existance of headers within the documents or store new ones.
81
+
82
+ ]
83
+
84
+ section[header[Using Placeholders]
85
+
86
+ Sometimes you may need to access some data that will not be available until the entire document has been fully parsed and analyzed. For example, in order to be able to validate internal links, it is necessary to know in advance if the bookmark ID referenced in the link exists or not, either before (that's easy) or even _after_ the location of the link.
87
+
88
+ Here's the source code of the @link@ macro:
89
+
90
+ <notextile>
91
+ code[=
92
+ macro :link do
93
+ href, title = @params
94
+ if href.match /^#/ then
95
+ anchor = href.gsub(/^#/, '').to_sym
96
+ bmk = bookmark? anchor
97
+ if bmk then
98
+ title ||= bmk[:title]
99
+ else
100
+ plac = placeholder do |document|
101
+ macro_error "Bookmark '#{anchor}' does not exist" unless document.bookmarks[anchor]
102
+ document.bookmarks[anchor][:title]
103
+ end
104
+ title ||= plac
105
+ end
106
+ end
107
+ title ||= href
108
+ %{<a href="#{href}">#{title}</a>}
109
+ end
110
+ =] </notextile>
111
+
112
+ If there's already a bookmark stored in the current document, then it is possible to retrieve its title and use it as link text. Otherwise, it is necessary to wait until the entire document has been fully processed and then check if the bookmark exists. To do so, use the @placeholder@ method. When called, this method returns an unique placeholder, which is then substituted with the value of the block, right before the document is finalized.
113
+
114
+ Within the @placeholder@ block, the @document@ parameter is, by all means, the fully analyzed document.
115
+ ]
116
+
117
+ section[header[Interpreting Glyph Code]
118
+
119
+ What if you need to evaluate some Glyph code _within_ a macro? Say for example you want to transform a parameter in a link, and you want to make sure that link gets validated exactly like the others, in this case, you can use the @interpret@ method, as follows:
120
+
121
+ <notextile>
122
+ code[=
123
+ macro :fmi do
124
+ topic, href = @params
125
+ link = placeholder do |document|
126
+ interpret "link[#{href}]"
127
+ end
128
+ %{<span class="fmi">for more information on #{topic}, see #{link}</span>}
129
+ end
130
+ =] </notextile>
131
+
132
+ When the @interpreter@ method is called, the following happens:
133
+ # A new Glyph document is created from the String passed to the method.
134
+ # The bookmarks, headers and placeholders are passed from the main document to the new one. Because they are stored in Arrays or Hashes, they are passed by reference, so for example any new bookmark stored in the new document will also become available in the main document.
135
+ # Any macro included in the String is evaluated, and the resulting text is returned by the method. Note that this new document does not get finalized: in other words, placeholders will be left as they are, and they'll eventually be replaced when _the main document_ is finalized.
136
+
137
+ ]
138
+
139
+ section[header[Further Reading]
140
+
141
+ For more examples on how to create more complex macros, have a look at the =>[http://github.com/h3rald/glyph/tree/master/macros/|source code] of the existing ones.
142
+
143
+ To gain a deeper understanding on how macros are executed, have a look at the following Glyph classes:
144
+ * =>[http://yardoc.org/docs/h3rald-glyph/Glyph/Macro|Glyph::Macro]
145
+ * =>[http://yardoc.org/docs/h3rald-glyph/Glyph/Interpreter|Glyph::Interpreter]
146
+ * =>[http://yardoc.org/docs/h3rald-glyph/Glyph/Document|Glyph::Document]
147
+ * =>[http://yardoc.org/docs/h3rald-glyph/Glyph/Node|Node]
148
+ ]
@@ -0,0 +1,152 @@
1
+ section[header[Creating your first Glyph Project]
2
+
3
+ To install Glyph, simply run @gem install glyph@, like with any other Ruby gem. Then, create a new directory and initialize a new Glyph project, like so:
4
+
5
+ @mkdir@ _==test_document==_
6
+
7
+ @cd@ _==test_document==_
8
+
9
+ @glyph init@
10
+
11
+ That's it. You just created a new Glyph project in the @test_document@ directory.
12
+
13
+ box[Glyph's dependencies|
14
+ Glyph requires the following gems:
15
+ - extlib
16
+ - gli
17
+ - treetop
18
+ - rake
19
+
20
+ Additionally, some Glyph macros may require additional gems, such as:
21
+ - RedCloth (_textile_ macro)
22
+ - Maruku _or_ Kramdown _or_ BlueCloth (_markdown_ macro)
23
+ - Haml (if you want to load .sass files with the _style_ macro)
24
+ ]
25
+
26
+ Every Glyph project is comprised of the following directories:
27
+ * @images/@ -- used to store the image files used in your document.
28
+ * @lib/@ -- used to store your custom Glyph macros and Rake tasks.
29
+ * @output/@ -- used to store your generated output files.
30
+ * @styles/@ -- used to store your stylesheets.
31
+ * @text/*@ -- used to store your source text files.
32
+
33
+ Additionally, the following files are also created at top level:
34
+ * @config.yml@ -- containing your =>[#cfg|Project Configuration].
35
+ * @document.glyph@ -- containing your =>[#struct|Document Structure]
36
+ * @snippets.yml@ -- containing your text snippets. todo[Link to Snippets section]
37
+
38
+ ]
39
+
40
+ section[header[Document Structure|struct]
41
+
42
+ Every Glyph project contains a @document.glyph@ file that is typically used to define the document structure. The default @document.glyph@
43
+ generated automatically when creating a new project is the following:
44
+
45
+ code[=
46
+ document[
47
+ head[style[default.css]]
48
+ body[
49
+ titlepage[
50
+ title[]
51
+ author[]
52
+ pubdate[]
53
+ ]
54
+ frontmatter[
55
+ toc[]
56
+ preface[header[Preface]
57
+ @[preface.textile]
58
+ ]
59
+ ]
60
+ bodymatter[
61
+ chapter[header[Chapter #1]
62
+ @[chapter_1.textile]
63
+ ]
64
+ chapter[header[Chapter #2]
65
+ @[chapter_2.textile]
66
+ ]
67
+ ]
68
+ backmatter[
69
+ appendix[header[Appendix A]
70
+ @[appendix_a.textile]
71
+ ]
72
+ ]
73
+ ]
74
+ ]=]
75
+
76
+ Even without knowing anything about &[glang], you can easily figure out that this file defines a document with a Table of Contents, a Preface and some Chapters. @frontmatter\[\]@, @preface\[\]@, @chapter\[\]@, etc. are all Glyph _macros_ used to define -- in this case -- some structural elements. In practice, this means that if you plan to generate an HTML document, they'll be converted into @<div>@ tags.
77
+
78
+ Be aware that other macros, on the other hand, are used to do something completely different, e.g.:
79
+ * @toc\[\]@ generates the document's Table of Contents
80
+ * codeph[=@\[\]=] or its alias @include\[\]@ is used to copy the contents of another file stored anywhere in the @/text@ directory.
81
+
82
+ Let's now analyze this @document.glyph@ more in detail.
83
+ * The @document\[\]@ macro wraps every other macro. This is necessary to create the initial @<html>@ tag.
84
+ * Similarly, @head\[\]@ and @body\[\]@ are used to generate the respective HTML tags. Actually, @head\[\]@ already sets some metadata for you, by default (author and copyright).
85
+ * Within @head\[\]@, the @style\[\]@ macro is used to load the @default.css@ stylesheet, which is included by default the @/styles@ directory of every Glyph project.
86
+ * Immediately after the @body\[\]@ macro, the @titlepage\[\]@ macro is used to define (guess...) the first page of your document. @title\[\]@, @author\[\]@ and @pubdate\[\]@ insert the title of the document, its author and the publication date (retrieved from the project's =>[#cfg|configuration settings]).
87
+ * Then, the @frontmatter\[\]@, @bodymatter\[\]@ and @backmatter\[\]@ macros are used to further divide the portions of your document according to the rules of =>[http://en.wikipedia.org/wiki/Book_design|book design]. They are not mandatory, but they can be used, for example, to number your appendixes with letters instead of numbers and similar.
88
+ * @preface\[\]@, @chapter\[\]@, @appendix\[\]@ are just a way to wrap content in @<div>@ tags, from an HTML point of view, but they are also necessary to nest the content of your document and generate the Table of Contents automatically, together with the @header\[\]@ macro.
89
+
90
+ ]
91
+
92
+ section[header[Project Configuration|cfg]
93
+
94
+ Glyph stores configuration settings in the following YAML files:
95
+ # Your _Project Configuration_ is stored in the @config.yml@ file, included in each Glyph Project.
96
+ # Your _Global Configuration_ is stored in a @.glyphrc@ file in your $HOME (or ==%HOMEPATH%== on Windows) directory (not created by default).
97
+ # The _System Configuration_ is stored in the source directory of Glyph itself.
98
+
99
+ When compiling, Glyph loads all these configuration files and merges them according to the following rules:
100
+ * A setting configured in the _Project Configuration_ overrides the same setting in both Global and System configuration.
101
+ * A setting configured in the _Global Configuration_ overrides the same setting in the _System Configuration_
102
+
103
+ Typically, you should use the _Project Configuration_ for all project-specific settings and the _Global Configuration_ for settings affecting all your projects (for example, you may want to set 'document.author' in the Global Configuration instead of setting it in the Project Configuration of all your Glyph projects). The _System Configuration_ is best left untouched.
104
+
105
+ Instead of editing your configuration settings directly, you can use the @glyph config@ command, as follows:
106
+
107
+ @glyph config@ _setting_ _\[value\]_
108
+
109
+ If no _value_ is specified, glyph just prints the value of the configuration setting, so typing @glyph config document.author@ right after creating a project (assuming you didn't set this in the Global Configuration) will print nothing, because this setting is blank by default.
110
+
111
+ To change the value of a configuration setting, specify a value right after the setting, like this:
112
+
113
+ @glyph config document.author "John Smith"@
114
+
115
+ In this way, the document author will be set to _John Smith_ for the current project. To save this setting globally, add a @-g@ option, like this:
116
+
117
+ @glyph config -g document.author "John Smith"@
118
+
119
+ box[Regarding configuration values and data types...|
120
+ Glyph attempts to "guess" the data type of a configuration values by evaluation (@Kernel#instance_eval@) if the value:
121
+ - is wrapped in quotes (@"@ or @'@) &rarr; String
122
+ - starts with a colon (@:@) &rarr; Symbol
123
+ - is wrapped in square brackets (@\[@ and @\]@) &rarr; Array
124
+ - is wrapped in curly brackets (@\{@ and @\}@) &rarr; Hash
125
+ - is _true_ or _false_ &rarr; Boolean
126
+ - If the value is _nil_ &rarr; NilClass
127
+
128
+ Note that this guessing is far from being foolproof: If you type something like _{:test, 2}_, for example, you'll get an error.
129
+ ]
130
+
131
+ There are plenty of configuration settings that can be modified, but most of them are best if left alone (and in the System Configuration file). For a complete reference, see =>[#cfg_ref]. Normally, you may just want to change the following ones:
132
+
133
+ table[
134
+ tr[
135
+ th[Setting]
136
+ th[Description]
137
+ ]
138
+ tr[
139
+ td[*document.author*]
140
+ td[The author of the document]
141
+ ]
142
+ tr[
143
+ td[*document.title*]
144
+ td[The title of the document]
145
+ ]
146
+ tr[
147
+ td[*document.filename*]
148
+ td[The document file name]
149
+ ]
150
+ ]
151
+
152
+ ]
@@ -0,0 +1,88 @@
1
+ Glyph is a _Rapid Document Authoring Framework_.
2
+
3
+ Think of it like a sort of =>[http://www.rubyonrails.org|Ruby on Rails] but for creating text documents instead of web sites. With Glyph, you can manage your documents tidily in _projects_ that can be used to generate deliverables in different formats such as HTML or PDF (through &[prince]).
4
+
5
+ section[header[Main Features]
6
+
7
+ Glyph uses a =>[#macros_nutshell|simple macro system] to perform a wide variety of advanced tasks:
8
+ * Generate block-level HTML tags not commonly managed by lightweight markups, like @head@, @body@, @div@ and @table@.
9
+ * Create and validate internal and external links.
10
+ * Include and validate images and figures.
11
+ * Automatically determine header levels based on the document structure.
12
+ * Automatically generate a Table of Contents based on the document structure.
13
+ * Store common snippets of text in a single YAML file and use them anywhere in your document, as many times as you need.
14
+ * Store configuration settings in a YAML file and use them anywhere in your document, as many times as you need.
15
+ * Evaluate Ruby code within your document.
16
+ * Call macros from other macros (including snippets), carefully avoiding mutual calls.
17
+ * Include text files in other text files.
18
+ * Include the contents of configuration settings (author, title) in the document.
19
+ * Filter input explicitly or implicitly, based on file extensions when including files.
20
+ * Manage comments and todo items.
21
+ ]
22
+
23
+ section[header[Installation]
24
+
25
+ @gem install glyph@ -- simple, as always.
26
+
27
+ ]
28
+
29
+ section[header[Essential Glyph commands]
30
+
31
+ 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:
32
+
33
+ * @glyph init@ -- to initialize a new Glyph project in the current (empty) directory.
34
+ * @glyph add introduction.textile@ -- to create a new file called _introduction.textile_.
35
+ * @glyph compile@ -- to compile the current document into a single HTML file.
36
+ * @glyph compile -f pdf@ -- to compile the current document into HTML and then transform it into PDF using &[prince].
37
+
38
+ ]
39
+
40
+ section[header[Glyph macros in a nutshell|macros_nutshell]
41
+
42
+ Format your documents using Textile or Markdown, and use Glyph Macros to do everything else:
43
+
44
+ **Glyph Source:**
45
+
46
+ code[=
47
+ section[header[Something about Glyph]
48
+ You can use Glyph macros in conjunction
49
+ with _Textile_ or _Markdown_ to
50
+ produce HTML files effortlessly.
51
+ section[header[What about PDFs?|pdf]
52
+ Once you have a single, well-formatted HTML
53
+ file, converting it to PDF is
54
+ extremely easy with a 3rd-party
55
+ renderer like =>[http://www.princexml.com|Prince].
56
+ ]
57
+ ]
58
+ =]
59
+
60
+ **HTML Output:**
61
+
62
+ <notextile>
63
+ code[=
64
+ <div class="section">
65
+ <h2 id="h_10">Something about Glyph</h2>
66
+ <p>You can use Glyph macros in conjunction with
67
+ <em>Textile</em> or <em>Markdown</em> to
68
+ produce HTML files effortlessly.</p>
69
+ <div class="section">
70
+ <h3 id="pdf">What about PDFs?</h3>
71
+ <p>Once you have a single, well-formatted HTML
72
+ file, converting it to PDF is
73
+ extremely easy with a 3rd-party renderer
74
+ like <a href="http://www.princexml.com">Prince</a>.</p>
75
+ </div>
76
+ </div>
77
+ =]</notextile>
78
+ ]
79
+
80
+ section[header[Resources]
81
+
82
+ * Home Page: =>[http://www.h3rald.com/glyph/]
83
+ * Repository: =>[http://www.github.com/h3rald/glyph/]
84
+ * Bug Tracking: =>[http://www.github.com/h3rald/glyph/issues]
85
+ * Book (PDF): =>[http://github.com/h3rald/glyph/raw/master/book/output/pdf/glyph.pdf]
86
+ * Reference Documentation: =>[http://yardoc.org/docs/h3rald-glyph/]
87
+ * User Group: =>[http://groups.google.com/group/glyph-framework]
88
+ ]
@@ -0,0 +1,74 @@
1
+ Glyph's command-line interface has been built using the =>[http://github.com/davetron5000/gli|gli] (Git-like interface) gem. Therefore, Glyph commands are all written like this:
2
+
3
+ @glyph@ _global-options_ command _options_ _parameters_
4
+
5
+ Where:
6
+ * _global-options_ and _options_ are in the form: @-n@ _value_ or @--name=@\._value_, e.g. @-f pdf@ or @--format=pdf@
7
+ * _parameters_ are separated by whitespaces, and can be wrapped in quotes.
8
+
9
+ section[header[Global Options]
10
+
11
+ section[header[@-d@, @--debug@]
12
+ If specified, the command is executed in debug mode and additional diagnostic information is printed on the screen.
13
+ ]
14
+ ]
15
+
16
+ section[header[@add@]
17
+ Creates a new text file in the @text/@ folder.
18
+
19
+ example[glyph add introduction.textile]
20
+
21
+ parameters[
22
+ -p[file-name|The name (or relative path) of the new file to be created.]
23
+ ]
24
+ ] --[End add]
25
+
26
+ section[header[@compile@]
27
+ Compiles a Glyph document into an output file. If no options are specified, the @document.glyph@ file is used as source to produce a standalone HTML file.
28
+
29
+ example[glyph compile -f pdf]
30
+
31
+ options[
32
+ -o[source|
33
+ The source file to compile.
34
+ default[document.glyph]
35
+ ]
36
+ -o[format|
37
+ The format of the output file.
38
+ default[html]
39
+ values[html, pdf]
40
+ ]
41
+ ]
42
+ ] --[End compile]
43
+
44
+ section[header[@config@]
45
+ Gets or sets a configuration setting in the project or global configuration file (\.fmi[configuration files|#cfg]).
46
+
47
+ examples[
48
+ glyph config document.filename
49
+ glyph config -g document.author "Fabio Cevasco"
50
+ ]
51
+
52
+ options[
53
+ -o[global|
54
+ If specified, the global configuration file is processed instead of the project file.
55
+ default[false]
56
+ ]
57
+ ]
58
+ parameters[
59
+ -p[setting|The name of a valid =>[#cfg_ref|configuration setting].]
60
+ -p[value|The new value of the configuration setting.]
61
+ ]
62
+ ] --[End config]
63
+
64
+ section[header[@init@]
65
+ Creates a new Glyph project in the current directory (if empty).
66
+
67
+ example[glyph init]
68
+ ] --[End init]
69
+
70
+ section[header[@todo@|c_todo]
71
+ Prints all the todo items saved using the %>[todo].
72
+
73
+ example[glyph todo]
74
+ ] --[End todo]