glyph 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. data/AUTHORS.textile +1 -1
  2. data/CHANGELOG.textile +119 -222
  3. data/LICENSE.textile +1 -1
  4. data/README.textile +42 -23
  5. data/Rakefile +1 -3
  6. data/VERSION +1 -1
  7. data/benchmark.rb +72 -0
  8. data/book/config.yml +4 -4
  9. data/book/document.glyph +90 -57
  10. data/book/images/document_generation.png +0 -0
  11. data/book/lib/macros/reference.rb +75 -22
  12. data/book/output/html/glyph.html +3183 -2121
  13. data/book/output/html/images/document_generation.png +0 -0
  14. data/book/output/pdf/glyph.pdf +7370 -4913
  15. data/book/resources/document_generation.txt +34 -0
  16. data/book/snippets.yml +6 -0
  17. data/book/text/changelog.glyph +45 -34
  18. data/book/text/compiling/compiling.glyph +23 -0
  19. data/book/text/compiling/lite_mode.glyph +23 -0
  20. data/book/text/compiling/programmatic_usage.glyph +77 -0
  21. data/book/text/extending/bookmarks_headers.glyph +21 -0
  22. data/book/text/extending/further_reading.glyph +13 -0
  23. data/book/text/extending/internals.glyph +79 -0
  24. data/book/text/extending/interpreting.glyph +51 -0
  25. data/book/text/extending/macro_def.glyph +64 -0
  26. data/book/text/extending/params_attrs.glyph +70 -0
  27. data/book/text/extending/placeholders.glyph +34 -0
  28. data/book/text/extending/validators.glyph +16 -0
  29. data/book/text/getting_started/configuration.glyph +49 -0
  30. data/book/text/getting_started/create_project.glyph +41 -0
  31. data/book/text/getting_started/structure.glyph +55 -0
  32. data/book/text/introduction.glyph +49 -26
  33. data/book/text/license.glyph +1 -1
  34. data/book/text/macros/macros_block.glyph +99 -0
  35. data/book/text/macros/macros_core.glyph +208 -0
  36. data/book/text/macros/macros_filters.glyph +40 -0
  37. data/book/text/macros/macros_inline.glyph +50 -0
  38. data/book/text/macros/macros_structure.glyph +100 -0
  39. data/book/text/ref_commands.glyph +94 -73
  40. data/book/text/ref_config.glyph +34 -42
  41. data/book/text/ref_macros.glyph +1 -373
  42. data/book/text/text_editing/code.glyph +51 -0
  43. data/book/text/text_editing/conditionals.glyph +49 -0
  44. data/book/text/text_editing/evaluation.glyph +13 -0
  45. data/book/text/text_editing/glyph_files.glyph +7 -0
  46. data/book/text/text_editing/images.glyph +29 -0
  47. data/book/text/text_editing/inclusions.glyph +44 -0
  48. data/book/text/text_editing/links.glyph +53 -0
  49. data/book/text/text_editing/macro_intro.glyph +111 -0
  50. data/book/text/text_editing/raw_html.glyph +112 -0
  51. data/book/text/text_editing/sections.glyph +63 -0
  52. data/book/text/text_editing/stylesheets.glyph +36 -0
  53. data/book/text/troubleshooting/errors_command.glyph +39 -0
  54. data/book/text/troubleshooting/errors_generic.glyph +29 -0
  55. data/book/text/troubleshooting/errors_intro.glyph +3 -0
  56. data/book/text/troubleshooting/errors_macro.glyph +98 -0
  57. data/book/text/troubleshooting/errors_parser.glyph +29 -0
  58. data/config.yml +77 -58
  59. data/document.glyph +25 -25
  60. data/glyph.gemspec +57 -22
  61. data/lib/glyph.rb +54 -13
  62. data/lib/glyph/commands.rb +84 -17
  63. data/lib/glyph/config.rb +3 -3
  64. data/lib/glyph/document.rb +14 -8
  65. data/lib/glyph/interpreter.rb +18 -58
  66. data/lib/glyph/macro.rb +160 -55
  67. data/lib/glyph/macro_validators.rb +104 -12
  68. data/lib/glyph/node.rb +24 -0
  69. data/lib/glyph/parser.rb +278 -0
  70. data/lib/glyph/syntax_node.rb +225 -0
  71. data/macros/core.rb +212 -0
  72. data/macros/filters.rb +66 -15
  73. data/macros/html/block.rb +43 -105
  74. data/macros/html/inline.rb +11 -12
  75. data/macros/html/structure.rb +123 -58
  76. data/macros/xml.rb +33 -0
  77. data/spec/files/container.textile +2 -2
  78. data/spec/files/document.glyph +2 -2
  79. data/spec/files/document_with_toc.glyph +3 -3
  80. data/spec/files/included.textile +1 -1
  81. data/spec/files/ligature.jpg +0 -0
  82. data/spec/files/markdown.markdown +2 -1
  83. data/spec/lib/commands_spec.rb +46 -3
  84. data/spec/lib/document_spec.rb +4 -4
  85. data/spec/lib/glyph_spec.rb +17 -46
  86. data/spec/lib/interpreter_spec.rb +6 -25
  87. data/spec/lib/macro_spec.rb +141 -43
  88. data/spec/lib/macro_validators_spec.rb +27 -5
  89. data/spec/lib/node_spec.rb +26 -1
  90. data/spec/lib/parser_spec.rb +246 -0
  91. data/spec/lib/syntax_node_spec.rb +111 -0
  92. data/spec/macros/core_spec.rb +195 -0
  93. data/spec/macros/filters_spec.rb +38 -4
  94. data/spec/macros/macros_spec.rb +20 -176
  95. data/spec/macros/textile_spec.rb +13 -71
  96. data/spec/macros/xml_spec.rb +77 -0
  97. data/spec/spec_helper.rb +50 -10
  98. data/spec/tasks/load_spec.rb +13 -2
  99. data/styles/default.css +18 -6
  100. data/styles/pagination.css +1 -19
  101. data/tasks/generate.rake +2 -2
  102. data/tasks/load.rake +27 -17
  103. data/tasks/project.rake +1 -1
  104. metadata +75 -62
  105. data/book/script/compile.rb +0 -8
  106. data/book/script/prof +0 -1
  107. data/book/script/prof_results.htm +0 -21079
  108. data/book/text/authoring.glyph +0 -548
  109. data/book/text/extending.glyph +0 -224
  110. data/book/text/getting_started.glyph +0 -158
  111. data/book/text/troubleshooting.glyph +0 -179
  112. data/lib/glyph/glyph_language.rb +0 -538
  113. data/lib/glyph/glyph_language.treetop +0 -27
  114. data/macros/common.rb +0 -160
