gerbil 3.0.2 → 3.1.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.
@@ -34,6 +34,13 @@ code: |
34
34
  end
35
35
  end
36
36
 
37
+ class Hash
38
+ # Transforms this hash into a string of HTML attribute key=value pairs.
39
+ def to_html_atts
40
+ inject([]) {|s,(k,v)| s << %( #{k}="#{v}") }.join
41
+ end
42
+ end
43
+
37
44
  class Node
38
45
  # Returns the user-defined title for this node's content.
39
46
  def title
@@ -84,9 +91,9 @@ code: |
84
91
  # aFormat:: format of the image data (e.g. PNG, JPG, GIF, etc.)
85
92
  # aAttrs:: additional attributes for the <img> tag
86
93
  #
87
- def embed_image_data aData, aFormat, aAttrs
88
- atts = aAttrs.inject('') {|s,(k,v)| s << %( #{k}="#{v}") }
89
- %{<img src="data:image/#{aFormat};base64,#{aData}"#{atts}/>}
94
+ def embed_image_data aData, aFormat, aAtts = {}
95
+ aAtts['src'] = "data:image/#{aFormat};base64,#{aData}"
96
+ "<img#{aAtts.to_html_atts}/>"
90
97
  end
91
98
 
92
99
  # Returns a HTML <img> tag that embeds the given image file.
@@ -104,10 +111,9 @@ code: |
104
111
  Icon = Struct.new(:path, :name, :format, :data)
105
112
 
106
113
  class Icon
107
- # Returns a HTML image tag containing embedded image data. The given
108
- # attributes (name => value) are applied to the HTML tag declaration.
109
- def to_html aAttributes = {}
110
- embed_image_data data, format, aAttributes
114
+ # Returns the CSS class for this icon.
115
+ def css_class
116
+ @css_class ||= "icon-#{name}"
111
117
  end
112
118
  end
113
119
 
@@ -159,8 +165,9 @@ nodes:
159
165
  number: false
160
166
  silent: true
161
167
  output: |
162
- <div id="<%= @node.type %>">
163
- <h1 class="title"><%= @node.type.capitalize %></h1>
168
+ <% label = @node.type.capitalize %>
169
+ <div id="<%= label %>">
170
+ <h1 class="title"><a class="here" href="#<%= label %>"><%= label %></a></h1>
164
171
  <div class="content"><%= @node.content.to_s.to_html %></div>
165
172
  </div>
166
173
 
@@ -177,11 +184,11 @@ nodes:
177
184
  <div class="<%= @node.type %>">
178
185
  <h1 class="title">
179
186
  <%= @node.type.capitalize %>
180
- <a class="toc" id="<%= @node.url %>" href="#<%= @node.list_url %>"><%= @node.index %></a>
187
+ <a class="list" id="<%= @node.url %>" href="#<%= @node.list_url %>"><%= @node.index %></a>
181
188
 
182
189
  <br/>
183
190
 
184
- <big><%= @node.title.to_s.to_html %></big>
191
+ <a class="here" href="#<%= @node.url %>"><big><%= @node.title.to_s.to_html %></big></a>
185
192
  </h1>
186
193
 
187
194
  <div class="content"><%= @node.content.to_s.to_html %></div>
@@ -198,7 +205,7 @@ nodes:
198
205
  <% level = [6, @node.depth + 1].min %>
199
206
  <div class="<%= @node.type %>">
200
207
  <h<%= level %> class="title">
201
- <a class="toc" id="<%= @node.url %>" href="#<%= @node.list_url %>"><%= @node.index %></a>&nbsp;&nbsp;<%= @node.title.to_s.to_html %>
208
+ <a class="list" id="<%= @node.url %>" href="#<%= @node.list_url %>"><%= @node.index %></a>&nbsp;&nbsp;<a class="here" href="#<%= @node.url %>"><%= @node.title.to_s.to_html %></a>
202
209
  </h<%= level %>>
203
210
  <div class="content"><%= @node.content.to_s.to_html %></div>
204
211
  </div>
@@ -210,7 +217,7 @@ nodes:
210
217
  number: false
211
218
  output: |
212
219
  <div class="<%= @node.type %>">
213
- <p class="title"><%= @node.title.to_s.to_html %></p>
220
+ <p class="title" id="<%= @node.url %>"><a class="here" href="#<%= @node.url %>"><%= @node.title.to_s.to_html %></a></p>
214
221
  <div class="content"><%= @node.content.to_s.to_html %></div>
215
222
  </div>
216
223
 
@@ -225,18 +232,16 @@ nodes:
225
232
  number: true
226
233
  output: |
227
234
  <div class="<%= @node.type %>">
228
- <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>
235
+ <p class="title"><a class="list" id="<%= @node.url %>" href="#<%= @node.list_url %>"><%= @node.type.capitalize %> <%= @node.number %></a>.&nbsp;&nbsp;<a class="here" href="#<%= @node.url %>"><%= @node.title.to_s.to_html %></a></p>
229
236
 
230
- <%
237
+ <div class="content <%=
231
238
  $use_icons = true unless defined? $use_icons
232
239
 
233
- if $use_icons && icon = ICONS[@node.type]
240
+ if $use_icons and icon = ICONS[@node.type]
234
241
  ($icons_used ||= []) << icon
235
- %><%= icon.to_html :class => :icon %><%
242
+ icon.css_class
236
243
  end
237
- %>
238
-
239
- <div class="content"><%= @node.content.to_s.to_html %></div>
244
+ %>"><%= @node.content.to_s.to_html %></div>
240
245
  </div>
241
246
 
242
247
  note: *admonition
@@ -256,7 +261,7 @@ nodes:
256
261
  number: true
257
262
  output: |
258
263
  <div class="<%= @node.type %>">
259
- <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>
264
+ <p class="title"><a class="list" id="<%= @node.url %>" href="#<%= @node.list_url %>"><%= @node.type.capitalize %> <%= @node.number %></a>.&nbsp;&nbsp;<a class="here" href="#<%= @node.url %>"><%= @node.title.to_s.to_html %></a></p>
260
265
  <div class="content"><%= @node.content.to_s.to_html %></div>
261
266
  </div>
262
267
 
@@ -287,19 +292,25 @@ nodes:
287
292
  target.index || target.number
288
293
  ]
289
294
 
290
- unless target.type == 'reference'
291
- title = "<em>#{target.title.to_s.to_html}</em>"
292
- end
295
+ title_text =
296
+ if target.type == 'reference'
297
+ prefix
298
+ else
299
+ [prefix, target.title].compact.join('. ')
300
+ end
293
301
 
294
- '<a class="%s" href="#%s">%s</a>' % [
295
- @node.type,
296
- target.url,
297
- if @node.args.length > 1
298
- @node.args[1].to_s.to_html
302
+ title_auto = @node.args.length < 2
303
+
304
+ title_html =
305
+ if title_auto
306
+ title_text.to_html
299
307
  else
300
- [prefix, title].compact.join(': ')
308
+ @node.args[1].to_s.to_html
301
309
  end
302
- ]
310
+
311
+ %{<a class="#{@node.type}" href="##{target.url}"#{
312
+ %{ title="#{title_text}"} unless title_auto
313
+ }>#{title_html}</a>}
303
314
  else
304
315
  raise ArgumentError, "invalid cross-reference to #{@node.title.inspect}", @node.trace
305
316
  end
@@ -345,9 +356,60 @@ output: |
345
356
  $title = '$title' unless defined? $title
346
357
  $authors = {'$authors' => nil} unless defined? $authors
347
358
  $date = Time.now.strftime("%d %B %Y") unless defined? $date
359
+
360
+ # get a list of all icons used in the document, if any
361
+ icons_used = $icons_used if defined? $icons_used and not $icons_used.empty?
362
+
363
+ abstract = @types['abstract'].first
364
+
365
+ references = @types['reference']
366
+ references = nil if references.empty?
367
+
368
+ # compute table of contents
369
+ tocBuilder = lambda do |n|
370
+ if @spec['nodes'][n.type]['toc']
371
+ entry = '%s<a id="%s" href="#%s">%s</a>' % [
372
+ (n.index.to_s + '&nbsp;&nbsp;' if n.index),
373
+ n.list_url,
374
+ n.url,
375
+ n.title.to_s.to_html
376
+ ]
377
+ nested = n.children.inject('') {|s,c| s << tocBuilder[c] }
378
+
379
+ %{<li>#{entry}#{ "<ul>#{nested}</ul>" unless nested.empty? }</li>}
380
+ else
381
+ ''
382
+ end
383
+ end
384
+
385
+ toc = @roots.inject('') {|s,n| s << tocBuilder[n] }
386
+
387
+ # compute list of figures
388
+ lofEnums = {} # type => nodes
389
+
390
+ @spec['nodes'].each_pair do |name, info|
391
+ if info['lof']
392
+ nodes = @types[name]
393
+ lofEnums[name] = nodes unless nodes.empty?
394
+ end
395
+ end
396
+
397
+ lofSections = []
398
+
399
+ lof = lofEnums.sort.map do |(type, nodes)|
400
+ nested = nodes.map do |n|
401
+ %{<li><a id="#{n.list_url}" href="##{n.url}">#{n.title.to_s.to_html}</a></li>}
402
+ end
403
+
404
+ label = type.capitalize << 's'
405
+ lofSections << label
406
+
407
+ %{<h1 id="#{label}" class="title"><a class="here" href="##{label}">#{label}</a></h1> <ol>#{nested}</ol>}
408
+ end
348
409
  %>
349
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
350
- <html>
410
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
411
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
412
+ <html xmlns="http://www.w3.org/1999/xhtml">
351
413
  <head>
352
414
  <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
353
415
  <meta name="date" content="<%= $date %>"/>
@@ -358,17 +420,57 @@ output: |
358
420
  <% end if $feeds %>
359
421
  <title><%= $title.to_s.to_html %></title>
360
422
 
423
+ <% if icons_used %>
424
+ <style type="text/css" media="all">
425
+ <!--
426
+ <% icons_used.each do |icon| %>
427
+ .<%= icon.css_class %> {
428
+ <%
429
+ # we use list-style-image instead of background-image because the
430
+ # latter is neither printable nor shown in print preview by default
431
+ # in most browsers
432
+ #
433
+ # see http://www.web-graphics.com/mtarchive/001703.php
434
+ %>
435
+ display: list-item;
436
+ list-style-image: url(data:image/<%= icon.format %>;base64,<%= icon.data.tr("\n", '') %>);
437
+ list-style-position: inside;
438
+ }
439
+ <% end %>
440
+ -->
441
+ </style>
442
+ <% end %>
443
+
361
444
  <%
362
445
  styles = @spec['styles']
363
- %w[screen print].each do |media|
446
+ (styles.keys - %w[common]).each do |media|
364
447
  %>
365
448
  <style type="text/css" media="<%= media %>">
449
+ <!--
366
450
  <%= styles['common'] %>
367
451
  <%= styles[media] %>
452
+ -->
368
453
  </style>
369
454
  <% end %>
370
455
  </head>
371
456
  <body>
457
+ <div class="nav">
458
+ <%=
459
+ [
460
+ ('Abstract' if abstract),
461
+ 'Contents',
462
+ lofSections,
463
+ ('References' if references)
464
+ ].flatten.compact.map do |section|
465
+ %{<a href="##{section}">#{section}</a>}
466
+ end.join(' &middot; ')
467
+ %>
468
+ </div>
469
+
470
+ <br style="display: none"/>
471
+ <hr style="display: none"/>
472
+ <br style="display: none"/>
473
+
372
474
  <%= node = @types['header_outside_above'].first and node.output %>
373
475
  <div id="header">
374
476
  <%= node = @types['header_inside_above'].first and node.output %>
@@ -376,7 +478,7 @@ output: |
376
478
  <%= header.output %>
377
479
  <% else %>
378
480
  <%= $logo if defined? $logo %>
379
- <h1 class="title"><%= $title.to_s.to_html %></h1>
481
+ <h1 class="title"><a class="here" href="#"><%= $title.to_s.to_html %></a></h1>
380
482
  <h2 class="authors"><%=
381
483
  $authors.map do |(name, url)|
382
484
  if url
@@ -392,62 +494,40 @@ output: |
392
494
  </div>
393
495
  <%= node = @types['header_outside_below'].first and node.output %>
394
496
 
395
- <%= node = @types['abstract'].first and node.output %>
396
-
397
- <% # table of contents
398
- builder = lambda do |n|
399
- if @spec['nodes'][n.type]['toc']
400
- entry = '%s<a id="%s" href="#%s">%s</a>' % [
401
- (n.index.to_s + '&nbsp;&nbsp;' if n.index),
402
- n.list_url,
403
- n.url,
404
- n.title.to_s.to_html
405
- ]
406
- nested = n.children.inject('') {|s,c| s << builder[c] }
407
-
408
- %{<li>#{entry}#{ "<ul>#{nested}</ul>" unless nested.empty? }</li>}
409
- else
410
- ''
411
- end
412
- end
413
-
414
- toc = @roots.inject('') {|s,n| s << builder[n] }
497
+ <%= abstract.output if abstract %>
415
498
 
416
- unless toc.empty?
417
- %><div id="toc"><h1>Contents</h1> <ul><%= toc %></ul></div><%
418
- end
419
- %>
420
-
421
- <% # list of figures
422
- enums = {} # type => nodes
423
-
424
- @spec['nodes'].each_pair do |name, info|
425
- if info['lof']
426
- nodes = @types[name]
427
- enums[name] = nodes unless nodes.empty?
428
- end
429
- end
499
+ <br style="display: none"/>
500
+ <hr style="display: none"/>
501
+ <br style="display: none"/>
430
502
 
431
- lof = enums.sort.map do |(type, nodes)|
432
- nested = nodes.map do |n|
433
- %{<li><a id="#{n.list_url}" href="##{n.url}">#{n.title.to_s.to_html}</a></li>}
434
- end
503
+ <% unless toc.empty? %>
504
+ <div id="<%= label = 'Contents' %>">
505
+ <h1 class="title"><a class="here" href="#<%= label %>"><%= label %></a></h1>
506
+ <ul>
507
+ <%= toc %>
508
+
509
+ <% if references %>
510
+ <li><a href="#References">References</a></li>
511
+ <% end %>
512
+ </ul>
513
+ </div>
514
+ <% end %>
435
515
 
436
- %{<h1>#{type.capitalize}s</h1> <ol>#{nested}</ol>}
437
- end
516
+ <% unless lof.empty? %>
517
+ <div id="lof"><%= lof %></div>
518
+ <% end %>
438
519
 
439
- unless lof.empty?
440
- %><div id="lof"><%= lof %></div><%
441
- end
442
- %>
520
+ <br style="display: none"/>
521
+ <hr style="display: none"/>
522
+ <br style="display: none"/>
443
523
 
444
524
  <div id="content"><%= @content %></div>
445
525
 
446
- <% unless (refs = @types['reference']).empty? %>
447
- <div id="references">
448
- <h1 class="title">References</h1>
526
+ <% if references %>
527
+ <div id="References">
528
+ <h1 class="title"><a class="here" href="#References">References</a></h1>
449
529
  <ol>
450
- <% refs.each do |n| %>
530
+ <% references.each do |n| %>
451
531
  <li id="<%= n.url %>"><%= n.content.to_s.to_html %></li>
452
532
  <% end %>
453
533
  </ol>
@@ -467,8 +547,14 @@ output: |
467
547
  Generated on <%= Time.now %> by <a href="<%= Gerbil[:website] %>"><%= Gerbil[:name] %></a> <%= Gerbil[:version] %>.
468
548
  <% end %>
469
549
 
470
- <% if defined? $icons_used and $icons_used and not $icons_used.empty? %>
471
- <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>
550
+ <% if icons_used %>
551
+ <div id="footer-credits">
552
+ <% icons_used.uniq.each do |icon| %>
553
+ <span class="<%= icon.css_class %>" style="float: right">&nbsp;</span>
554
+ <% end %>
555
+
556
+ <p>The admonition graphics 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>
557
+ </div>
472
558
  <% end %>
473
559
  <%= node = @types['footer_inside_below'].first and node.output %>
474
560
  </div>
@@ -494,6 +580,70 @@ styles:
494
580
  font-family : Cambria, Georgia, serif;
495
581
  }
496
582
 
583
+ blockquote
584
+ {
585
+ margin : 1em;
586
+ border : 5px dotted #ddd;
587
+ padding : 1em;
588
+ }
589
+
590
+ hr
591
+ {
592
+ height : 0;
593
+ border : 0;
594
+ border-top : 2px solid #FF0000;
595
+ }
596
+
597
+ /* source code */
598
+
599
+ tt,
600
+ code,
601
+ pre
602
+ {
603
+ font-family : Consolas, "Lucida Console", monospace;
604
+ }
605
+
606
+ tt
607
+ {
608
+ font-weight : bold;
609
+ color : #A52A2A;
610
+ background-color : #FFFAF0;
611
+ }
612
+
613
+ /* output of the syntax coloring library */
614
+ .code
615
+ {
616
+ background-color : #FFFFF0;
617
+ }
618
+
619
+ pre
620
+ {
621
+ cursor : text;
622
+ line-height : normal;
623
+ border : 1px dashed #C0C0C0;
624
+ background-color : #F5FFDF;
625
+ padding : 1em;
626
+ overflow : auto;
627
+ }
628
+
629
+ /* hyperlinks */
630
+
631
+ a > img
632
+ {
633
+ border : none;
634
+ }
635
+
636
+ a img
637
+ {
638
+ _border : none; /* for IE6 */
639
+ }
640
+
641
+ a.here:link,
642
+ a.here:visited
643
+ {
644
+ color : #000000;
645
+ }
646
+
497
647
  /* lists */
498
648
 
499
649
  #content li:first-child
@@ -575,7 +725,7 @@ styles:
575
725
 
576
726
  table
577
727
  {
578
- border : none;
728
+ border-collapse : collapse; /* no spacing between cell borders */
579
729
  margin : auto; /* center horizontally */
580
730
  margin-top : 1em;
581
731
  }
@@ -584,7 +734,7 @@ styles:
584
734
  td
585
735
  {
586
736
  padding : 1em;
587
- border : 1px solid #C0C0C0;
737
+ border : 1px solid #bbb;
588
738
  vertical-align : top;
589
739
  background-color : inherit;
590
740
  }
@@ -596,6 +746,14 @@ styles:
596
746
 
597
747
  /* document structure */
598
748
 
749
+ .nav
750
+ {
751
+ text-align : center;
752
+ border-bottom : thick dotted #DCDCDC;
753
+ padding-bottom : 1em;
754
+ margin-bottom : 4em;
755
+ }
756
+
599
757
  #header
600
758
  {
601
759
  text-align : center;
@@ -627,34 +785,34 @@ styles:
627
785
  margin-top : 4em;
628
786
  }
629
787
 
630
- #abstract
788
+ #Abstract
631
789
  {
632
790
  margin-bottom : 5em;
633
791
  }
634
792
 
635
- #toc li
793
+ #Contents li
636
794
  {
637
795
  list-style-type : none;
638
796
  }
639
797
 
640
- #toc li ul
798
+ #Contents li ul
641
799
  {
642
800
  padding-bottom : 1em;
643
801
  border-left : thick solid #F5F5F5;
644
802
  _border-left : none; /* for IE6 */
645
803
  }
646
804
 
647
- #toc li ul:hover
805
+ #Contents li ul:hover
648
806
  {
649
807
  border-color : #DCDCDC;
650
808
  }
651
809
 
652
- #toc > ul
810
+ #Contents > ul
653
811
  {
654
812
  padding-left : 1em;
655
813
  }
656
814
 
657
- #references
815
+ #References
658
816
  {
659
817
  margin-top : 5em;
660
818
  }
@@ -666,6 +824,11 @@ styles:
666
824
  text-align : center;
667
825
  }
668
826
 
827
+ #footer-credits
828
+ {
829
+ margin-top : 2em;
830
+ }
831
+
669
832
  /* document nodes */
670
833
 
671
834
  .part > .title,
@@ -780,112 +943,35 @@ styles:
780
943
  screen: |
781
944
  body
782
945
  {
783
- margin : auto;
784
- padding : 0.5em;
785
- max-width : 36em;
946
+ margin : auto;
947
+ padding : 0.5em;
948
+ max-width : 36em;
786
949
  }
787
950
 
788
- /* emphasis */
789
-
790
- blockquote
791
- {
792
- margin : 1em;
793
- border : 5px dotted #C0C0C0;
794
- padding : 1em;
795
- color : #444;
796
- }
797
-
798
- hr
799
- {
800
- height : 0;
801
- border : 0;
802
- border-top : 2px solid #FF0000;
803
- }
804
-
805
- /* source code */
806
-
807
- tt,
808
- code,
809
- pre
810
- {
811
- font-family : Consolas, "Lucida Console", monospace;
812
- }
813
-
814
- tt
815
- {
816
- font-weight : bold;
817
- color : #A52A2A;
818
- background-color : #FFFAF0;
819
- }
820
-
821
- /* output of the syntax coloring library */
822
- .code
823
- {
824
- background-color : #FFFFF0;
825
- }
826
-
827
- pre
828
- {
829
- cursor : text;
830
- line-height : normal;
831
- border : 1px dashed #C0C0C0;
832
- background-color : #F5FFDF;
833
- padding : 1em;
834
- overflow : auto;
835
- }
836
-
837
- /*
838
- pre:hover
839
- {
840
- border : none;
841
- position : fixed;
842
- z-index : 1;
843
- margin : 0;
844
- top : 0;
845
- left : 0;
846
- right : 0;
847
- bottom : 0;
848
- overflow : auto;
849
- cursor : text;
850
- }
851
- */
852
-
853
951
  /* hyperlinks */
854
952
 
855
- a > img
856
- {
857
- border : none;
858
- }
859
-
860
953
  a:link
861
954
  {
862
- color : #0000FF;
863
- text-decoration : none;
955
+ color : #0000FF;
956
+ text-decoration : none;
864
957
  }
865
958
 
866
959
  a:visited
867
960
  {
868
- color : #9400D3;
869
- text-decoration : none;
961
+ color : #800080;
962
+ text-decoration : none;
870
963
  }
871
964
 
872
965
  a:hover
873
966
  {
874
- color : #FF0000;
875
- text-decoration : underline;
967
+ color : #FF0000;
968
+ text-decoration : underline;
876
969
  }
877
970
 
878
971
  a:target
879
972
  {
880
- color : #FF0000;
881
- font-weight : bold;
882
- }
883
-
884
- a.toc:link,
885
- a.toc:visited
886
- {
887
- text-decoration : none;
888
- z-index : 1;
973
+ color : #FF0000;
974
+ font-weight : bold;
889
975
  }
890
976
 
891
977
  print: |
@@ -893,17 +979,15 @@ styles:
893
979
 
894
980
  tt
895
981
  {
896
- color : inherit;
897
- background-color : inherit;
898
- font-weight : normal;
982
+ background-color : inherit;
983
+ font-weight : normal;
899
984
  }
900
985
 
901
986
  pre,
902
987
  .code
903
988
  {
904
- border : none;
905
- overflow : visible;
906
- background-color : inherit;
989
+ border : none;
990
+ background-color : inherit;
907
991
  }
908
992
 
909
993
  /* headings */
@@ -915,56 +999,63 @@ styles:
915
999
  h5,
916
1000
  h6
917
1001
  {
918
- font-weight : normal;
1002
+ font-weight : normal;
919
1003
  }
920
1004
 
921
1005
  /* hyperlinks */
922
1006
 
1007
+ /* blend all hyperlinks with normal text */
923
1008
  a:link,
924
- a:visited,
925
- a:active
1009
+ a:visited
926
1010
  {
927
- color : #0000FF;
928
- font-weight : bold;
929
- text-decoration : underline;
1011
+ color : #000000;
1012
+ text-decoration : none;
930
1013
  }
931
1014
 
932
- a:after
1015
+ /* emphasize external and cross-reference hyperlinks */
1016
+ a:not([href^="#"]):link,
1017
+ a:not([href^="#"]):visited,
1018
+ a.xref[title]:link,
1019
+ a.xref[title]:visited
933
1020
  {
934
- content : " " attr(href);
935
- font-family : Consolas, "Lucida Console", monospace;
936
- font-weight : normal;
937
- font-size : 90%;
1021
+ color : #0000FF;
1022
+ text-decoration : underline;
1023
+ font-weight : bolder;
938
1024
  }
939
1025
 
940
- a[href^="#"]:after
1026
+ /* show URL of destination for external hyperlinks */
1027
+ a:not([href^="#"]):after
941
1028
  {
942
- content : "";
1029
+ content : " " attr(href);
1030
+ font-family : Consolas, "Lucida Console", monospace;
943
1031
  }
944
1032
 
945
- a[href^="#"]
1033
+ /* show name of destination for cross-references */
1034
+ a.xref[title]:after
946
1035
  {
947
- color : #A52A2A;
948
- font-weight : lighter;
949
- text-decoration : none;
950
- font-style : italic;
1036
+ content : " " attr(title);
951
1037
  }
952
1038
 
953
- a.toc:link,
954
- a.toc:visited
1039
+ a:after
955
1040
  {
956
- color : inherit;
957
- .color : #000000; /* for IE6 and IE7 */
958
- font-weight : inherit;
959
- text-decoration : none;
960
- font-style : normal;
1041
+ font-weight : normal;
1042
+ font-size : smaller;
961
1043
  }
962
1044
 
963
1045
  /* document structure */
964
1046
 
1047
+ .nav,
965
1048
  #lof
966
1049
  {
967
- display : none;
1050
+ display : none;
1051
+ }
1052
+
1053
+ #Contents,
1054
+ .part,
1055
+ .chapter,
1056
+ #References
1057
+ {
1058
+ page-break-before : always;
968
1059
  }
969
1060
 
970
1061
  /* document nodes */
@@ -972,13 +1063,12 @@ styles:
972
1063
  .part > .title > big,
973
1064
  .chapter > .title > big
974
1065
  {
975
- padding-bottom : 0.5em;
1066
+ padding-bottom : 0.5em;
976
1067
  }
977
1068
 
978
1069
  .part .title big,
979
1070
  .chapter .title big
980
1071
  {
981
- _padding-bottom : 0.5em; /* for IE6 */
1072
+ _padding-bottom : 0.5em; /* for IE6 */
982
1073
  }
983
1074
 
984
-