gerbil 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,67 @@
1
+ Creative Commons Attribution-ShareAlike 2.5 License Agreement
2
+
3
+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
4
+
5
+ License
6
+
7
+ THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
8
+
9
+ BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
10
+
11
+ 1. Definitions
12
+
13
+ 1. "Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
14
+ 2. "Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
15
+ 3. "Licensor" means the individual or entity that offers the Work under the terms of this License.
16
+ 4. "Original Author" means the individual or entity who created the Work.
17
+ 5. "Work" means the copyrightable work of authorship offered under the terms of this License.
18
+ 6. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
19
+ 7. "License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, ShareAlike.
20
+
21
+ 2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
22
+
23
+ 3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
24
+
25
+ 1. to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
26
+ 2. to create and reproduce Derivative Works;
27
+ 3. to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
28
+ 4. to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works.
29
+ 5.
30
+
31
+ For the avoidance of doubt, where the work is a musical composition:
32
+ 1. Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work.
33
+ 2. Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights society or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
34
+ 6. Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).
35
+
36
+ The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
37
+
38
+ 4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
39
+
40
+ 1. You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(c), as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any credit as required by clause 4(c), as requested.
41
+ 2. You may distribute, publicly display, publicly perform, or publicly digitally perform a Derivative Work only under the terms of this License, a later version of this License with the same License Elements as this License, or a Creative Commons iCommons license that contains the same License Elements as this License (e.g. Attribution-ShareAlike 2.5 Japan). You must include a copy of, or the Uniform Resource Identifier for, this License or other license specified in the previous sentence with every copy or phonorecord of each Derivative Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Derivative Works that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder, and You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Derivative Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Derivative Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Derivative Work itself to be made subject to the terms of this License.
42
+ 3. If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
43
+
44
+ 5. Representations, Warranties and Disclaimer
45
+
46
+ UNLESS OTHERWISE AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE MATERIALS, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
47
+
48
+ 6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
49
+
50
+ 7. Termination
51
+
52
+ 1. This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
53
+ 2. Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
54
+
55
+ 8. Miscellaneous
56
+
57
+ 1. Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
58
+ 2. Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
59
+ 3. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
60
+ 4. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
61
+ 5. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
62
+
63
+ Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
64
+
65
+ Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons' then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
66
+
67
+ Creative Commons may be contacted at http://creativecommons.org/.
@@ -0,0 +1,30 @@
1
+ The images in this directory were generated from the following sources in the
2
+ 0.8.1 release of the Tango Icon Theme using Inkscape <http://inkscape.org/>.
3
+
4
+ +---------------+-----------------------------------------------+
5
+ | Image file | Image source in tango-icon-theme-0.8.1.tar.gz |
6
+ +---------------+-----------------------------------------------+
7
+ | important.png | scalable/emblems/emblem-important.svg |
8
+ | warning.png | scalable/status/dialog-error.svg |
9
+ | caution.png | scalable/status/dialog-warning.svg |
10
+ | note.png | scalable/apps/accessories-text-editor.svg |
11
+ | tip.png | scalable/status/dialog-information.svg |
12
+ +---------------+-----------------------------------------------+
13
+
14
+ See the file named LICENSE in this directory for copying conditions.
15
+ The original README of the Tango Icon Theme release is reproduced below.
16
+
17
+
18
+
19
+ Tango Icon Theme
20
+ ----------------
21
+
22
+ This is an icon theme that follows the Tango visual guidelines [1]. Currently
23
+ it depends on Imagemagick for creation of 24x24 bitmaps by adding a 1px padding
24
+ around the 22x22px version. For GNOME and KDE you will also need
25
+ icon-naming-utils that allow the theme to work in these environments before
26
+ they follow the new naming scheme [2].
27
+
28
+
29
+ [1] http://tango-project.org/Tango_Icon_Theme_Guidelines
30
+ [2] http://tango-project.org/Standard_Icon_Naming_Specification
Binary file
Binary file
Binary file
Binary file
Binary file
data/fmt/html.yaml ADDED
@@ -0,0 +1,897 @@
1
+ # Copyright 2007 Suraj N. Kurapati
2
+ # See the file named LICENSE for details.
3
+
4
+ desc: web page for the Internet
5
+
6
+ code: |
7
+ # load the String#to_html method
8
+ require 'gerbil/html'
9
+
10
+ # load admonition icons
11
+ Icon = Struct.new(:path, :name, :format, :data)
12
+ class Icon
13
+ # Returns a HTML image tag containing embedded image data. The given
14
+ # attributes (name => value) are applied to the HTML tag declaration.
15
+ def to_html aAttributes = {}
16
+ atts = aAttributes.inject('') {|s,(k,v)| s << %( #{k}="#{v}") }
17
+ %{<img src="data:image/#{format};base64,#{data}" alt="#{name}"#{atts}/>}
18
+ end
19
+ end
20
+
21
+ ICONS = {}
22
+ Dir[File.join(Gerbil[:format_home], 'html.icons', '*.*')].each do |path|
23
+ ext = File.extname(path)
24
+ name = File.basename(path, ext)
25
+ data = [File.read(path)].pack('m')
26
+
27
+ ICONS[name] = Icon.new(path, name, ext.sub('.', ''), data)
28
+ end
29
+
30
+ class String
31
+ # Transforms this UTF-8 string into HTML entities.
32
+ def to_html_entities
33
+ unpack('U*').map! {|c| "&##{c};"}.join
34
+ end
35
+
36
+ # Transforms this string into a valid URI fragment.
37
+ # See http://www.nmt.edu/tcc/help/pubs/xhtml/id-type.html
38
+ def to_uri_fragment
39
+ # remove HTML tags from the input
40
+ buf = gsub(/<.*?>/, '')
41
+
42
+ # The first or only character must be a letter.
43
+ buf.insert(0, 'a') unless buf[0,1] =~ /[[:alpha:]]/
44
+
45
+ # The remaining characters must be letters, digits, hyphens (-),
46
+ # underscores (_), colons (:), or periods (.) or Unicode characters
47
+ buf.unpack('U*').map! do |code|
48
+ if code > 0xFF or code.chr =~ /[[:alnum:]\-_:\.]/
49
+ code
50
+ else
51
+ ?\s
52
+ end
53
+ end.pack('U*').strip.gsub(/[[:space:]-]+/, '-')
54
+ end
55
+ end
56
+
57
+ class Node
58
+ # Returns the user-defined title for this node's content.
59
+ def title
60
+ @title ||= args[0]
61
+ end
62
+
63
+ # Returns the user-defined indentifer for this node.
64
+ def id
65
+ @id ||= args[1]
66
+ end
67
+
68
+ @@frags = []
69
+
70
+ # Returns a unique URI fragment for this node.
71
+ def url
72
+ unless defined? @url
73
+ frag = (id || title || object_id).to_s.to_uri_fragment
74
+ frag << frag.object_id.to_s while @@frags.include? frag # make it unique
75
+
76
+ @@frags << frag
77
+ @url = frag
78
+ end
79
+
80
+ @url
81
+ end
82
+
83
+ # Returns the URI fragment for the location in the table
84
+ # of contents / list of figures that points this node.
85
+ def list_url
86
+ @list_url ||= trace.object_id.to_s.to_uri_fragment
87
+ end
88
+ end
89
+
90
+ # Returns a hyperlink to the given URL of
91
+ # the given name and mouse-hover title.
92
+ def link aUrl, aName = aUrl, aTitle = nil
93
+ %{<a href="#{h aUrl}"#{%{ title="#{aTitle}"} if aTitle}>#{aName}</a>}
94
+ end
95
+
96
+
97
+ nodes:
98
+ ##
99
+ # Structure
100
+
101
+ header: &header
102
+ toc: false
103
+ lof: false
104
+ index: false
105
+ number: false
106
+ silent: true
107
+ output: <%= @node.content %>
108
+
109
+ footer: *header
110
+
111
+ abstract:
112
+ toc: false
113
+ lof: false
114
+ index: false
115
+ number: false
116
+ silent: true
117
+ output: |
118
+ <div id="<%= @node.type %>">
119
+ <h1 class="title"><%= @node.type.capitalize %></h1>
120
+ <div class="content"><%= @node.content.to_s.to_html %></div>
121
+ </div>
122
+
123
+
124
+ ##
125
+ # Organization
126
+
127
+ part: &latex
128
+ toc: true
129
+ lof: false
130
+ index: true
131
+ number: true
132
+ output: |
133
+ <div class="<%= @node.type %>">
134
+ <h1 class="title">
135
+ <%= @node.type.capitalize %>
136
+ <a class="toc" id="<%= @node.url %>" href="#<%= @node.list_url %>"><%= @node.index %></a>
137
+
138
+ <br/>
139
+
140
+ <big><%= @node.title.to_s.to_html %></big>
141
+ </h1>
142
+
143
+ <div class="content"><%= @node.content.to_s.to_html %></div>
144
+ </div>
145
+
146
+ chapter: *latex
147
+
148
+ section:
149
+ toc: true
150
+ lof: false
151
+ index: true
152
+ number: true
153
+ output: |
154
+ <% level = [6, @node.depth + 1].min %>
155
+ <div class="<%= @node.type %>">
156
+ <h<%= level %> class="title">
157
+ <a class="toc" id="<%= @node.url %>" href="#<%= @node.list_url %>"><%= @node.index %></a>&nbsp;&nbsp;<%= @node.title.to_s.to_html %>
158
+ </h<%= level %>>
159
+ <div class="content"><%= @node.content.to_s.to_html %></div>
160
+ </div>
161
+
162
+ paragraph:
163
+ toc: false
164
+ lof: false
165
+ index: false
166
+ number: false
167
+ output: |
168
+ <div class="<%= @node.type %>">
169
+ <p class="title"><%= @node.title.to_s.to_html %></p>
170
+ <div class="content"><%= @node.content.to_s.to_html %></div>
171
+ </div>
172
+
173
+
174
+ ##
175
+ # Admonitions
176
+
177
+ tip: &admonition
178
+ toc: false
179
+ lof: true
180
+ index: false
181
+ number: true
182
+ output: |
183
+ <div class="<%= @node.type %>">
184
+ <p class="title"><a class="toc" id="<%= @node.url %>" href="#<%= @node.list_url %>"><%= @node.type.capitalize %> <%= @node.number %></a>.&nbsp;&nbsp;<%= @node.title.to_s.to_html %></p>
185
+
186
+ <%
187
+ $use_icons = true unless defined? $use_icons
188
+
189
+ if $use_icons && icon = ICONS[@node.type]
190
+ ($icons_used ||= []) << icon
191
+ %><%= icon.to_html :class => :icon %><%
192
+ end
193
+ %>
194
+
195
+ <div class="content"><%= @node.content.to_s.to_html %></div>
196
+ </div>
197
+
198
+ note: *admonition
199
+ caution: *admonition
200
+ warning: *admonition
201
+ important: *admonition
202
+
203
+
204
+ ##
205
+ # Auxilary materials (formal blocks)
206
+ # see http://www.sagehill.net/docbookxsl/FormalTitles.html
207
+
208
+ figure: &formal
209
+ toc: false
210
+ lof: true
211
+ index: false
212
+ number: true
213
+ output: |
214
+ <div class="<%= @node.type %>">
215
+ <p class="title"><a class="toc" id="<%= @node.url %>" href="#<%= @node.list_url %>"><%= @node.type.capitalize %> <%= @node.number %></a>.&nbsp;&nbsp;<%= @node.title.to_s.to_html %></p>
216
+ <div class="content"><%= @node.content.to_s.to_html %></div>
217
+ </div>
218
+
219
+ table: *formal
220
+ example: *formal
221
+ equation: *formal
222
+ procedure: *formal
223
+
224
+
225
+ ##
226
+ # cross-references
227
+
228
+ xref:
229
+ toc: false
230
+ lof: false
231
+ index: false
232
+ number: false
233
+ output: |
234
+ <%=
235
+ scope = @nodes.select {|n| n.content}
236
+
237
+ target = scope.find {|n| n.id == @node.args[0]} || # id has 1st priority
238
+ scope.find {|n| n.title == @node.args[0]}
239
+
240
+ if target
241
+ prefix = '%s %s' % [
242
+ target.type.capitalize,
243
+ target.index || target.number
244
+ ]
245
+
246
+ unless target.type == 'reference'
247
+ title = "<em>#{target.title.to_s.to_html}</em>"
248
+ end
249
+
250
+ '<a class="%s" href="#%s">%s</a>' % [
251
+ @node.type,
252
+ target.url,
253
+ if @node.args.length > 1
254
+ @node.args[1].to_s.to_html
255
+ else
256
+ [prefix, title].compact.join(': ')
257
+ end
258
+ ]
259
+ else
260
+ raise ArgumentError, "invalid cross-reference to #{@node.title.inspect}", @node.trace
261
+ end
262
+ %>
263
+
264
+
265
+ ##
266
+ # Bibliography
267
+
268
+ reference:
269
+ toc: false
270
+ lof: false
271
+ index: false
272
+ number: true
273
+ silent: true
274
+
275
+ cite:
276
+ toc: false
277
+ lof: false
278
+ index: false
279
+ number: false
280
+ output: |
281
+ <%=
282
+ target = @types['reference'].find {|n| n.title == @node.args[0]}
283
+
284
+ if target
285
+ '<sup>[%s]</sup>' % [
286
+ '<a class="%s" href="#%s">%s</a>' % [
287
+ @node.type,
288
+ target.url,
289
+ target.number
290
+ ],
291
+ *@node.args[1..-1]
292
+ ].join(', ')
293
+ else
294
+ raise ArgumentError, "invalid citation for #{@node.title.inspect}", @node.trace
295
+ end
296
+ %>
297
+
298
+ output: |
299
+ <%
300
+ # set default parameter values
301
+ $title = '$title' unless defined? $title
302
+ $authors = {'$authors' => nil} unless defined? $authors
303
+ $date = Time.now.strftime("%d %B %Y") unless defined? $date
304
+ %>
305
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
306
+ <html>
307
+ <head>
308
+ <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
309
+ <meta name="date" content="<%= $date %>"/>
310
+ <meta name="author" content="<%= $authors.keys.join(', ') %>"/>
311
+ <meta name="generator" content="<%= Gerbil[:name] %> <%= Gerbil[:version] %>"/>
312
+ <% $feeds.each_pair do |url, fmt| %>
313
+ <link rel="alternate" type="application/<%= fmt %>+xml" href="<%= url %>"/>
314
+ <% end if $feeds %>
315
+ <title><%= $title.to_s.to_html %></title>
316
+
317
+ <%
318
+ styles = @spec['styles']
319
+ %w[screen print].each do |media|
320
+ %>
321
+ <style type="text/css" media="<%= media %>">
322
+ <%= styles['common'] %>
323
+ <%= styles[media] %>
324
+ </style>
325
+ <% end %>
326
+ </head>
327
+ <body>
328
+ <div id="header">
329
+ <% if header = @types['header'].first %>
330
+ <%= header.output %>
331
+ <% else %>
332
+ <%= $logo %>
333
+ <h1 class="title"><%= $title.to_s.to_html %></h1>
334
+ <h2 class="authors"><%=
335
+ $authors.map do |(name, url)|
336
+ if url
337
+ %{<a href="#{url}">#{name}</a>}
338
+ else
339
+ name
340
+ end
341
+ end.join(', ')
342
+ %></h2>
343
+ <h3 class="date"><%= $date %></h3>
344
+ <% end %>
345
+ </div>
346
+
347
+ <% if abstract = @types['abstract'].first %>
348
+ <%= abstract.output %>
349
+ <% end %>
350
+
351
+ <% # table of contents
352
+ builder = lambda do |n|
353
+ if @spec['nodes'][n.type]['toc']
354
+ entry = '%s<a id="%s" href="#%s">%s</a>' % [
355
+ (n.index.to_s + '&nbsp;&nbsp;' if n.index),
356
+ n.list_url,
357
+ n.url,
358
+ n.title.to_s.to_html
359
+ ]
360
+ nested = n.children.inject('') {|s,c| s << builder[c] }
361
+
362
+ %{<li>#{entry}#{ "<ul>#{nested}</ul>" unless nested.empty? }</li>}
363
+ else
364
+ ''
365
+ end
366
+ end
367
+
368
+ toc = @roots.inject('') {|s,n| s << builder[n] }
369
+
370
+ unless toc.empty?
371
+ %><div id="toc"><h1>Contents</h1> <ul><%= toc %></ul></div><%
372
+ end
373
+ %>
374
+
375
+ <% # list of figures
376
+ enums = {} # type => nodes
377
+
378
+ @spec['nodes'].each_pair do |name, info|
379
+ if info['lof']
380
+ nodes = @types[name]
381
+ enums[name] = nodes unless nodes.empty?
382
+ end
383
+ end
384
+
385
+ lof = enums.sort.map do |(type, nodes)|
386
+ nested = nodes.map do |n|
387
+ %{<li><a id="#{n.list_url}" href="##{n.url}">#{n.title.to_s.to_html}</a></li>}
388
+ end
389
+
390
+ %{<h1>#{type.capitalize}s</h1> <ol>#{nested}</ol>}
391
+ end
392
+
393
+ unless lof.empty?
394
+ %><div id="lof"><%= lof %></div><%
395
+ end
396
+ %>
397
+
398
+ <div id="content"><%= @content %></div>
399
+
400
+ <% unless (refs = @types['reference']).empty? %>
401
+ <div id="references">
402
+ <h1 class="title">References</h1>
403
+ <ol>
404
+ <% refs.each do |n| %>
405
+ <li id="<%= n.url %>"><%= n.content.to_s.to_html %></li>
406
+ <% end %>
407
+ </ol>
408
+ </div>
409
+ <% end %>
410
+
411
+ <br style="display: none"/>
412
+ <hr style="display: none"/>
413
+ <br style="display: none"/>
414
+
415
+ <div id="footer">
416
+ <% if footer = @types['footer'].first %>
417
+ <%= footer.content.to_s.to_html %>
418
+ <% else %>
419
+ Generated on <%= Time.now %> by <a href="<%= Gerbil[:website] %>"><%= Gerbil[:name] %></a> <%= Gerbil[:version] %>.
420
+ <% end %>
421
+
422
+ <% if $icons_used and not $icons_used.empty? %>
423
+ <p>The admonition icons (<%= $icons_used.uniq.map {|icon| icon.to_html}.join(' ') %>) used in this document are Copyright &copy; 2005 <a href="http://tango.freedesktop.org">Tango Desktop Project</a>. They are part of the <a href="http://tango.freedesktop.org/Tango_Icon_Library">Tango Icon Theme</a> set, which is distributed under the <a href="http://creativecommons.org/licenses/by-sa/2.5/">Creative Commons Attribution-ShareAlike 2.5 License Agreement</a>.</p>
424
+ <% end %>
425
+ </div>
426
+ </body>
427
+ </html>
428
+
429
+ styles:
430
+ common: |
431
+ body
432
+ {
433
+ color : #000000;
434
+ background-color : #FFFFFF;
435
+ line-height : 1.5em;
436
+ font-family : Calibri, Verdana, sans-serif;
437
+ }
438
+
439
+ /* emphasis */
440
+
441
+ em,
442
+ blockquote
443
+ {
444
+ font-family : Cambria, Georgia, serif;
445
+ }
446
+
447
+ /* headings */
448
+
449
+ h1,
450
+ h2,
451
+ h3,
452
+ h4,
453
+ h5,
454
+ h6,
455
+ .title
456
+ {
457
+ font-weight : lighter;
458
+ font-family : Constantia, "Book Antiqua", "URW Bookman L", serif;
459
+ }
460
+
461
+ #lof h1,
462
+ #lof h2,
463
+ #lof h3,
464
+ #lof h4,
465
+ #lof h5,
466
+ #lof h6
467
+ {
468
+ margin-top : 1.25em;
469
+ }
470
+
471
+ #content h1,
472
+ #content h2,
473
+ #content h3,
474
+ #content h4,
475
+ #content h5,
476
+ #content h6
477
+ {
478
+ margin-top : 2.5em;
479
+ line-height : 1.25em;
480
+ }
481
+
482
+ #content h1
483
+ {
484
+ font-size : 2.0em;
485
+ }
486
+
487
+ #content h2
488
+ {
489
+ font-size : 1.8em;
490
+ }
491
+
492
+ #content h3
493
+ {
494
+ font-size : 1.6em;
495
+ }
496
+
497
+ #content h4
498
+ {
499
+ font-size : 1.4em;
500
+ }
501
+
502
+ #content h5
503
+ {
504
+ font-size : 1.2em;
505
+ }
506
+
507
+ #content h6
508
+ {
509
+ font-size : 1.0em;
510
+ }
511
+
512
+ /* tables */
513
+
514
+ table
515
+ {
516
+ border : none;
517
+ }
518
+
519
+ th,
520
+ td
521
+ {
522
+ padding : 1em;
523
+ border : 1px solid #C0C0C0;
524
+ vertical-align : top;
525
+ background-color : #FFFFFF;
526
+ }
527
+
528
+ th
529
+ {
530
+ background-color : #F5F5F5;
531
+ }
532
+
533
+ table
534
+ {
535
+ margin : auto;
536
+ }
537
+
538
+ /* document structure */
539
+
540
+ #header
541
+ {
542
+ margin-bottom : 5em;
543
+ text-align : center;
544
+ }
545
+
546
+ #abstract
547
+ {
548
+ margin-bottom : 5em;
549
+ }
550
+
551
+ #toc li
552
+ {
553
+ list-style-type : none;
554
+ }
555
+
556
+ #toc li ul
557
+ {
558
+ padding-bottom : 1em;
559
+ border-left : thick solid #F5F5F5;
560
+ _border-left : none; /* for IE6 */
561
+ }
562
+
563
+ #toc li ul:hover
564
+ {
565
+ border-color : #DCDCDC;
566
+ }
567
+
568
+ #toc > ul
569
+ {
570
+ padding-left : 1em;
571
+ }
572
+
573
+ #references
574
+ {
575
+ margin-top : 5em;
576
+ }
577
+
578
+ #footer
579
+ {
580
+ border-top : thick dotted #DCDCDC;
581
+ padding-top : 1em;
582
+ margin-top : 5em;
583
+ text-align : center;
584
+ }
585
+
586
+ /* document nodes */
587
+
588
+ .part > .title,
589
+ .chapter > .title
590
+ {
591
+ padding-bottom : 0.5em;
592
+ }
593
+
594
+ .part > .title > big,
595
+ .chapter > .title > big
596
+ {
597
+ display : block;
598
+ margin-top : 0.25em;
599
+ }
600
+
601
+ .part .title big,
602
+ .chapter .title big
603
+ {
604
+ _display : block; /* for IE6 */
605
+ _margin-top : 0.25em; /* for IE6 */
606
+ _margin-bottom : 0.75em; /* for IE6 */
607
+ }
608
+
609
+ .paragraph > .title,
610
+ .tip > .title,
611
+ .note > .title,
612
+ .caution > .title,
613
+ .warning > .title,
614
+ .important > .title,
615
+ .figure > .title,
616
+ .table > .title,
617
+ .example > .title,
618
+ .equation > .title,
619
+ .procedure > .title
620
+ {
621
+ font-size : large;
622
+ margin-top : 2em;
623
+ }
624
+
625
+ .paragraph .title,
626
+ .tip .title,
627
+ .note .title,
628
+ .caution .title,
629
+ .warning .title,
630
+ .important .title,
631
+ .figure .title,
632
+ .table .title,
633
+ .example .title,
634
+ .equation .title,
635
+ .procedure .title
636
+ {
637
+ _font-size : large; /* for IE6 */
638
+ _font-weight : bold; /* large is not bold in IE6 */
639
+ _margin-top : 2em; /* for IE6 */
640
+ }
641
+
642
+ .tip ,
643
+ .note ,
644
+ .caution ,
645
+ .warning ,
646
+ .important,
647
+ .figure ,
648
+ .table ,
649
+ .example ,
650
+ .equation ,
651
+ .procedure
652
+ {
653
+ margin : 3em;
654
+ }
655
+
656
+ .tip > .icon,
657
+ .note > .icon,
658
+ .caution > .icon,
659
+ .warning > .icon,
660
+ .important > .icon
661
+ {
662
+ float : left;
663
+ margin : 0 1em 1em 0; /* top right bottom left */
664
+ }
665
+
666
+ .tip .icon,
667
+ .note .icon,
668
+ .caution .icon,
669
+ .warning .icon,
670
+ .important .icon
671
+ {
672
+ _display : none; /* IE6 cannot display embedded images */
673
+ }
674
+
675
+ .figure > .title
676
+ {
677
+ text-align : center;
678
+ }
679
+
680
+ .figure .title
681
+ {
682
+ _text-align : center; /* for IE6 */
683
+ }
684
+
685
+ .figure > .content img
686
+ {
687
+ display : block;
688
+ margin : auto;
689
+ }
690
+
691
+ .figure .content img
692
+ {
693
+ _display : block; /* for IE6 */
694
+ _margin : auto; /* for IE6 */
695
+ }
696
+
697
+ screen: |
698
+ body
699
+ {
700
+ margin : auto;
701
+ padding : 0.5em;
702
+ max-width : 36em;
703
+ }
704
+
705
+ /* hyperlinks */
706
+
707
+ a
708
+ {
709
+ color : #0000FF;
710
+ text-decoration : none;
711
+ }
712
+
713
+ a:visited
714
+ {
715
+ color : #800080;
716
+ }
717
+
718
+ a:hover
719
+ {
720
+ color : #FF0000;
721
+ text-decoration : underline;
722
+ }
723
+
724
+ a:target
725
+ {
726
+ color : #FF0000;
727
+ text-decoration : underline;
728
+ }
729
+
730
+ a.toc:link,
731
+ a.toc:visited
732
+ {
733
+ text-decoration : none;
734
+ z-index : 1;
735
+ }
736
+
737
+ a img
738
+ {
739
+ border : none;
740
+ }
741
+
742
+ /* source code */
743
+
744
+ tt,
745
+ code,
746
+ pre
747
+ {
748
+ font-family : Consolas, "Lucida Console", monospace;
749
+ }
750
+
751
+ tt
752
+ {
753
+ font-weight : bold;
754
+ color : #A52A2A;
755
+ background-color : #FFFAF0;
756
+ }
757
+
758
+ /* output of syntax colorizer */
759
+ .code
760
+ {
761
+ background-color : #FFFFF0;
762
+ }
763
+
764
+ pre
765
+ {
766
+ line-height : normal;
767
+ border : 1px dashed #C0C0C0;
768
+ background-color : #F5FFDF;
769
+ padding : 1em;
770
+ overflow : auto;
771
+ cursor : text;
772
+ }
773
+
774
+ /*
775
+ pre:hover
776
+ {
777
+ border : none;
778
+ position : fixed;
779
+ z-index : 1;
780
+ margin : 0;
781
+ top : 0;
782
+ left : 0;
783
+ right : 0;
784
+ bottom : 0;
785
+ overflow : auto;
786
+ cursor : text;
787
+ }
788
+ */
789
+
790
+ /* emphasis */
791
+
792
+ blockquote
793
+ {
794
+ margin : 1em;
795
+ border : 5px dotted #C0C0C0;
796
+ padding : 1em;
797
+ color : #444;
798
+ }
799
+
800
+ hr
801
+ {
802
+ color : #FF0000; /* for IE6 */
803
+ background-color : #FF0000; /* for Firefox */
804
+ }
805
+
806
+ print: |
807
+ /* headings */
808
+
809
+ h1,
810
+ h2,
811
+ h3,
812
+ h4,
813
+ h5,
814
+ h6
815
+ {
816
+ font-weight : normal;
817
+ }
818
+
819
+ /* hyperlinks */
820
+
821
+ a:link,
822
+ a:visited,
823
+ a:active
824
+ {
825
+ color : #0000FF;
826
+ font-weight : bold;
827
+ text-decoration : underline;
828
+ }
829
+
830
+ a:after
831
+ {
832
+ content : " (" attr(href) ")";
833
+ font-family : sans-serif;
834
+ font-weight : normal;
835
+ font-size : 90%;
836
+ }
837
+
838
+ a[href^="#"]:after
839
+ {
840
+ content : "";
841
+ }
842
+
843
+ a[href^="#"]
844
+ {
845
+ color : #A52A2A;
846
+ font-weight : lighter;
847
+ text-decoration : none;
848
+ font-style : italic;
849
+ }
850
+
851
+ a.toc:link,
852
+ a.toc:visited
853
+ {
854
+ color : inherit;
855
+ .color : #000000; /* for IE6 and IE7 */
856
+ font-weight : inherit;
857
+ text-decoration : none;
858
+ font-style : normal;
859
+ }
860
+
861
+ /* source code */
862
+
863
+ tt
864
+ {
865
+ color : inherit;
866
+ background-color : inherit;
867
+ font-weight : normal;
868
+ }
869
+
870
+ pre,
871
+ .code
872
+ {
873
+ border : none;
874
+ overflow : visible;
875
+ background-color : inherit;
876
+ }
877
+
878
+ /* document structure */
879
+
880
+ #lof
881
+ {
882
+ display : none;
883
+ }
884
+
885
+ /* document nodes */
886
+
887
+ .part > .title > big,
888
+ .chapter > .title > big
889
+ {
890
+ padding-bottom : 0.5em;
891
+ }
892
+
893
+ .part .title big,
894
+ .chapter .title big
895
+ {
896
+ _padding-bottom : 0.5em; /* for IE6 */
897
+ }