@@ -1,6 +1,6 @@
1
1
  Copyright (c) 2010 **Fabio Cevasco**, =>[http://www.h3rald.com]
2
2
 
3
- code[
3
+ codeblock[
4
4
  Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  of this software and associated documentation files (the "Software"), to deal
6
6
  in the Software without restriction, including without limitation the rights
@@ -0,0 +1,99 @@
1
+ section[
2
+ @title[Block Macros]
3
+
4
+ ref_macro[
5
+ @n[box]
6
+ @desc[Creates a titled box (@<div>@ tag).]
7
+ @block_example[=
8
+ box[Why boxes?\|
9
+ Boxes can be used to make a section of text stand out from the rest of the document.
10
+ ]
11
+ =]
12
+ @params[
13
+ -p[0|The box title.]
14
+ -p[1|The box text.]
15
+ ]
16
+ ]
17
+
18
+ ref_macro[
19
+ @n[codeblock]
20
+ @desc[Used to render a block of code within @<pre>@ and @<code>@ tags.]
21
+ @block_example[=
22
+ code[
23
+ def hello
24
+ puts "Hello World"
25
+ end
26
+ ]
27
+ =]
28
+ @remarks[For code highlighting, see the %>[highlight].]
29
+ @params[-p[0|The code to be formatted.]]
30
+ ]
31
+
32
+ ref_macro[
33
+ @n[figure]
34
+ @desc[Includes an image in the document, with an optional caption (see =>[#img_fig]).]
35
+ @block_example[=
36
+ figure[
37
+ graph.png\|Monthly Pageviews
38
+ @width[90%]
39
+ ]
40
+ =]
41
+ @params[
42
+ -p[0|&[img_file]]
43
+ -p[1|The image caption &[opt].]
44
+ ]
45
+ @attrs[
46
+ -a[*|&[img_attrs]]
47
+ ]
48
+ ]
49
+
50
+ ref_macro[
51
+ @n[image]
52
+ @desc[Includes an image in the document]
53
+ @block_example[=
54
+ img[
55
+ holidays/landscape.jpg
56
+ @class[photo]
57
+ @style[border: 1px solid black;]
58
+ ]
59
+ =]
60
+ @params[
61
+ -p[0|&[img_file]]
62
+ ]
63
+ @attrs[
64
+ -a[*|&[img_attrs]]
65
+ ]
66
+ ]
67
+
68
+ ref_macro[
69
+ @n[note]
70
+ @desc[Creates a note @div@ containing the value.]
71
+ @aliases[important, caution, tip]
72
+ @example[=note[This is a note.]=]
73
+ @params[-p[0|The text of the note.]]
74
+ ]
75
+
76
+ ref_macro[
77
+ @n[pubdate]
78
+ @desc[Evaluates to a date string (in the format: em[current_month] em[current_year]; i.e. _%B_ _%Y_), within a @<div>@ tag.]
79
+ @example[=pubdate[]=]
80
+ ]
81
+
82
+ ref_macro[
83
+ @n[revision]
84
+ @desc[Renders the revision of the document (based on the $>[document.revision]) within a @<div>@ tag.]
85
+ @example[=revision[]=]
86
+ ]
87
+
88
+ ref_macro[
89
+ @n[subtitle]
90
+ @desc[Renders the subtitle of the document (based on the $>[document.subtitle]) within a @<h2>@ tag.]
91
+ @example[=subtitle[]=]
92
+ ]
93
+
94
+ ref_macro[
95
+ @n[title]
96
+ @desc[Renders the title of the document (based on the $>[document.title]) within a @<h1>@ tag.]
97
+ @example[=title[]=]
98
+ ]
99
+ ]
@@ -0,0 +1,208 @@
1
+ section[
2
+ @title[Core Macros]
3
+
4
+ ref_macro[
5
+ @n[alias]
6
+ @desc[Creates a macro alias.]
7
+ @params[
8
+ -p[0|The name of the alias.]
9
+ -p[1|The name of an existing macro.]
10
+ ]
11
+ @example[=alias[s\|section]=]
12
+ ]
13
+
14
+ ref_macro[
15
+ @n[and]
16
+ @desc[Conditional code[and] operator, to be used with the %>[condition].]
17
+ @params[&[bin_params]]
18
+ @example[=?[and[true\|false]\|This is never displayed.]=]
19
+ ]
20
+
21
+ ref_macro[
22
+ @n[comment]
23
+ @desc[
24
+ Evaluates to nothing. Used to add comments in a Glyph document that will not be displayed in output files.
25
+ ]
26
+ @aliases[--]
27
+ @params[-p[0|The contents to comment out]]
28
+ @example[=--[\.=>[#link\|This link will not be evaluated]]=]
29
+ @remarks[Macros are not expanded within comments.]
30
+ ]
31
+
32
+ ref_macro[
33
+ @n[condition]
34
+ @desc[
35
+ Tests a conditional expression. For more information, see =>[#cond_macros].
36
+ ]
37
+ @aliases[?]
38
+ @params[
39
+ -p[0|The condition to test]
40
+ -p[1|The contents to expand if the condition is satisfied.]
41
+ ]
42
+ @remarks[
43
+ For examples see any of the following:
44
+ * %>[and]
45
+ * %>[or]
46
+ * %>[not]
47
+ * %>[match]
48
+ * %>[eq]
49
+ ]
50
+ ]
51
+
52
+ ref_macro[
53
+ @n[config]
54
+ @desc[Returns the value of a configuration setting.]
55
+ @aliases[$]
56
+ @example[=$[document.author]=]
57
+ @params[
58
+ -p[0|The full name of a configuration setting.]
59
+ ]
60
+ ]
61
+
62
+ ref_macro[
63
+ @n[config:]
64
+ @desc[Sets the value of a configuration setting.]
65
+ @aliases[$:]
66
+ @example[=$:[document.draft\|true]=]
67
+ @remarks[&[unsafe]]
68
+ @params[
69
+ -p[0|The full name of a configuration setting.]
70
+ -p[0|The new value of the configuration setting]
71
+ ]
72
+ ]
73
+
74
+ ref_macro[
75
+ @n[eq]
76
+ @desc[Conditional equality operator, to be used with the %>[condition].]
77
+ @example[=?[eq[$[document.draft]\|true]\|This is displayed only in draft documents.]=]
78
+ @params[&[bin_params]]
79
+ ]
80
+
81
+ ref_macro[
82
+ @n[escape]
83
+ @desc[Evaluates to its value. Commonly used with the escaping delimiters code[\[\=] and code[\=\]].]
84
+ @aliases[.]
85
+ @example[=.\[=Macros are escaped here =>[#test].=\]=]
86
+ @params[-p[0|The contents to escape.]]
87
+ ]
88
+
89
+ ref_macro[
90
+ @n[include]
91
+ @desc[
92
+ Evaluates to the contents of a text file stored in the @text/@ directory referenced by its relative path. If &[filter_by_ext], filters the contents of the file using the =>[#f_macros|filter macro] corresponding to the file extension.
93
+ ]
94
+ @aliases[@]
95
+ @example[=include[frontmatter/introduction]=]
96
+ @params[-p[0|The file to include.]]
97
+ @remarks[
98
+ ul[
99
+ li[&[unsafe]]
100
+ li[@.glyph@ is assumed if no file extension is specified.]
101
+ li[
102
+ This macro can also be used to include @.rb@ ruby files within the @lib@ directory. File contents are evaluated in the context of the =>[&[yardoc]/Glyph|Glyph] module.
103
+ ]
104
+ ]
105
+ ]
106
+ ]
107
+
108
+ ref_macro[
109
+ @n[match]
110
+ @desc[
111
+ Checks a string against a regular expression.
112
+ ]
113
+ @params[
114
+ -p[0|The string to check.]
115
+ -p[1|The regular expression to match against the string.]
116
+ -p[2|The contents to expand if the string matches.]
117
+ ]
118
+ @remarks[This macro must be used with the %>[condition].]
119
+ @example[=?[match[Hello!\|/^hell/i]\|This is always displayed]=]
120
+ ]
121
+
122
+ ref_macro[
123
+ @n[macro:]
124
+ @desc[Defines a macro.]
125
+ @remarks[
126
+ ul[
127
+ li[&[unsafe]]
128
+ li[The new macro &[only_after_declaration].]
129
+ ]
130
+ ]
131
+ @aliases[%:]
132
+ @example[=%:[test\|"<em>test: #{value}</em>"]=]
133
+ @params[
134
+ -p[0|The name of the new macro.]
135
+ -p[1|The macro definition (Ruby code).]
136
+ ]
137
+ ]
138
+
139
+ ref_macro[
140
+ @n[not]
141
+ @desc[Conditional @not@ operator, to be used with the %>[condition].]
142
+ @example[=?[not[false]\|This is always displayed.]=]
143
+ @params[-p[0|The expression to negate]]
144
+ ]
145
+
146
+ ref_macro[
147
+ @n[or]
148
+ @desc[Conditional @or@ operator, to be used with the %>[condition].]
149
+ @example[=?[or[true\|false]\|This is always displayed.]=]
150
+ @params[&[bin_params]]
151
+ ]
152
+
153
+ ref_macro[
154
+ @n[rewrite:]
155
+ @desc[Defines a new macro by rewriting (for more information, see =>[#rewriting])]
156
+ @aliases[rw:]
157
+ @params[
158
+ -p[0|The name of the new macro.]
159
+ -p[0|The macro definition (Glyph code).]
160
+ ]
161
+ @block_example[=
162
+ rw:[release\|
163
+ section[
164
+ @title[Release {{0}}]
165
+ {{1}}
166
+ ]
167
+ ]
168
+ =]
169
+ @remarks[
170
+ ul[
171
+ li[The new macro &[only_after_declaration].]
172
+ li[&[unsafe]]
173
+ ]
174
+ ]
175
+ ]
176
+
177
+ ref_macro[
178
+ @n[ruby]
179
+ @desc[Evaluates its value as Ruby code within the context of the =>[&[yardoc]/Glyph|Glyph] module.]
180
+ @aliases[%]
181
+ @examples[=
182
+ %[Time.now]
183
+ %[Glyph::VERSION]
184
+ =]
185
+ @params[-p[0|The Ruby code to evaluate.]]
186
+ @remarks[&[unsafe]]
187
+ ]
188
+
189
+ ref_macro[
190
+ @n[snippet]
191
+ @desc[Returns the value of a snippet.]
192
+ @aliases[&amp;]
193
+ @example[=&amp;[glang]=]
194
+ @params[-p[0|The ID of the snippet to retrieve.]]
195
+ ]
196
+
197
+ ref_macro[
198
+ @n[snippet:]
199
+ @desc[Defines a snippet.]
200
+ @remarks[The new snippet &[only_after_declaration].]
201
+ @aliases[&amp;:]
202
+ @example[=&amp;:[test\|This is a test]=]
203
+ @params[
204
+ -p[0|The ID of the new snippet.]
205
+ -p[1|The contents of the new snippet.]
206
+ ]
207
+ ]
208
+ ]
@@ -0,0 +1,40 @@
1
+ section[
2
+ @title[Filter Macros]
3
+ @id[f_macros]
4
+
5
+ ref_macro[
6
+ @n[markdown]
7
+ @desc[
8
+ Uses a Markdown converter (BlueCloth, RDiscount, Maruku or Kramdown) to transform the value into HTML if the $>[filters.target] is set to @html@.
9
+
10
+ &[called_on_files] with a @.markdown@ or a @.md@ extension.
11
+ ]
12
+ @aliases[md]
13
+ @example[=markdown[This is *emphasized* text.]=]
14
+ @params[-p[0|The Markdown text to filter.]]
15
+ ]
16
+
17
+ ref_macro[
18
+ @n[textile]
19
+ @desc[
20
+ Uses the RedCloth gem to transform the value into HTML or LaTeX, depending on the value of the $>[filters.target].
21
+
22
+ &[called_on_files] with a @.textile@ or a @.txt@ extension.
23
+ ]
24
+ @aliases[txt]
25
+ @example[=textile[This is a *strong emphasis*.]=]
26
+ @params[-p[0|The Textile text to filter.]]
27
+ ]
28
+
29
+ ref_macro[
30
+ @n[highlight]
31
+ @desc[Highlights a piece of source code (second parameter) according to the specified language (first parameter). fmi[code highligting|#source_code].]
32
+ @block_example[=
33
+ highlight[ruby\|
34
+ def hello
35
+ puts "Hello World"
36
+ end
37
+ ]
38
+ =]
39
+ ]
40
+ ]
@@ -0,0 +1,50 @@
1
+ section[
2
+ @title[Inline Macros]
3
+
4
+ ref_macro[
5
+ @n[anchor]
6
+ @desc[Creates a named anchor (or bookmark).]
7
+ @aliases[bookmark, #]
8
+ @example[=#[test\|Test Bookmark]=]
9
+ @params[
10
+ -p[0|The identifier of the bookmark]
11
+ -p[1|The contents of the bookmark &[opt]]
12
+ ]
13
+ ]
14
+
15
+ ref_macro[
16
+ @n[draftcomment]
17
+ @desc[If the $>[document.draft] is set to @true@, displays a draft comment within the document.]
18
+ @aliases[dc]
19
+ @example[=dc[This is printed only in draft documents.]=]
20
+ @params[-p[0|The text of the comment.]]
21
+ ]
22
+
23
+ ref_macro[
24
+ @n[fmi]
25
+ @desc[Creates a _For More Information_ link (for an example usage, see the %>[link]).]
26
+ @example[=fmi[creating links\|#links]=]
27
+ @params[
28
+ -p[0|The object that needs additional explanation.]
29
+ -p[0|A valid bookmark within the document.]
30
+ ]
31
+ ]
32
+
33
+ ref_macro[
34
+ @n[link]
35
+ @desc[Creates an hyperlink (\.fmi[creating links|#links]).]
36
+ @aliases[\.=>]
37
+ @example[=\.=>[http://www.h3rald.com\|H3RALD.com]=]
38
+ @params[
39
+ -p[0|A valid bookmark within the document or an URL.]
40
+ -p[1|The text of the link &[opt].]
41
+ ]
42
+ ]
43
+
44
+ ref_macro[
45
+ @n[todo]
46
+ @aliases[!]
47
+ @desc[Saves the value as a TODO item, which can be printed using the #>[todo] and included in the document if the $>[document.draft] is set to @true@.]
48
+ @example[=todo[Remember to do this.]=]
49
+ ]
50
+ ]
@@ -0,0 +1,100 @@
1
+ section[
2
+ @title[Structure Macros]
3
+
4
+ ref_macro[
5
+ @n[article]
6
+ @desc[
7
+ Used to create a simple article. By default, it includes the following macros:
8
+ * @document@
9
+ ** @head@
10
+ *** @style\[default.css\]@
11
+ ** @body@
12
+ *** @halftitlepage@
13
+ **** @title@
14
+ **** @pubdate@
15
+ **** @subtitle@
16
+ **** @author@
17
+ ]
18
+ @params[-p[0|The article contents.]]
19
+ @attrs[
20
+ -a[pre-title|Contents to include before the %>[title].]
21
+ -a[post-title|Contents to include after the %>[title].]
22
+ -a[head|Contents to include instead of the default code[head] macro.]
23
+ -a[pubdate|Contents to include instead of the default code[pubdate] macro.]
24
+ -a[halftitlepage|Contents to include instead of the default code[halftitlepage] macro.]
25
+ ]
26
+ ]
27
+
28
+ ref_macro[
29
+ @n[book]
30
+ @desc[
31
+ Used to create a book. By default, it includes the following macros:
32
+ * @document@
33
+ ** @head@
34
+ *** @style\[default.css\]@
35
+ ** @body@
36
+ *** @titlepage@
37
+ **** @title@
38
+ **** @pubdate@
39
+ **** @subtitle@
40
+ **** @revision@
41
+ **** @author@
42
+ ]
43
+ @params[-p[0|The article contents.]]
44
+ @attrs[
45
+ -a[pre-title|Contents to include before the %>[title].]
46
+ -a[post-title|Contents to include after the %>[title].]
47
+ -a[head|Contents to include instead of the default code[head] macro.]
48
+ -a[pubdate|Contents to include instead of the default code[pubdate] macro.]
49
+ -a[titlepage|Contents to include instead of the default code[titlepage] macro.]
50
+ -a[frontmatter|Contents to include within a code[frontmatter] macro.]
51
+ -a[bodymatter|Contents to include within a code[bodymatter] macro.]
52
+ -a[backmatter|Contents to include within a code[backmatter] macro.]
53
+ ]
54
+ ]
55
+
56
+ ref_macro[
57
+ @n[document]
58
+ @desc[Creates an @<html>@ tag and a DOCTYPE declaration. Called internally by the %>[book] and the %>[article].]
59
+ @params[-p[0|The document contents.]]
60
+ ]
61
+
62
+ ref_macro[
63
+ @n[head]
64
+ @desc[Creates a @<head>@ tag, pre-populated with @title@ and author/copyright @<meta>@ tags.]
65
+ @params[-p[0|The head contents.]]
66
+ ]
67
+
68
+ ref_macro[
69
+ @n[section]
70
+ @desc[Creates a section (@<div>@ tag).]
71
+ @aliases[%[=Glyph['system.structure'].values.flatten.uniq.map{\|a\| a.to_s }.push("section").sort.join(', ')=]]
72
+ @block_example[=
73
+ section[
74
+ @title[Test Section]
75
+ @id[test]
76
+ ...
77
+ ]
78
+ =]
79
+ @params[-p[0|The text of the section]]
80
+ @attrs[
81
+ -a[title|The title of the section &[opt]]
82
+ -a[id|The ID of the section &[opt]]
83
+ -a[notoc|If not blank, the header will not appear in the Table of Contents. &[opt]]
84
+ ]
85
+ ]
86
+
87
+ ref_macro[
88
+ @n[style]
89
+ @desc[Embeds the content of a CSS or Sass file within a @<style>@ tag (\.fmi[stylesheets|#stylesheets]).]
90
+ @example[=style[default.css]=]
91
+ @params[-p[0|The stylesheet file to embed.]]
92
+ ]
93
+
94
+ ref_macro[
95
+ @n[toc]
96
+ @desc[Generates a _Table of Contents_ based on how sections are nested in the current document.]
97
+ @example[=toc[1]=]
98
+ @params[-p[0|The maximum header depth of the TOC &[opt].]]
99
+ ]
100
+ ]