erbook 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. data/LICENSE +13 -0
  2. data/README +14 -0
  3. data/Rakefile +77 -0
  4. data/bin/erbook +309 -0
  5. data/doc/HelloWorld.input +37 -0
  6. data/doc/HelloWorld.spec +62 -0
  7. data/doc/README +6 -0
  8. data/doc/api/classes/ERBook.html +164 -0
  9. data/doc/api/classes/RDoc.html +112 -0
  10. data/doc/api/classes/RDoc/AnyMethod.html +195 -0
  11. data/doc/api/classes/RDoc/AnyMethod.src/M000005.html +18 -0
  12. data/doc/api/classes/RDoc/AnyMethod.src/M000006.html +23 -0
  13. data/doc/api/classes/RDoc/AnyMethod.src/M000007.html +18 -0
  14. data/doc/api/classes/RDoc/AnyMethod.src/M000008.html +22 -0
  15. data/doc/api/classes/RDoc/TopLevel.html +250 -0
  16. data/doc/api/classes/RDoc/TopLevel.src/M000009.html +18 -0
  17. data/doc/api/classes/RDoc/TopLevel.src/M000010.html +18 -0
  18. data/doc/api/classes/RDoc/TopLevel.src/M000011.html +18 -0
  19. data/doc/api/classes/RDoc/TopLevel.src/M000012.html +29 -0
  20. data/doc/api/classes/RDoc/TopLevel.src/M000013.html +25 -0
  21. data/doc/api/classes/RDoc/TopLevel.src/M000014.html +18 -0
  22. data/doc/api/classes/String.html +261 -0
  23. data/doc/api/classes/String.src/M000001.html +18 -0
  24. data/doc/api/classes/String.src/M000002.html +34 -0
  25. data/doc/api/classes/String.src/M000003.html +20 -0
  26. data/doc/api/classes/String.src/M000004.html +26 -0
  27. data/doc/api/created.rid +1 -0
  28. data/doc/api/files/lib/erbook/html_rb.html +125 -0
  29. data/doc/api/files/lib/erbook/rdoc_rb.html +116 -0
  30. data/doc/api/files/lib/erbook_rb.html +107 -0
  31. data/doc/api/fr_class_index.html +31 -0
  32. data/doc/api/fr_file_index.html +29 -0
  33. data/doc/api/fr_method_index.html +40 -0
  34. data/doc/api/index.html +24 -0
  35. data/doc/api/rdoc-style.css +208 -0
  36. data/doc/erbook.png +0 -0
  37. data/doc/erbook.svg +349 -0
  38. data/doc/feed-icon-28x28.png +0 -0
  39. data/doc/index.html +2663 -0
  40. data/doc/manual.erb +769 -0
  41. data/fmt/html.icons/LICENSE +67 -0
  42. data/fmt/html.icons/README +31 -0
  43. data/fmt/html.icons/caution.png +0 -0
  44. data/fmt/html.icons/important.png +0 -0
  45. data/fmt/html.icons/note.png +0 -0
  46. data/fmt/html.icons/quote.png +0 -0
  47. data/fmt/html.icons/tip.png +0 -0
  48. data/fmt/html.icons/warning.png +0 -0
  49. data/fmt/html.yaml +1185 -0
  50. data/fmt/latex.yaml +2 -0
  51. data/fmt/man.yaml +2 -0
  52. data/fmt/text.yaml +2 -0
  53. data/lib/erbook.rb +13 -0
  54. data/lib/erbook/html.rb +145 -0
  55. data/lib/erbook/rdoc.rb +126 -0
  56. metadata +141 -0
@@ -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,31 @@
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
+ | quote.png | scalable/apps/internet-group-chat.png |
13
+ +---------------+-----------------------------------------------+
14
+
15
+ See the file named LICENSE in this directory for copying conditions.
16
+ The original README of the Tango Icon Theme release is reproduced below.
17
+
18
+
19
+
20
+ Tango Icon Theme
21
+ ----------------
22
+
23
+ This is an icon theme that follows the Tango visual guidelines [1]. Currently
24
+ it depends on Imagemagick for creation of 24x24 bitmaps by adding a 1px padding
25
+ around the 22x22px version. For GNOME and KDE you will also need
26
+ icon-naming-utils that allow the theme to work in these environments before
27
+ they follow the new naming scheme [2].
28
+
29
+
30
+ [1] http://tango-project.org/Tango_Icon_Theme_Guidelines
31
+ [2] http://tango-project.org/Standard_Icon_Naming_Specification
Binary file
Binary file
Binary file
@@ -0,0 +1,1185 @@
1
+ desc: web page for the Internet
2
+
3
+ code: |
4
+ # load the String#to_html and String#to_inline_html methods
5
+ require 'erbook/html'
6
+
7
+ class String
8
+ # Transforms this UTF-8 string into HTML entities.
9
+ def to_html_entities
10
+ unpack('U*').map! {|c| "&##{c};"}.join
11
+ end
12
+
13
+ # Transforms this string into a valid URI fragment.
14
+ # See http://www.nmt.edu/tcc/help/pubs/xhtml/id-type.html
15
+ def to_uri_fragment
16
+ # remove HTML tags from the input
17
+ buf = gsub(/<.*?>/, '')
18
+
19
+ # The first or only character must be a letter.
20
+ buf.insert(0, 'a') unless buf[0,1] =~ /[[:alpha:]]/
21
+
22
+ # The remaining characters must be letters, digits, hyphens (-),
23
+ # underscores (_), colons (:), or periods (.) or Unicode characters
24
+ buf.unpack('U*').map! do |code|
25
+ if code > 0xFF or code.chr =~ /[[:alnum:]\-_:\.]/
26
+ code
27
+ else
28
+ 32 # ASCII character code for a single space
29
+ end
30
+ end.pack('U*').strip.gsub(/[[:space:]-]+/, '-')
31
+ end
32
+ end
33
+
34
+ class Hash
35
+ # Transforms this hash into a string of HTML attribute key=value pairs.
36
+ def to_html_atts
37
+ inject([]) {|s,(k,v)| s << %( #{k}="#{v}") }.join
38
+ end
39
+ end
40
+
41
+ class Node
42
+ # Returns the user-defined title for this node's content.
43
+ def title
44
+ @title ||= args[0]
45
+ end
46
+
47
+ # Returns the user-defined indentifer for this node.
48
+ def id
49
+ @id ||= args[1]
50
+ end
51
+
52
+ def type_label
53
+ type.to_s.capitalize
54
+ end
55
+
56
+ def type_atts
57
+ { :class => type }.to_html_atts
58
+ end
59
+
60
+ def title_atts
61
+ { :class => :title, :id => here_frag }.to_html_atts
62
+ end
63
+
64
+ def title_html
65
+ title.to_s.to_inline_html
66
+ end
67
+
68
+ def content_html
69
+ content.to_s.to_html
70
+ end
71
+
72
+ def title_link aTitle = nil
73
+ here_link here_frag, aTitle || title_html
74
+ # %{#{aTitle || title_html}&nbsp;&nbsp;&nbsp;&nbsp;#{here_link here_frag, '&para;'}&nbsp;#{list_link here_frag, list_frag, '&equiv;'}}
75
+ end
76
+
77
+ def index_link
78
+ list_link here_frag, list_frag, index
79
+ # %{<span id="#{here_frag}">#{index}</span>}
80
+ end
81
+
82
+ def number_link
83
+ list_link here_frag, list_frag, [type_label, number].compact.join(' ')
84
+ # %{<span id="#{here_frag}">#{[type_label, number].compact.join(' ')}</span>}
85
+ end
86
+
87
+ def number_and_title_link
88
+ "#{number_link}.&nbsp;&nbsp;#{title_link}"
89
+ end
90
+
91
+ def index_and_title_link
92
+ "#{index_link}&nbsp;&nbsp;#{title_link}"
93
+ end
94
+
95
+ def content_div
96
+ %{<div class="content">#{content_html}</div>}
97
+ end
98
+
99
+ @@frags = []
100
+
101
+ # Returns a unique URI fragment for this node.
102
+ def here_frag
103
+ unless defined? @here_frag
104
+ salt = object_id.abs
105
+ frag = (id || title || salt).to_s.to_uri_fragment
106
+
107
+ # make it unique
108
+ while @@frags.include? frag
109
+ frag << '-' << (index || number || salt).to_s
110
+ end
111
+
112
+ @@frags << frag
113
+ @here_frag = frag
114
+ end
115
+
116
+ @here_frag
117
+ end
118
+
119
+ # Returns the URI fragment for the location in the table
120
+ # of contents / list of figures that points this node.
121
+ def list_frag
122
+ @list_frag ||= "rev:#{here_frag}"
123
+ end
124
+ end
125
+
126
+ def here_link aHereFrag, aLabel
127
+ %{<a class="here" title="Permanent link to this section" href="##{aHereFrag}">#{aLabel}</a>}
128
+ end
129
+
130
+ def list_link aHereFrag, aListFrag, aLabel
131
+ %{<a class="list" title="Return to table of contents" href="##{aListFrag}">#{aLabel}</a>}
132
+ end
133
+
134
+ # Returns a hyperlink to the given URL of
135
+ # the given label and mouse-hover title.
136
+ def link aUrl, aLabel = aUrl, aTitle = nil
137
+ %{<a href="#{h aUrl}"#{%{ title="#{aTitle}"} if aTitle}>#{aLabel}</a>}
138
+ end
139
+
140
+ # Encodes the given input in base64 format.
141
+ def base_64_encode aInput
142
+ [aInput].pack('m')
143
+ end
144
+
145
+ # Returns a string denoting embedded, base64 encoded data.
146
+ def base_64_embed aData, aFormat
147
+ "data:#{aFormat.to_s.downcase};base64,#{aData.tr("\n", '')}"
148
+ end
149
+
150
+ # Returns a string denoting embedded, base64 encoded image data.
151
+ # aFormat:: format of the image data (e.g. PNG, JPG, GIF, etc.)
152
+ def base_64_embed_image_data aData, aFormat
153
+ base_64_embed aData, "image/#{aFormat}"
154
+ end
155
+
156
+ # Returns a HTML <img> tag that embeds the given image file.
157
+ #
158
+ # aPath:: path to the image file
159
+ # aFormat:: format of the image file (e.g. PNG, JPG, GIF, etc.)
160
+ # aAtts:: additional attributes for the <img> tag
161
+ #
162
+ def embed_image_file aPath, aFormat = aPath[/\w+/], aAtts = {}
163
+ data = base_64_encode File.read(aPath)
164
+ aAtts['src'] = base_64_embed_image_data(data, aFormat)
165
+ "<img#{aAtts.to_html_atts}/>"
166
+ end
167
+
168
+ ##
169
+ # load admonition icons
170
+ #
171
+
172
+ Icon = Struct.new(:path, :name, :format, :data)
173
+
174
+ class Icon
175
+ # Returns the CSS class for this icon.
176
+ def css_class
177
+ @css_class ||= "icon-#{name}"
178
+ end
179
+
180
+ # Returns a CSS url() containing embedded image data.
181
+ def css_image
182
+ "url(#{base_64_embed_image_data self.data, self.format})"
183
+ end
184
+ end
185
+
186
+ ICONS = {}
187
+
188
+ Dir[File.join(ERBook::FORMATS_DIR, 'html.icons', '*.*')].each do |path|
189
+ ext = File.extname(path)
190
+ name = File.basename(path, ext)
191
+ data = base_64_encode File.open(path, 'rb') {|f| f.read }
192
+
193
+ ICONS[name] = Icon.new(path, name, ext.sub('.', ''), data)
194
+ end
195
+
196
+ # STDERR.puts ICONS.inspect
197
+
198
+
199
+ nodes:
200
+ ##
201
+ # Structure
202
+ #
203
+
204
+ header: &header
205
+ toc: false
206
+ lof: false
207
+ index: false
208
+ number: false
209
+ silent: true
210
+ output: <%= @node.content_html %>
211
+
212
+ header_outside_above: &header_insert
213
+ toc: false
214
+ lof: false
215
+ index: false
216
+ number: false
217
+ silent: true
218
+ output: <div class="<%= @node.type %>"><%= @node.content_html %></div>
219
+
220
+ header_inside_above: *header_insert
221
+ header_inside_below: *header_insert
222
+ header_outside_below: *header_insert
223
+
224
+ footer: *header
225
+ footer_outside_above: *header_insert
226
+ footer_inside_above: *header_insert
227
+ footer_inside_below: *header_insert
228
+ footer_outside_below: *header_insert
229
+
230
+ abstract:
231
+ toc: false
232
+ lof: false
233
+ index: false
234
+ number: false
235
+ silent: true
236
+ output: |
237
+ <% label = @node.type_label %>
238
+ <div id="<%= label %>">
239
+ <h1 class="title"><%= here_link label, label %></h1>
240
+ <%= @node.content_div %>
241
+ </div>
242
+
243
+
244
+ ##
245
+ # Organization
246
+ #
247
+
248
+ part: &latex
249
+ toc: true
250
+ lof: false
251
+ index: true
252
+ number: true
253
+ output: |
254
+ <div class="<%= @node.type %>">
255
+ <h1<%= @node.title_atts %>>
256
+ <%= @node.type_label %>&nbsp;<%= @node.index_link %>
257
+ <br/>
258
+ <big><%= @node.title_link %></big>
259
+ </h1>
260
+ <%= @node.content_div %>
261
+ </div>
262
+
263
+ chapter: *latex
264
+
265
+ section:
266
+ toc: true
267
+ lof: false
268
+ index: true
269
+ number: true
270
+ output: |
271
+ <% depth = [6, @node.depth + 1].min %>
272
+ <div class="<%= @node.type %>">
273
+ <h<%= depth %><%= @node.title_atts %>>
274
+ <%= @node.index_and_title_link %>
275
+ </h<%= depth %>>
276
+ <%= @node.content_div %>
277
+ </div>
278
+
279
+ paragraph:
280
+ toc: false
281
+ lof: false
282
+ index: false
283
+ number: false
284
+ output: |
285
+ <div<%= @node.type_atts %>>
286
+ <p<%= @node.title_atts %>><%= @node.title_link %></p>
287
+ <%= @node.content_div %>
288
+ </div>
289
+
290
+
291
+ ##
292
+ # Admonitions
293
+ #
294
+
295
+ tip: &admonition
296
+ toc: false
297
+ lof: true
298
+ index: false
299
+ number: true
300
+ output: |
301
+ <div<%= @node.type_atts %>>
302
+ <p<%= @node.title_atts %>><%= @node.number_and_title_link %></p>
303
+ <div class="content <%=
304
+ $use_icons = true unless defined? $use_icons
305
+
306
+ if $use_icons and icon = ICONS[@node.type]
307
+ ($icons_used ||= []) << icon
308
+ icon.css_class
309
+ end
310
+ %>"><%= @node.content_html %></div>
311
+ </div>
312
+
313
+ note: *admonition
314
+ caution: *admonition
315
+ warning: *admonition
316
+ important: *admonition
317
+
318
+
319
+ ##
320
+ # Auxilary materials (formal blocks)
321
+ # see http://www.sagehill.net/docbookxsl/FormalTitles.html
322
+ #
323
+
324
+ figure: &formal
325
+ toc: false
326
+ lof: true
327
+ index: false
328
+ number: true
329
+ output: |
330
+ <div class="<%= @node.type %>">
331
+ <p class="title"><%= @node.number_and_title_link %></p>
332
+ <%= @node.content_div %>
333
+ </div>
334
+
335
+ table: *formal
336
+ example: *formal
337
+ equation: *formal
338
+ procedure: *formal
339
+
340
+
341
+ ##
342
+ # cross-references
343
+ #
344
+
345
+ xref:
346
+ toc: false
347
+ lof: false
348
+ index: false
349
+ number: false
350
+ output: |
351
+ <%=
352
+ scope = @nodes.select {|n| n.content}
353
+
354
+ target = scope.find {|n| n.id == @node.args[0]} || # id has 1st priority
355
+ scope.find {|n| n.title == @node.args[0]}
356
+
357
+ if target
358
+ prefix = "#{target.type_label} #{target.index || target.number}"
359
+
360
+ title_text =
361
+ if target.type == 'reference'
362
+ prefix
363
+ else
364
+ [prefix, target.title].compact.join('. ')
365
+ end
366
+
367
+ title_auto = @node.args.length < 2
368
+
369
+ title_html =
370
+ if title_auto
371
+ title_text
372
+ else
373
+ @node.args[1].to_s
374
+ end.to_inline_html
375
+
376
+ %{<a class="#{@node.type}" href="##{target.here_frag}"#{
377
+ %( title="#{title_text}") unless title_auto
378
+ }>#{title_html}</a>}
379
+ else
380
+ raise ArgumentError, "invalid cross-reference to #{@node.title.inspect}", @node.trace
381
+ end
382
+ %>
383
+
384
+
385
+ ##
386
+ # Bibliography
387
+ #
388
+
389
+ reference:
390
+ toc: false
391
+ lof: false
392
+ index: false
393
+ number: true
394
+ silent: true
395
+
396
+ cite:
397
+ toc: false
398
+ lof: false
399
+ index: false
400
+ number: false
401
+ output: |
402
+ <%=
403
+ target = @types['reference'].find {|n| n.title == @node.args[0]}
404
+
405
+ if target
406
+ '<sup>[%s]</sup>' % [
407
+
408
+ '<a class="%s" href="#%s">%s</a>' % [
409
+ @node.type,
410
+ target.here_frag,
411
+ target.number
412
+ ],
413
+
414
+ *@node.args[1..-1]
415
+
416
+ ].join(', ')
417
+ else
418
+ raise ArgumentError, "invalid citation for #{@node.title.inspect}", @node.trace
419
+ end
420
+ %>
421
+
422
+ output: |
423
+ <%
424
+ # set default parameter values
425
+ $title = '$title' unless defined? $title
426
+ $authors = {'$authors' => nil} unless defined? $authors
427
+ $date = Time.now.strftime("%d %B %Y") unless defined? $date
428
+
429
+ abstract = @types['abstract'].first
430
+
431
+ references = @types['reference']
432
+ if references.empty?
433
+ references = nil
434
+ end
435
+
436
+ # compute table of contents
437
+ toc_builder = lambda do |n|
438
+ if @spec['nodes'][n.type]['toc']
439
+ entry = '%s<a id="%s" href="#%s">%s</a>' % [
440
+ (n.index.to_s + '&nbsp;&nbsp;' if n.index),
441
+ n.list_frag,
442
+ n.here_frag,
443
+ n.title.to_s.to_inline_html
444
+ ]
445
+ nested = n.children.inject('') {|s,c| s << toc_builder[c] }
446
+
447
+ %{<li>#{entry}#{ "<ul>#{nested}</ul>" unless nested.empty? }</li>}
448
+ else
449
+ ''
450
+ end
451
+ end
452
+
453
+ toc = @roots.inject('') {|s,n| s << toc_builder[n] }
454
+
455
+ # compute list of figures
456
+ lof_enums = {} # type => nodes
457
+
458
+ @spec['nodes'].each_pair do |name, info|
459
+ if info['lof']
460
+ nodes = @types[name]
461
+ lof_enums[name] = nodes unless nodes.empty?
462
+ end
463
+ end
464
+
465
+ lof_sections = []
466
+
467
+ lof = lof_enums.sort.map do |(type, nodes)|
468
+ nested = nodes.map do |n|
469
+ %{<li><a id="#{n.list_frag}" href="##{n.here_frag}">#{n.title.to_s.to_inline_html}</a></li>}
470
+ end
471
+
472
+ label = type.capitalize << 's' # TODO: pluralize this properly
473
+ lof_sections << label
474
+
475
+ %{<h2 id="#{label}" class="title"><a class="here" href="##{label}">#{label}</a></h2> <ol>#{nested}</ol>}
476
+ end
477
+ %>
478
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
479
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
480
+ <html xmlns="http://www.w3.org/1999/xhtml">
481
+ <head>
482
+ <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
483
+ <meta name="date" content="<%= $date %>"/>
484
+ <meta name="author" content="<%= $authors.keys.join(', ') %>"/>
485
+ <meta name="generator" content="<%= ERBook::DISPLAY %>"/>
486
+ <% $feeds.each_pair do |here_frag, fmt| %>
487
+ <link rel="alternate" type="application/<%= fmt %>+xml" href="<%= here_frag %>"/>
488
+ <% end if $feeds %>
489
+ <title><%= $title.to_s.to_inline_html %></title>
490
+
491
+ <% if $use_icons %>
492
+ <style type="text/css" media="screen">
493
+ blockquote {
494
+ background-image : <%= ICONS['quote'].css_image %>;
495
+ background-repeat : no-repeat;
496
+ padding-left : 65px;
497
+ min-height : 40px;
498
+ margin-left : 0;
499
+ }
500
+ </style>
501
+ <% end %>
502
+
503
+ <% if defined? $icons_used and not $icons_used.empty? %>
504
+ <style type="text/css" media="screen">
505
+ <% $icons_used.each do |icon| %>
506
+ .<%= icon.css_class %> {
507
+ background-image: <%= icon.css_image %>;
508
+ background-repeat: no-repeat;
509
+ padding-left: 4em;
510
+ }
511
+ <% end %>
512
+ </style>
513
+
514
+ <style type="text/css" media="print">
515
+ <% $icons_used.each do |icon| %>
516
+ .<%= icon.css_class %> {
517
+ <%
518
+ # we use list-style-image instead of
519
+ # background-image because the latter is
520
+ # neither printable nor shown in print
521
+ # preview by default in most browsers
522
+ #
523
+ # see http://www.web-graphics.com/mtarchive/001703.php
524
+ %>
525
+ display: list-item;
526
+ list-style-image: <%= icon.css_image %>;
527
+ list-style-position: inside;
528
+ }
529
+
530
+ .<%= icon.css_class %> li {
531
+ list-style-image: none;
532
+ }
533
+ <% end %>
534
+ </style>
535
+ <% end %>
536
+
537
+ <%
538
+ styles = @spec['styles']
539
+ (styles.keys - %w[common]).each do |media|
540
+ %>
541
+ <style type="text/css" media="<%= media %>">
542
+ <!--
543
+ <%= styles['common'] %>
544
+ <%= styles[media] %>
545
+ -->
546
+ </style>
547
+ <% end %>
548
+ </head>
549
+ <body>
550
+ <%
551
+ # menu of links to link sections
552
+ nav = [
553
+ ('Abstract' if abstract),
554
+ 'Contents',
555
+ lof_sections,
556
+ ('References' if references)
557
+ ].flatten.compact
558
+
559
+ if nav.length > 1
560
+ %>
561
+ <div id="nav">
562
+ <%=
563
+ nav.map do |section|
564
+ %{<a href="##{section}">#{section}</a>}
565
+ end.join(' &middot; ')
566
+ %>
567
+ </div>
568
+ <% end %>
569
+
570
+ <br style="display: none"/>
571
+ <hr style="display: none"/>
572
+ <br style="display: none"/>
573
+
574
+ <%= node = @types['header_outside_above'].first and node.output %>
575
+ <div id="header">
576
+ <%= node = @types['header_inside_above'].first and node.output %>
577
+ <% if header = @types['header'].first %>
578
+ <%= header.output %>
579
+ <% else %>
580
+ <%= $logo if defined? $logo %>
581
+ <h1 class="title"><%= $title.to_s.to_inline_html %></h1>
582
+ <h2 class="authors"><%=
583
+ $authors.map do |(name, here_frag)|
584
+ if here_frag
585
+ %{<a href="#{here_frag}">#{name}</a>}
586
+ else
587
+ name
588
+ end
589
+ end.join(', ')
590
+ %></h2>
591
+ <h3 class="date"><%= $date %></h3>
592
+ <% end %>
593
+ <%= node = @types['header_inside_below'].first and node.output %>
594
+ </div>
595
+ <%= node = @types['header_outside_below'].first and node.output %>
596
+
597
+ <%= abstract.output if abstract %>
598
+
599
+ <br style="display: none"/>
600
+ <hr style="display: none"/>
601
+ <br style="display: none"/>
602
+
603
+ <% unless toc.empty? %>
604
+ <div id="toc">
605
+ <h1 class="title" id="Contents"><a class="here" href="#Contents">Contents</a></h1>
606
+ <ul>
607
+ <%= toc %>
608
+
609
+ <% if references %>
610
+ <li><a href="#References">References</a></li>
611
+ <% end %>
612
+ </ul>
613
+ </div>
614
+ <% end %>
615
+
616
+ <% unless lof.empty? %>
617
+ <div id="lof"><%= lof %></div>
618
+ <% end %>
619
+
620
+ <br style="display: none"/>
621
+ <hr style="display: none"/>
622
+ <br style="display: none"/>
623
+
624
+ <div id="content"><%= @content %></div>
625
+
626
+ <% if references %>
627
+ <div id="bib">
628
+ <h1 class="title" id="References"><a class="here" href="#References">References</a></h1>
629
+ <ol>
630
+ <% references.each do |n| %>
631
+ <li id="<%= n.here_frag %>"><%= n.content_html %></li>
632
+ <% end %>
633
+ </ol>
634
+ </div>
635
+ <% end %>
636
+
637
+ <br style="display: none"/>
638
+ <hr style="display: none"/>
639
+ <br style="display: none"/>
640
+
641
+ <%= node = @types['footer_outside_above'].first and node.output %>
642
+ <div id="footer">
643
+ <%= node = @types['footer_inside_above'].first and node.output %>
644
+ <% if footer = @types['footer'].first %>
645
+ <%= footer.content.to_s.to_html %>
646
+ <% else %>
647
+ Generated by <a href="<%= ERBook::WEBSITE %>"><%= ERBook::DISPLAY %></a> on <%= Time.now %>.
648
+ <% end %>
649
+
650
+ <% if $icons_used %>
651
+ <div id="footer-credits">
652
+ The icons used in this document are &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>.
653
+ </div>
654
+ <% end %>
655
+ <%= node = @types['footer_inside_below'].first and node.output %>
656
+ </div>
657
+ <%= node = @types['footer_outside_below'].first and node.output %>
658
+ </body>
659
+ </html>
660
+
661
+ styles:
662
+ common: |
663
+ body
664
+ {
665
+ color : #000000;
666
+ background-color : #FFFFFF;
667
+ line-height : 1.5em;
668
+ font-family : Calibri, Verdana, sans-serif;
669
+ }
670
+
671
+ /* emphasis */
672
+
673
+ blockquote
674
+ {
675
+ font-family : Georgia, serif;
676
+ color : #444;
677
+ }
678
+
679
+ em
680
+ {
681
+ }
682
+
683
+ hr
684
+ {
685
+ height : 0;
686
+ border : 0;
687
+ border-top : 2px solid #FF0000;
688
+ }
689
+
690
+ /* source code */
691
+
692
+ tt,
693
+ code,
694
+ pre
695
+ {
696
+ font-family : Monaco, Consolas, "Lucida Console", monospace;
697
+ font-size : 100%; /* appears like "size: small" otherwise */
698
+ }
699
+
700
+ /* hyperlinks */
701
+
702
+ a > img
703
+ {
704
+ border : none;
705
+ }
706
+
707
+ a img
708
+ {
709
+ _border : none; /* for IE6 */
710
+ }
711
+
712
+ /* lists */
713
+
714
+ #content li:first-child
715
+ {
716
+ margin-top : 1em;
717
+ }
718
+
719
+ #content li
720
+ {
721
+ margin-bottom : 1em;
722
+ }
723
+
724
+ /* headings */
725
+
726
+ h1,
727
+ h2,
728
+ h3,
729
+ h4,
730
+ h5,
731
+ h6,
732
+ .title
733
+ {
734
+ font-weight : lighter;
735
+ font-family : Constantia, "Book Antiqua", "URW Bookman L", serif;
736
+ }
737
+
738
+ #lof h1,
739
+ #lof h2,
740
+ #lof h3,
741
+ #lof h4,
742
+ #lof h5,
743
+ #lof h6
744
+ {
745
+ margin-top : 1.25em;
746
+ }
747
+
748
+ #content h1,
749
+ #content h2,
750
+ #content h3,
751
+ #content h4,
752
+ #content h5,
753
+ #content h6
754
+ {
755
+ margin-top : 2.5em;
756
+ line-height : 1.25em;
757
+ }
758
+
759
+ #content h1
760
+ {
761
+ font-size : 2.0em;
762
+ }
763
+
764
+ #content h2
765
+ {
766
+ font-size : 1.8em;
767
+ }
768
+
769
+ #content h3
770
+ {
771
+ font-size : 1.6em;
772
+ }
773
+
774
+ #content h4
775
+ {
776
+ font-size : 1.4em;
777
+ }
778
+
779
+ #content h5
780
+ {
781
+ font-size : 1.2em;
782
+ }
783
+
784
+ #content h6
785
+ {
786
+ font-size : 1.0em;
787
+ }
788
+
789
+ /* tables */
790
+
791
+ table
792
+ {
793
+ border-collapse : collapse; /* no spacing between cell borders */
794
+ margin : auto; /* center horizontally */
795
+ margin-top : 1em;
796
+ }
797
+
798
+ th,
799
+ td
800
+ {
801
+ padding : 1em;
802
+ border : 1px solid #bbb;
803
+ vertical-align : top;
804
+ background-color : inherit;
805
+ _background-color : #FFFFFF; /* for IE6 */
806
+ }
807
+
808
+ th
809
+ {
810
+ background-color : #F5F5F5;
811
+ }
812
+
813
+ /* document structure */
814
+
815
+ #nav
816
+ {
817
+ text-align : center;
818
+ margin-bottom : 4em;
819
+ }
820
+
821
+ #header
822
+ {
823
+ text-align : center;
824
+ }
825
+
826
+ .header_outside_above,
827
+ #header,
828
+ .header_outside_below
829
+ {
830
+ margin-bottom : 5em;
831
+ }
832
+
833
+ .footer_outside_above,
834
+ #footer,
835
+ .footer_outside_below
836
+ {
837
+ margin-top : 5em;
838
+ }
839
+
840
+ #header .header_inside_above,
841
+ #footer .footer_inside_above
842
+ {
843
+ margin-bottom : 4em;
844
+ }
845
+
846
+ #header .header_inside_below,
847
+ #footer .footer_inside_below
848
+ {
849
+ margin-top : 4em;
850
+ }
851
+
852
+ #Abstract
853
+ {
854
+ margin-bottom : 5em;
855
+ }
856
+
857
+ #toc li
858
+ {
859
+ list-style-type : none;
860
+ }
861
+
862
+ #toc li ul
863
+ {
864
+ padding-bottom : 1em;
865
+ border-left : thick solid #F5F5F5;
866
+ _border-left : none; /* for IE6 */
867
+ }
868
+
869
+ #toc li ul:hover
870
+ {
871
+ border-color : #DCDCDC;
872
+ }
873
+
874
+ #toc > ul
875
+ {
876
+ padding-left : 1em;
877
+ }
878
+
879
+ #bib
880
+ {
881
+ margin-top : 5em;
882
+ }
883
+
884
+ #footer
885
+ {
886
+ border-top : thick dotted #DCDCDC;
887
+ padding-top : 1em;
888
+ text-align : center;
889
+ }
890
+
891
+ #footer-credits
892
+ {
893
+ margin-top : 1em;
894
+ margin-bottom : 2em;
895
+ }
896
+
897
+ /* document nodes */
898
+
899
+ .part > .title,
900
+ .chapter > .title
901
+ {
902
+ padding-bottom : 0.5em;
903
+ }
904
+
905
+ .part > .title > big,
906
+ .chapter > .title > big
907
+ {
908
+ display : block;
909
+ margin-top : 0.25em;
910
+ }
911
+
912
+ .part .title big,
913
+ .chapter .title big
914
+ {
915
+ _display : block; /* for IE6 */
916
+ _margin-top : 0.25em; /* for IE6 */
917
+ _margin-bottom : 0.75em; /* for IE6 */
918
+ }
919
+
920
+ .paragraph > .title,
921
+ .tip > .title,
922
+ .note > .title,
923
+ .caution > .title,
924
+ .warning > .title,
925
+ .important > .title,
926
+ .figure > .title,
927
+ .table > .title,
928
+ .example > .title,
929
+ .equation > .title,
930
+ .procedure > .title
931
+ {
932
+ font-size : large;
933
+ margin-top : 2em;
934
+ }
935
+
936
+ .paragraph .title,
937
+ .tip .title,
938
+ .note .title,
939
+ .caution .title,
940
+ .warning .title,
941
+ .important .title,
942
+ .figure .title,
943
+ .table .title,
944
+ .example .title,
945
+ .equation .title,
946
+ .procedure .title
947
+ {
948
+ _font-size : large; /* for IE6 */
949
+ _font-weight : bold; /* large is not bold in IE6 */
950
+ _margin-top : 2em; /* for IE6 */
951
+ }
952
+
953
+ .tip ,
954
+ .note ,
955
+ .caution ,
956
+ .warning ,
957
+ .important,
958
+ .figure ,
959
+ .table ,
960
+ .example ,
961
+ .equation ,
962
+ .procedure
963
+ {
964
+ margin : 3em;
965
+ }
966
+
967
+ .tip > .icon,
968
+ .note > .icon,
969
+ .caution > .icon,
970
+ .warning > .icon,
971
+ .important > .icon
972
+ {
973
+ float : left;
974
+ margin : 0 1em 1em 0; /* top right bottom left */
975
+ }
976
+
977
+ .tip .icon,
978
+ .note .icon,
979
+ .caution .icon,
980
+ .warning .icon,
981
+ .important .icon
982
+ {
983
+ _display : none; /* IE6 cannot display embedded images */
984
+ }
985
+
986
+ .figure > .title
987
+ {
988
+ text-align : center;
989
+ }
990
+
991
+ .figure .title
992
+ {
993
+ _text-align : center; /* for IE6 */
994
+ }
995
+
996
+ .figure > .content img
997
+ {
998
+ display : block;
999
+ margin : auto;
1000
+ }
1001
+
1002
+ .figure .content img
1003
+ {
1004
+ _display : block; /* for IE6 */
1005
+ _margin : auto; /* for IE6 */
1006
+ }
1007
+
1008
+ screen: |
1009
+ body
1010
+ {
1011
+ margin : auto;
1012
+ max-width : 36em;
1013
+ padding : 0.5em;
1014
+ }
1015
+
1016
+ /* source code */
1017
+
1018
+ tt
1019
+ {
1020
+ background-color : #F0F8FF;
1021
+ }
1022
+
1023
+ pre
1024
+ {
1025
+ cursor : text;
1026
+ line-height : normal;
1027
+ border : 1px solid #b1d827;
1028
+ background-color : #F5FFDF;
1029
+ padding : 1em;
1030
+ overflow : auto;
1031
+ }
1032
+
1033
+ /* output of the syntax coloring library */
1034
+ pre.code
1035
+ {
1036
+ background-color : #FFFFE8;
1037
+ border-color : #EEDD88;
1038
+ }
1039
+
1040
+ /* hyperlinks */
1041
+
1042
+ a
1043
+ {
1044
+ text-decoration : none;
1045
+ }
1046
+
1047
+ a:hover
1048
+ {
1049
+ text-decoration : underline;
1050
+ }
1051
+
1052
+ a:link
1053
+ {
1054
+ color : #0000FF;
1055
+ }
1056
+
1057
+ a:visited
1058
+ {
1059
+ color : #C71585;
1060
+ }
1061
+
1062
+ /* external hyperlinks */
1063
+ a:not([href^="#"]):before
1064
+ {
1065
+ content : "\2660"; /* &spades; */
1066
+ }
1067
+
1068
+ a.here,
1069
+ a.list
1070
+ {
1071
+ color : #000000;
1072
+ }
1073
+
1074
+ a:target,
1075
+ a:target *,
1076
+ *:target a.list
1077
+ {
1078
+ background-color : #FF4500 !important;
1079
+ color : #FFFFFF !important;
1080
+ }
1081
+
1082
+ a:target,
1083
+ *:target a.list
1084
+ {
1085
+ padding : 0.1em;
1086
+ font-weight : bolder;
1087
+ text-decoration : none;
1088
+ }
1089
+
1090
+ print: |
1091
+ /* source code */
1092
+
1093
+ tt
1094
+ {
1095
+ font-weight : normal;
1096
+ }
1097
+
1098
+ pre
1099
+ {
1100
+ border : none;
1101
+ }
1102
+
1103
+ /* headings */
1104
+
1105
+ h1,
1106
+ h2,
1107
+ h3,
1108
+ h4,
1109
+ h5,
1110
+ h6
1111
+ {
1112
+ font-weight : normal;
1113
+ clear : both;
1114
+ }
1115
+
1116
+ /* hyperlinks */
1117
+
1118
+ /* blend all hyperlinks with normal text */
1119
+ a:link,
1120
+ a:visited
1121
+ {
1122
+ color : #000000;
1123
+ text-decoration : none;
1124
+ }
1125
+
1126
+ /* emphasize external and cross-reference hyperlinks */
1127
+ a:not([href^="#"]):link,
1128
+ a:not([href^="#"]):visited,
1129
+ a.xref[title]:link,
1130
+ a.xref[title]:visited
1131
+ {
1132
+ color : #0000FF;
1133
+ text-decoration : underline;
1134
+ font-weight : bolder;
1135
+ }
1136
+
1137
+ /* show URL of destination for external hyperlinks */
1138
+ a:not([href^="#"]):after
1139
+ {
1140
+ content : " " attr(href);
1141
+ font-family : Monaco, Consolas, "Lucida Console", monospace;
1142
+ }
1143
+
1144
+ /* show name of destination for cross-references */
1145
+ a.xref[title]:after
1146
+ {
1147
+ content : " " attr(title);
1148
+ }
1149
+
1150
+ a:after
1151
+ {
1152
+ font-weight : normal;
1153
+ font-size : smaller;
1154
+ }
1155
+
1156
+ /* document structure */
1157
+
1158
+ #nav,
1159
+ #lof
1160
+ {
1161
+ display : none;
1162
+ }
1163
+
1164
+ #toc,
1165
+ .part,
1166
+ .chapter,
1167
+ #bib
1168
+ {
1169
+ page-break-before : always;
1170
+ }
1171
+
1172
+ /* document nodes */
1173
+
1174
+ .part > .title > big,
1175
+ .chapter > .title > big
1176
+ {
1177
+ padding-bottom : 0.5em;
1178
+ }
1179
+
1180
+ .part .title big,
1181
+ .chapter .title big
1182
+ {
1183
+ _padding-bottom : 0.5em; /* for IE6 */
1184
+ }
1185
+