erbook 7.0.0 → 7.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CREDITS +3 -0
- data/bin/erbook +2 -2
- data/doc/HelloWorld.input +1 -1
- data/doc/api/classes/ERBook/Document.html +153 -150
- data/doc/api/classes/ERBook/Document/Node.html +7 -7
- data/doc/api/classes/ERBook/Template.html +24 -24
- data/doc/api/classes/ERBook/Template/Sandbox.html +6 -6
- data/doc/api/classes/RDoc/AnyMethod.html +32 -28
- data/doc/api/classes/RDoc/TopLevel.html +47 -47
- data/doc/api/classes/String.html +14 -14
- data/doc/api/created.rid +1 -1
- data/doc/api/files/CREDITS.html +68 -0
- data/doc/api/files/lib/erbook/document_rb.html +1 -3
- data/doc/api/files/lib/erbook/rdoc_rb.html +1 -1
- data/doc/api/files/lib/erbook/template_rb.html +1 -1
- data/doc/api/files/lib/erbook/to_xhtml_rb.html +3 -3
- data/doc/api/files/lib/erbook_rb.html +3 -1
- data/doc/api/panel/search_index.js +1 -1
- data/doc/api/panel/tree.js +1 -1
- data/doc/formats.erb +129 -8
- data/doc/history.erb +136 -2
- data/doc/index.erb +2 -2
- data/doc/index.xhtml +1867 -610
- data/doc/intro.erb +29 -13
- data/doc/setup.erb +9 -2
- data/doc/theory.erb +24 -3
- data/doc/usage.erb +11 -2
- data/fmt/xhtml.yaml +913 -707
- data/fmt/{xhtml.icons → xhtml/icons}/index.yaml +2 -2
- data/fmt/{xhtml.icons → xhtml/icons}/mediawiki-1.13.2/COPYING +0 -0
- data/fmt/{xhtml.icons → xhtml/icons}/mediawiki-1.13.2/README +0 -0
- data/fmt/{xhtml.icons → xhtml/icons}/mediawiki-1.13.2/skins/simple/external.png +0 -0
- data/fmt/{xhtml.icons → xhtml/icons}/rakefile +4 -6
- data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/16x16/places/start-here.png +0 -0
- data/fmt/xhtml/icons/tango-icon-theme-0.8.90/32x32/actions/go-next.png +0 -0
- data/fmt/xhtml/icons/tango-icon-theme-0.8.90/32x32/actions/go-previous.png +0 -0
- data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/32x32/places/start-here.png +0 -0
- data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/32x32/status/software-update-available.png +0 -0
- data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/48x48/apps/accessories-text-editor.png +0 -0
- data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/48x48/apps/internet-group-chat.png +0 -0
- data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/48x48/emblems/emblem-important.png +0 -0
- data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/48x48/status/dialog-error.png +0 -0
- data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/48x48/status/dialog-information.png +0 -0
- data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/48x48/status/dialog-warning.png +0 -0
- data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/COPYING +0 -0
- data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/README +0 -0
- data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/actions/bookmark-new.svg +0 -0
- data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/actions/go-home.svg +0 -0
- data/fmt/xhtml/icons/tango-icon-theme-0.8.90/scalable/actions/go-next.svg +191 -0
- data/fmt/xhtml/icons/tango-icon-theme-0.8.90/scalable/actions/go-previous.svg +852 -0
- data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/actions/view-refresh.svg +0 -0
- data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/apps/accessories-text-editor.svg +0 -0
- data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/apps/internet-group-chat.svg +0 -0
- data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/emblems/emblem-favorite.svg +0 -0
- data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/emblems/emblem-important.svg +0 -0
- data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/mimetypes/application-certificate.svg +0 -0
- data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/places/start-here.svg +0 -0
- data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/status/dialog-error.svg +0 -0
- data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/status/dialog-information.svg +0 -0
- data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/status/dialog-warning.svg +0 -0
- data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/status/software-update-available.svg +0 -0
- data/fmt/xhtml/jquery/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/fmt/xhtml/jquery/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/fmt/xhtml/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/fmt/xhtml/jquery/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/fmt/xhtml/jquery/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/fmt/xhtml/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/fmt/xhtml/jquery/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/fmt/xhtml/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/fmt/xhtml/jquery/images/ui-icons_222222_256x240.png +0 -0
- data/fmt/xhtml/jquery/images/ui-icons_2e83ff_256x240.png +0 -0
- data/fmt/xhtml/jquery/images/ui-icons_454545_256x240.png +0 -0
- data/fmt/xhtml/jquery/images/ui-icons_888888_256x240.png +0 -0
- data/fmt/xhtml/jquery/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/fmt/{xhtml.scripts → xhtml/jquery}/jquery-1.3.2.min.js +0 -0
- data/fmt/xhtml/jquery/jquery-ui-1.7.2.custom.css +406 -0
- data/fmt/xhtml/jquery/jquery-ui-1.7.2.custom.min.js +43 -0
- data/lang/de.yaml +13 -2
- data/lang/el.yaml +13 -2
- data/lang/es.yaml +13 -2
- data/lang/fr.yaml +13 -2
- data/lang/it.yaml +13 -2
- data/lang/ja.yaml +13 -2
- data/lang/ko.yaml +13 -2
- data/lang/nl.yaml +13 -2
- data/lang/phrases.yaml +15 -4
- data/lang/pt.yaml +13 -2
- data/lang/ru.yaml +13 -2
- data/lang/zh.yaml +13 -2
- data/lang/zt.yaml +13 -2
- data/lib/erbook.rb +10 -8
- data/lib/erbook/document.rb +144 -139
- data/lib/erbook/rdoc.rb +29 -7
- data/lib/erbook/template.rb +2 -2
- data/lib/erbook/to_xhtml.rb +6 -2
- metadata +78 -45
- data/doc/api/files/ANN_eml.html +0 -276
- data/doc/api/files/ANN_html.html +0 -407
- data/doc/api/files/ANN_txt.html +0 -271
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/32x32/actions/go-down.png +0 -0
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/32x32/actions/go-up.png +0 -0
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/actions/go-down.svg +0 -200
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/actions/go-up.svg +0 -196
- data/fmt/xhtml.scripts/jquery.localscroll-1.2.7-min.js +0 -9
- data/fmt/xhtml.scripts/jquery.scrollTo-1.4.1-min.js +0 -11
data/doc/intro.erb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
%#--
|
2
|
-
%# Copyright
|
3
|
-
%# See
|
2
|
+
%# Copyright protects this work.
|
3
|
+
%# See LICENSE file for details.
|
4
4
|
%#++
|
5
5
|
|
6
6
|
% eruby_url = "http://en.wikipedia.org/wiki/ERuby"
|
@@ -8,18 +8,25 @@
|
|
8
8
|
% repo_url = 'http://github.com/sunaku/' + $program
|
9
9
|
% repo_scm = '[Git](http://git-scm.com)'
|
10
10
|
|
11
|
+
|
11
12
|
%|chapter "Introduction"
|
13
|
+
|
14
|
+
|
12
15
|
%|project
|
13
|
-
|
16
|
+
|
17
|
+
<%= $project %> is an extensible document processor that emits <%= xref "HelloWorld", "any document you can imagine" %> from [eRuby templates](<%= eruby_url %>) which allow scripting and dynamic content generation.
|
14
18
|
|
15
19
|
A working <%= xref "xhtml", "XHTML (web page)" %> format is provided, while <%= xref "latex", "LaTeX (PDF)" %>, <%= xref "man", "UNIX manual page" %>, and <%= xref "text", "plain text" %> formats are planned... <%= xref "License", "patches are welcome" %>!
|
16
20
|
|
21
|
+
|
22
|
+
%|section "Features"
|
23
|
+
|
17
24
|
<%= $project %> is exciting because:
|
18
25
|
* Its documents are scriptable [eRuby templates](<%= eruby_url %>).
|
19
26
|
* It lets you <%= xref "HelloWorld", "define your own document formats" %>.
|
20
|
-
* Its core contains less than
|
27
|
+
* Its core contains less than 400 lines of code.
|
21
28
|
|
22
|
-
These features distinguish <%= $project %> from the competition,
|
29
|
+
These features distinguish <%= $project %> from the competition, who offer neither scriptable documents nor definable document formats:
|
23
30
|
* [DocBook](http://www.docbook.org)
|
24
31
|
* [Deplate](http://deplate.sourceforge.net)
|
25
32
|
* [SiSU](http://www.jus.uio.no/sisu/SiSU/)
|
@@ -27,16 +34,20 @@
|
|
27
34
|
* [txt2tags](http://txt2tags.sourceforge.net)
|
28
35
|
* [Grutatxt](http://www.triptico.com/software/grutatxt.html)
|
29
36
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
37
|
+
|
38
|
+
%|section "Logistics"
|
39
|
+
|
40
|
+
* <%= xref "History", "What's new?" %> --- history of project releases.
|
41
|
+
* [Source code](<%= repo_url %>) --- obtain via <%= repo_scm %> or browse online.
|
42
|
+
* [API reference](<%= api_url %>) --- documentation for source code.
|
43
|
+
* [Project home](<%= $website %>) --- the <%= $project %> project home page.
|
35
44
|
|
36
45
|
To get help or provide feedback, simply
|
37
46
|
<%= xref "License", "contact the authors" %>.
|
38
47
|
|
48
|
+
|
39
49
|
%|paragraph "Version numbers"
|
50
|
+
|
40
51
|
<%= $project %> releases are numbered in *major.minor.patch*
|
41
52
|
form according to the [RubyGems rational versioning
|
42
53
|
policy](http://www.rubygems.org/read/chapter/7), which
|
@@ -76,22 +87,27 @@
|
|
76
87
|
</tbody>
|
77
88
|
</table>
|
78
89
|
|
90
|
+
|
79
91
|
%|section "License"
|
92
|
+
|
80
93
|
%< "../LICENSE"
|
81
94
|
|
95
|
+
|
82
96
|
%|section "Credits" |n|
|
97
|
+
|
83
98
|
%= $logo = n.xref_link("![#{$project} logo](#{$program}.png)".to_inline_xhtml)
|
99
|
+
|
84
100
|
%< "README"
|
85
101
|
|
86
102
|
<%= $project %> is made possible by
|
87
103
|
<%= xref "History", "contributions" %>
|
88
104
|
from users like you:
|
89
105
|
|
90
|
-
|
91
|
-
|
92
|
-
* [Zhang Chiyuan](http://lifegoo.pluskid.org)
|
106
|
+
%< "../CREDITS"
|
107
|
+
|
93
108
|
|
94
109
|
%|section "Reviews"
|
110
|
+
|
95
111
|
Tom Cloyd in [ruby-talk](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/327499):
|
96
112
|
|
97
113
|
> This documentation is simply gorgeous!
|
data/doc/setup.erb
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
%#--
|
2
|
-
%# Copyright
|
3
|
-
%# See
|
2
|
+
%# Copyright protects this work.
|
3
|
+
%# See LICENSE file for details.
|
4
4
|
%#++
|
5
5
|
|
6
6
|
%|chapter "Setup"
|
7
|
+
|
8
|
+
|
7
9
|
%|section "Requirements"
|
10
|
+
|
8
11
|
Your system needs the following software to run <%= $project %>.
|
9
12
|
|
10
13
|
| Software | Description | Notes |
|
@@ -12,7 +15,9 @@
|
|
12
15
|
| [Ruby](http://ruby-lang.org) | Ruby language interpreter | Version 1.8.7 or newer is required. |
|
13
16
|
| [RubyGems](http://rubygems.org) | Ruby packaging system | Version 1.0.0 or newer is required. |
|
14
17
|
|
18
|
+
|
15
19
|
%|section "Installation"
|
20
|
+
|
16
21
|
You can install <%= $project %> by running this command:
|
17
22
|
|
18
23
|
gem install <%= $program %>
|
@@ -27,7 +32,9 @@
|
|
27
32
|
|
28
33
|
Otherwise, you can <%= xref "License", "contact the author" %> for help.
|
29
34
|
|
35
|
+
|
30
36
|
%|section "Manifest"
|
37
|
+
|
31
38
|
You will see the following items inside <%= $project %>'s installation directory, whose path you can determine by running this command:
|
32
39
|
|
33
40
|
<%= $program %> -v
|
data/doc/theory.erb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
%#--
|
2
|
-
%# Copyright
|
3
|
-
%# See
|
2
|
+
%# Copyright protects this work.
|
3
|
+
%# See LICENSE file for details.
|
4
4
|
%#++
|
5
5
|
|
6
|
-
%|chapter "Theory
|
6
|
+
%|chapter "Theory"
|
7
|
+
|
7
8
|
When you run <%= $project %>, it does the following:
|
8
9
|
|
9
10
|
1. Loads the <%= xref "SpecFile", "format specification file" %>.
|
@@ -24,7 +25,9 @@
|
|
24
25
|
|
25
26
|
Although there is only one document being processed here, we refer to it using three distinct terms: *input*, *processed*, and *output*; because the content of the document changes radically with every transformation.
|
26
27
|
|
28
|
+
|
27
29
|
%|section "Nodes"
|
30
|
+
|
28
31
|
A node is a block of text that appears like this:
|
29
32
|
|
30
33
|
<%% node_type node_argument1, node_argument2, ... do |node_object| %>
|
@@ -68,7 +71,9 @@
|
|
68
71
|
|
69
72
|
A <%= xref "SpecFile", "format specification file" %> defines what types of nodes an input document may use.
|
70
73
|
|
74
|
+
|
71
75
|
%|section "The `ERBook::Document::Node` class", "Node.class"
|
76
|
+
|
72
77
|
When <%= $project %> builds a document tree from the nodes in an input document, it stores information about these nodes into `ERBook::Document::Node` objects. A `ERBook::Document::Node` object has the following properties (methods):
|
73
78
|
|
74
79
|
| Property | Type | Description |
|
@@ -87,7 +92,9 @@
|
|
87
92
|
|
88
93
|
Furthermore, the `ERBook::Document::Node` class is derived from [Ruby's `OpenStruct` class](http://www.ruby-doc.org/stdlib/libdoc/ostruct/rdoc/classes/OpenStruct.html), so you can define new properties for `ERBook::Document::Node` objects dynamically.
|
89
94
|
|
95
|
+
|
90
96
|
%|section "Format specification file", "SpecFile"
|
97
|
+
|
91
98
|
A format specification file is a plain-text file marked up in [YAML syntax](http://yaml4r.sourceforge.net/cookbook/). Through the following parameters, it defines (1) what types of nodes an input document may contain, (2) how the content of those nodes is transformed into output, and (3) how the processed document is transformed into the output document.
|
92
99
|
|
93
100
|
| Parameter | Type | Description |
|
@@ -104,7 +111,9 @@
|
|
104
111
|
common_template_vars = nil
|
105
112
|
%>
|
106
113
|
|
114
|
+
|
107
115
|
%|section "Node definition", "SpecFile.nodes"
|
116
|
+
|
108
117
|
A node definition is a mapping from a name (the "node type") to the following set of parameters:
|
109
118
|
|
110
119
|
| Parameter | Type | Description |
|
@@ -118,7 +127,9 @@
|
|
118
127
|
|
119
128
|
You may define additional parameters in a node definition if you want.
|
120
129
|
|
130
|
+
|
121
131
|
%|section "Node output template", "SpecFile.nodes.output"
|
132
|
+
|
122
133
|
A node output template (the **output** parameter in a node definition) is an eRuby template that transforms a node's content into output. During the processing stage, <%= $project %> replaces all nodes in the input document with the result of this template _unless_ the **silent** parameter is enabled in this node's definition.
|
123
134
|
|
124
135
|
The following variables are available for use in this template:
|
@@ -141,7 +152,9 @@
|
|
141
152
|
}.lstrip.gsub(/^ +/, '')
|
142
153
|
%>
|
143
154
|
|
155
|
+
|
144
156
|
%|section "Document output template", "SpecFile.output"
|
157
|
+
|
145
158
|
A document output template (the **output** parameter in a format specification file) is an eRuby template that transforms a processed document into the final output document.
|
146
159
|
|
147
160
|
The following variables are available for use in this template:
|
@@ -151,7 +164,9 @@
|
|
151
164
|
| `@content` | `String` | Content of the processed document. |
|
152
165
|
<%= common_template_vars %>
|
153
166
|
|
167
|
+
|
154
168
|
%|section "Creating your own document format", "HelloWorld"
|
169
|
+
|
155
170
|
Here is a working example to help you digest all that you've learned so far about format specification files. A few things to notice in this example are:
|
156
171
|
|
157
172
|
* We define a `generate_name()` method in <%= xref "HelloWorld.spec" %> and make use of it in the <%= xref "HelloWorld.input" %>. This shows how to provide format-specific functionality to an input document.
|
@@ -170,11 +185,17 @@
|
|
170
185
|
|
171
186
|
4. Examine the <tt>HelloWorld.output</tt> file to your satisfaction!
|
172
187
|
|
188
|
+
|
173
189
|
%|example "HelloWorld format specification file", "HelloWorld.spec"
|
190
|
+
|
174
191
|
<code lang="rhtml"><%= verbatim File.read('doc/HelloWorld.spec') %></code>
|
175
192
|
|
193
|
+
|
176
194
|
%|example "Input document for HelloWorld format", "HelloWorld.input"
|
195
|
+
|
177
196
|
<code lang="rhtml"><%= verbatim File.read('doc/HelloWorld.input') %></code>
|
178
197
|
|
198
|
+
|
179
199
|
%|example "Output of HelloWorld format", "HelloWorld.output"
|
200
|
+
|
180
201
|
%= `ruby bin/#{PROGRAM} -u doc/HelloWorld.spec doc/HelloWorld.input`
|
data/doc/usage.erb
CHANGED
@@ -1,29 +1,38 @@
|
|
1
1
|
%#--
|
2
|
-
%# Copyright
|
3
|
-
%# See
|
2
|
+
%# Copyright protects this work.
|
3
|
+
%# See LICENSE file for details.
|
4
4
|
%#++
|
5
5
|
|
6
6
|
%|chapter "Usage"
|
7
|
+
|
8
|
+
|
7
9
|
%|section "Command-line interface"
|
10
|
+
|
8
11
|
<pre><%= `ruby bin/#{$program} -h` %></pre>
|
9
12
|
|
10
13
|
The first command-line argument to <%= $project %> is either the name of a predefined format (FormatName) or the path to a <%= xref "SpecFile", "format specification file" %> (FormatFile).
|
11
14
|
|
12
15
|
Predefined formats are simply short-hand names of format specification files located in the <tt>fmt/</tt> subdirectory of the <%= $project %> installation directory (see <%= xref "Manifest" %>).
|
13
16
|
|
17
|
+
|
14
18
|
%|section "Saving the output to a file"
|
19
|
+
|
15
20
|
Simply redirect the standard ouput stream (STDOUT) to a file like this:
|
16
21
|
|
17
22
|
<%= $program %> > YOUR_PATH_HERE
|
18
23
|
|
19
24
|
In the above example, *YOUR\_PATH\_HERE* is the path of the file in which the output should be saved.
|
20
25
|
|
26
|
+
|
21
27
|
%|important "Save XHTML output as <tt>.xhtml</tt>"
|
28
|
+
|
22
29
|
When you use the XHTML format, ensure that the file extension of your saved output document is either <tt>.xhtml</tt> or <tt>.xml</tt>. Alternatively, ensure that your saved output document is served to web browsers under the <tt>application/xhtml+xml</tt> mime type.
|
23
30
|
|
24
31
|
Otherwise, most web browsers _will not display_ the icons and graphics embedded in the saved XHTML output document because they will treat it as HTML instead of as XML. See [this QuirksMode.org bug report](http://www.quirksmode.org/bugreports/archives/2005/02/custom_dtds_int_1.html) for details.
|
25
32
|
|
33
|
+
|
26
34
|
%|section "Unindenting nodes hierarchically"
|
35
|
+
|
27
36
|
When writing <%= $project %> documents, I prefer to indent the content of nodes according to their depth because my [text editor of choice](http://jedit.org) automatically folds blocks of text based on indentation.
|
28
37
|
|
29
38
|
If you also prefer to write documents in this way, be sure to pass the <tt>--unindent</tt> option to <%= $project %> so that the indentation will not affect the resulting output.
|
data/fmt/xhtml.yaml
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright
|
3
|
-
# See
|
2
|
+
# Copyright protects this work.
|
3
|
+
# See LICENSE file for details.
|
4
4
|
#++
|
5
5
|
|
6
6
|
desc: web page for the Internet
|
7
7
|
|
8
8
|
code: |
|
9
|
-
ICONS_DIR
|
10
|
-
|
9
|
+
ICONS_DIR = File.join(ERBook::FORMATS_DIR, 'xhtml', 'icons')
|
10
|
+
JQUERY_DIR = File.join(ERBook::FORMATS_DIR, 'xhtml', 'jquery')
|
11
11
|
|
12
12
|
# load the String#to_xhtml and String#to_inline_xhtml methods
|
13
13
|
require 'erbook/to_xhtml'
|
@@ -33,8 +33,12 @@ code: |
|
|
33
33
|
|
34
34
|
# The remaining characters must be letters, digits, hyphens (-),
|
35
35
|
# underscores (_), colons (:), or periods (.) or Unicode characters
|
36
|
+
#
|
37
|
+
# However, colons (:) and periods (.) are special characters
|
38
|
+
# in jQuery CSS selector syntax, so we sanitize them as well.
|
39
|
+
#
|
36
40
|
buf.unpack('U*').map! do |code|
|
37
|
-
if code > 0xFF or code.chr =~ /[[:alnum:]\-_
|
41
|
+
if code > 0xFF or code.chr =~ /[[:alnum:]\-_]/
|
38
42
|
code
|
39
43
|
else
|
40
44
|
32 # ASCII character code for a single space
|
@@ -62,11 +66,27 @@ code: |
|
|
62
66
|
[input].pack('m')
|
63
67
|
end
|
64
68
|
|
69
|
+
##
|
70
|
+
# Encodes the contents of the given file in base64 format.
|
71
|
+
#
|
72
|
+
def ERBook.base_64_encode_file path #:nodoc:
|
73
|
+
base_64_encode open(path, 'rb') {|f| f.read }
|
74
|
+
end
|
75
|
+
|
65
76
|
##
|
66
77
|
# Returns a string denoting embedded, base64 encoded data.
|
67
78
|
#
|
68
|
-
def ERBook.base_64_embed data,
|
69
|
-
"data:#{
|
79
|
+
def ERBook.base_64_embed data, mime #:nodoc:
|
80
|
+
"data:#{mime.to_s.downcase};base64,#{data.tr("\n", '')}"
|
81
|
+
end
|
82
|
+
|
83
|
+
def ERBook.base_64_embed_file path # :nodoc:
|
84
|
+
data = base_64_encode_file(path)
|
85
|
+
|
86
|
+
require 'mime/types'
|
87
|
+
mime = MIME::Types.of(path)
|
88
|
+
|
89
|
+
base_64_embed data, mime
|
70
90
|
end
|
71
91
|
|
72
92
|
##
|
@@ -133,7 +153,7 @@ code: |
|
|
133
153
|
origin = path[/^\w+/]
|
134
154
|
|
135
155
|
path = File.join(ICONS_DIR, path) # make the path absolute
|
136
|
-
data =
|
156
|
+
data = base_64_encode_file(path)
|
137
157
|
|
138
158
|
ICON_BY_NAME[name] = Icon.new(origin, path, name, format, data)
|
139
159
|
end
|
@@ -208,6 +228,10 @@ code: |
|
|
208
228
|
|
209
229
|
# utility methods
|
210
230
|
|
231
|
+
def type_frag #:nodoc:
|
232
|
+
"__#{type}__"
|
233
|
+
end
|
234
|
+
|
211
235
|
def type_label #:nodoc:
|
212
236
|
ERBook::PHRASES[type.to_s.capitalize]
|
213
237
|
end
|
@@ -272,7 +296,7 @@ code: |
|
|
272
296
|
end
|
273
297
|
|
274
298
|
##
|
275
|
-
# Returns a navigation menu
|
299
|
+
# Returns a navigation menu for this node.
|
276
300
|
#
|
277
301
|
def navigation
|
278
302
|
self.class.navigation(
|
@@ -283,14 +307,40 @@ code: |
|
|
283
307
|
)
|
284
308
|
end
|
285
309
|
|
310
|
+
def parent_tabs_begin #:nodoc:
|
311
|
+
if p = parent and pc = p.toc_children and self == pc.first
|
312
|
+
%{<div class="tabs"><ul>} +
|
313
|
+
|
314
|
+
pc.map do |c|
|
315
|
+
%{<li><a href="##{c.here_frag}">#{c.title.to_s.to_inline_xhtml}</a></li>}
|
316
|
+
end.join +
|
317
|
+
|
318
|
+
%{</ul>}
|
319
|
+
end
|
320
|
+
end
|
321
|
+
|
322
|
+
def parent_tabs_end #:nodoc:
|
323
|
+
if p = parent and self == p.toc_children.last
|
324
|
+
'</div>'
|
325
|
+
end
|
326
|
+
end
|
327
|
+
|
328
|
+
##
|
329
|
+
# Returns all children of this node which are
|
330
|
+
# configured to appear in the table of contents.
|
331
|
+
#
|
332
|
+
def toc_children
|
333
|
+
children.select {|c| c.defn['toc'] }
|
334
|
+
end
|
335
|
+
|
286
336
|
HERE_TEXT = ERBook::PHRASES['Focus this segment']
|
287
337
|
PREV_TEXT = ERBook::PHRASES['Focus previous segment']
|
288
338
|
NEXT_TEXT = ERBook::PHRASES['Focus next segment']
|
289
339
|
LIST_TEXT = ERBook::PHRASES['Return to listing']
|
290
340
|
|
291
341
|
HERE_SIGN = ICON_BY_NAME['nav_here'].to_xhtml(:alt => '∗')
|
292
|
-
PREV_SIGN = ICON_BY_NAME['nav_prev'].to_xhtml(:alt => '&
|
293
|
-
NEXT_SIGN = ICON_BY_NAME['nav_next'].to_xhtml(:alt => '&
|
342
|
+
PREV_SIGN = ICON_BY_NAME['nav_prev'].to_xhtml(:alt => '←')
|
343
|
+
NEXT_SIGN = ICON_BY_NAME['nav_next'].to_xhtml(:alt => '→')
|
294
344
|
LIST_SIGN = ICON_BY_NAME['nav_list'].to_xhtml(:alt => '≡')
|
295
345
|
|
296
346
|
##
|
@@ -303,7 +353,7 @@ code: |
|
|
303
353
|
next_link = %{<a title="#{NEXT_TEXT}" href="##{next_frag}">#{NEXT_SIGN}</a>} if next_frag
|
304
354
|
list_link = %{<a title="#{LIST_TEXT}" href="##{list_frag}">#{LIST_SIGN}</a>} if list_frag
|
305
355
|
|
306
|
-
%{<a name="#{here_frag}"/><div class="nav"
|
356
|
+
%{<a name="#{here_frag}"/><div class="nav">#{here_link} #{prev_link} #{next_link} #{list_link}</div>}
|
307
357
|
end
|
308
358
|
|
309
359
|
##
|
@@ -344,7 +394,7 @@ code: |
|
|
344
394
|
|
345
395
|
# make it unique
|
346
396
|
while @@frags.include? frag
|
347
|
-
frag
|
397
|
+
frag = "#{frag} #{index || number || salt}".to_uri_fragment
|
348
398
|
end
|
349
399
|
|
350
400
|
@@frags << frag
|
@@ -359,7 +409,7 @@ code: |
|
|
359
409
|
# of contents / list of figures that points this node.
|
360
410
|
#
|
361
411
|
def list_frag #:nodoc:
|
362
|
-
@list_frag ||= "
|
412
|
+
@list_frag ||= "__toc__#{here_frag}".to_uri_fragment
|
363
413
|
end
|
364
414
|
end
|
365
415
|
end
|
@@ -397,7 +447,10 @@ nodes:
|
|
397
447
|
number: false
|
398
448
|
silent: true
|
399
449
|
inline: true
|
400
|
-
output:
|
450
|
+
output: |
|
451
|
+
<%= @node.parent_tabs_begin %>
|
452
|
+
<div class="<%= @node.type %>" id="<%= @node.here_frag %>"><%= @node.content_xhtml %></div>
|
453
|
+
<%= @node.parent_tabs_end %>
|
401
454
|
|
402
455
|
header_inside_above: *header_insert
|
403
456
|
header_inside_below: *header_insert
|
@@ -416,8 +469,9 @@ nodes:
|
|
416
469
|
index: false
|
417
470
|
number: false
|
418
471
|
silent: true
|
472
|
+
bypass: true
|
419
473
|
output: |
|
420
|
-
<div id="<%= @node.
|
474
|
+
<div id="<%= @node.type_frag %>">
|
421
475
|
<%= @node.navigation %>
|
422
476
|
<h1 class="title"><%= @node.type_label %></h1>
|
423
477
|
<%= @node.content_xhtml_div %>
|
@@ -432,7 +486,8 @@ nodes:
|
|
432
486
|
number: true
|
433
487
|
silent: false
|
434
488
|
output: |
|
435
|
-
|
489
|
+
<%= @node.parent_tabs_begin %>
|
490
|
+
<div class="<%= @node.type %>" id="<%= @node.here_frag %>">
|
436
491
|
<%= @node.navigation %>
|
437
492
|
<h1 class="title">
|
438
493
|
<%= @node.type_label %> <%= @node.index_link %>
|
@@ -441,6 +496,7 @@ nodes:
|
|
441
496
|
</h1>
|
442
497
|
<%= @node.content_xhtml_div %>
|
443
498
|
</div>
|
499
|
+
<%= @node.parent_tabs_end %>
|
444
500
|
|
445
501
|
chapter: *latex
|
446
502
|
|
@@ -453,13 +509,15 @@ nodes:
|
|
453
509
|
silent: false
|
454
510
|
output: |
|
455
511
|
<% depth = [6, @node.depth + 1].min %>
|
456
|
-
|
512
|
+
<%= @node.parent_tabs_begin %>
|
513
|
+
<div class="<%= @node.type %>" id="<%= @node.here_frag %>">
|
457
514
|
<%= @node.navigation %>
|
458
515
|
<h<%= depth %> class="title">
|
459
516
|
<%= @node.index_and_title_link %>
|
460
517
|
</h<%= depth %>>
|
461
518
|
<%= @node.content_xhtml_div %>
|
462
519
|
</div>
|
520
|
+
<%= @node.parent_tabs_end %>
|
463
521
|
|
464
522
|
paragraph:
|
465
523
|
toc: true
|
@@ -469,11 +527,13 @@ nodes:
|
|
469
527
|
number: false
|
470
528
|
silent: false
|
471
529
|
output: |
|
472
|
-
|
530
|
+
<%= @node.parent_tabs_begin %>
|
531
|
+
<div class="<%= @node.type %>" id="<%= @node.here_frag %>">
|
473
532
|
<%= @node.navigation %>
|
474
533
|
<p class="title"><%= @node.title_link %></p>
|
475
534
|
<%= @node.content_xhtml_div %>
|
476
535
|
</div>
|
536
|
+
<%= @node.parent_tabs_end %>
|
477
537
|
|
478
538
|
# Admonitions
|
479
539
|
tip: &admonition
|
@@ -484,7 +544,8 @@ nodes:
|
|
484
544
|
number: true
|
485
545
|
silent: false
|
486
546
|
output: |
|
487
|
-
|
547
|
+
<%= @node.parent_tabs_begin %>
|
548
|
+
<div class="<%= @node.type %>" id="<%= @node.here_frag %>">
|
488
549
|
<%= @node.navigation %>
|
489
550
|
<p class="title"><%= @node.number_and_title_link %></p>
|
490
551
|
<div class="content">
|
@@ -492,6 +553,7 @@ nodes:
|
|
492
553
|
<%= @node.content_xhtml %>
|
493
554
|
</div>
|
494
555
|
</div>
|
556
|
+
<%= @node.parent_tabs_end %>
|
495
557
|
|
496
558
|
note: *admonition
|
497
559
|
caution: *admonition
|
@@ -508,11 +570,13 @@ nodes:
|
|
508
570
|
number: true
|
509
571
|
silent: false
|
510
572
|
output: |
|
511
|
-
|
573
|
+
<%= @node.parent_tabs_begin %>
|
574
|
+
<div class="<%= @node.type %>" id="<%= @node.here_frag %>">
|
512
575
|
<%= @node.navigation %>
|
513
576
|
<p class="title"><%= @node.number_and_title_link %></p>
|
514
577
|
<%= @node.content_xhtml_div %>
|
515
578
|
</div>
|
579
|
+
<%= @node.parent_tabs_end %>
|
516
580
|
|
517
581
|
table: *formal
|
518
582
|
example: *formal
|
@@ -551,6 +615,7 @@ nodes:
|
|
551
615
|
index: false
|
552
616
|
number: true
|
553
617
|
silent: true
|
618
|
+
bypass: true
|
554
619
|
|
555
620
|
cite:
|
556
621
|
toc: false
|
@@ -620,7 +685,7 @@ output: |
|
|
620
685
|
end
|
621
686
|
end
|
622
687
|
|
623
|
-
|
688
|
+
lof_sections_frag_and_label = []
|
624
689
|
|
625
690
|
lof = lof_enums.sort.map do |type, nodes|
|
626
691
|
nested = nodes.map do |n|
|
@@ -628,9 +693,10 @@ output: |
|
|
628
693
|
end
|
629
694
|
|
630
695
|
label = ERBook::PHRASES[type.capitalize << 's']
|
631
|
-
|
696
|
+
frag = nodes.first.type_frag
|
697
|
+
lof_sections_frag_and_label << [frag, label]
|
632
698
|
|
633
|
-
%{
|
699
|
+
%{<div id="#{frag}"><h2 class="title">#{label}</h2> <ol>#{nested}</ol></div>}
|
634
700
|
end
|
635
701
|
%><?xml version="1.0" encoding="utf-8"?>
|
636
702
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
@@ -643,8 +709,12 @@ output: |
|
|
643
709
|
<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8"/>
|
644
710
|
<meta name="generator" content="<%= ERBook::DISPLAY %>"/>
|
645
711
|
|
646
|
-
% if $title
|
647
|
-
<title><%=
|
712
|
+
% if $title || $subtitle
|
713
|
+
<title><%=
|
714
|
+
[$title, $subtitle].compact.map do |t|
|
715
|
+
t.to_s.to_inline_xhtml
|
716
|
+
end.join(' — ')
|
717
|
+
%></title>
|
648
718
|
|
649
719
|
% if $authors
|
650
720
|
<meta name="author" content="<%= $authors.keys.join(', ') %>"/>
|
@@ -656,15 +726,32 @@ output: |
|
|
656
726
|
% $feeds.each_pair do |url, fmt|
|
657
727
|
<link rel="alternate" type="application/<%= fmt %>+xml" href="<%= url %>"/>
|
658
728
|
|
659
|
-
% require 'rainpress'
|
660
|
-
% @format['styles'].each do |style|
|
661
|
-
% style.each_pair do |media, code|
|
662
|
-
<style type="text/css" media="<%= media %>">
|
663
|
-
/*<![CDATA[*/<%~ Rainpress.compress(code) %>/*]]>*/
|
664
|
-
</style>
|
665
|
-
|
666
729
|
<style type="text/css" media="screen">
|
667
730
|
/*<![CDATA[*/
|
731
|
+
<%=
|
732
|
+
css = File.read(File.join(JQUERY_DIR, 'jquery-ui-1.7.2.custom.css'))
|
733
|
+
|
734
|
+
# embed images used by jQuery UI as data URIs
|
735
|
+
css.gsub! %r{\bimages/.*?\.png\b} do |path|
|
736
|
+
# XXX: using inspect to put quotes around the value
|
737
|
+
# because jQuery did not put them in their CSS
|
738
|
+
ERBook.base_64_embed_file(File.join(JQUERY_DIR, path)).inspect
|
739
|
+
end
|
740
|
+
|
741
|
+
css
|
742
|
+
%>
|
743
|
+
|
744
|
+
.ui-widget
|
745
|
+
{
|
746
|
+
/* prevent nested widgets from having larger fonts */
|
747
|
+
font-size: 1em;
|
748
|
+
}
|
749
|
+
|
750
|
+
.ui-tabs .ui-tabs-nav li.ui-tabs-selected a
|
751
|
+
{
|
752
|
+
cursor: pointer;
|
753
|
+
}
|
754
|
+
|
668
755
|
/* decorate external hyperlinks with a visual indicator */
|
669
756
|
a[href]:not([href^="#"])
|
670
757
|
{
|
@@ -686,199 +773,467 @@ output: |
|
|
686
773
|
/*]]>*/
|
687
774
|
</style>
|
688
775
|
|
776
|
+
% require 'rainpress'
|
777
|
+
% @format['styles'].each do |style|
|
778
|
+
% style.each_pair do |media, sass|
|
779
|
+
<style type="text/css" media="<%= media %>">
|
780
|
+
/*<![CDATA[*/<%=
|
781
|
+
|
782
|
+
# expand eRuby directives in SASS templates
|
783
|
+
sass = ::Ember::Template.new(sass).render(binding)
|
784
|
+
|
785
|
+
# compile SASS into CSS
|
786
|
+
require 'sass'
|
787
|
+
css = ::Sass::Engine.new(sass).render
|
788
|
+
|
789
|
+
# minify the CSS
|
790
|
+
css = Rainpress.compress(css)
|
791
|
+
|
792
|
+
%>/*]]>*/
|
793
|
+
</style>
|
794
|
+
|
689
795
|
<script type="text/javascript">
|
690
796
|
//<![CDATA[
|
691
|
-
%< File.join(
|
692
|
-
%< File.join(
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
797
|
+
%< File.join(JQUERY_DIR, 'jquery-1.3.2.min.js')
|
798
|
+
%< File.join(JQUERY_DIR, 'jquery-ui-1.7.2.custom.min.js')
|
799
|
+
|
800
|
+
$(function() {
|
801
|
+
//
|
802
|
+
// respond to changes in window location
|
803
|
+
//
|
804
|
+
var $last_hash = null;
|
805
|
+
|
806
|
+
function on_hash_change() {
|
807
|
+
var curr_hash = window.location.hash;
|
808
|
+
|
809
|
+
if (curr_hash && curr_hash != $last_hash) {
|
810
|
+
$last_hash = curr_hash;
|
811
|
+
reveal_hash(curr_hash);
|
812
|
+
}
|
813
|
+
|
814
|
+
setTimeout(on_hash_change, 300);
|
815
|
+
}
|
816
|
+
|
817
|
+
//
|
818
|
+
// Sets the location bar hash to the given value.
|
819
|
+
//
|
820
|
+
// [prevent_jump]
|
821
|
+
// If true, prevents the browser from jumping to
|
822
|
+
// the element corresponding to the given hash.
|
823
|
+
//
|
824
|
+
function set_hash(hash, prevent_jump) {
|
825
|
+
var set_the_hash = function() {
|
826
|
+
//
|
827
|
+
// XXX: bypass on_hash_change() by setting $last_hash
|
828
|
+
//
|
829
|
+
window.location.hash = $last_hash = hash;
|
830
|
+
}
|
831
|
+
|
832
|
+
if (prevent_jump) {
|
833
|
+
var target = $(hash);
|
834
|
+
|
835
|
+
if (target.length) {
|
836
|
+
//
|
837
|
+
// This particular approach to solving the browser
|
838
|
+
// jumping problem comes from the jQuery.LocalScroll
|
839
|
+
// plugin, which is dual licensed under MIT and GPL:
|
840
|
+
//
|
841
|
+
// Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
|
842
|
+
//
|
843
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
844
|
+
// of this software and associated documentation files (the "Software"), to deal
|
845
|
+
// in the Software without restriction, including without limitation the rights
|
846
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
847
|
+
// copies of the Software, and to permit persons to whom the Software is
|
848
|
+
// furnished to do so, subject to the following conditions:
|
849
|
+
//
|
850
|
+
// The above copyright notice and this permission notice shall be included in
|
851
|
+
// all copies or substantial portions of the Software.
|
852
|
+
//
|
853
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
854
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
855
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
856
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
857
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
858
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
859
|
+
// THE SOFTWARE.
|
860
|
+
//
|
861
|
+
// This plugin is documented at:
|
862
|
+
//
|
863
|
+
// http://flesler.blogspot.com/2007/10/jquerylocalscroll-10.html
|
864
|
+
//
|
865
|
+
// And its source is available at:
|
866
|
+
//
|
867
|
+
// http://flesler-plugins.googlecode.com/svn/trunk/jquery.localScroll/jquery.localScroll.js
|
868
|
+
//
|
869
|
+
var target_id = target.attr('id');
|
870
|
+
|
871
|
+
//
|
872
|
+
// temporarily place a dummy element at the current
|
873
|
+
// screen position and give it the ID of the target
|
874
|
+
//
|
875
|
+
var dummy = $('<span/>').attr('id', target_id).css({
|
876
|
+
position: 'absolute',
|
877
|
+
top: $(window).scrollTop()
|
878
|
+
});
|
879
|
+
|
880
|
+
target.removeAttr('id').before(dummy);
|
881
|
+
|
882
|
+
//
|
883
|
+
// when we set the hash, the browser will jump to the
|
884
|
+
// dummy, which is where the browser screen currently
|
885
|
+
// is, and therefore the jump will not be visualized!
|
886
|
+
//
|
887
|
+
set_the_hash();
|
888
|
+
|
889
|
+
//
|
890
|
+
// undo the temporary changes
|
891
|
+
//
|
892
|
+
dummy.remove();
|
893
|
+
target.attr('id', target_id);
|
894
|
+
|
895
|
+
return;
|
896
|
+
}
|
897
|
+
}
|
898
|
+
|
899
|
+
set_the_hash();
|
900
|
+
}
|
901
|
+
|
902
|
+
//
|
903
|
+
// Returns the tab corresponding to the
|
904
|
+
// given panel in the given tabs widget.
|
905
|
+
//
|
906
|
+
function tab_by_panel(panel, tabs_widget) {
|
907
|
+
if (!tabs_widget) {
|
908
|
+
tabs_widget = panel.parent('.ui-tabs');
|
909
|
+
}
|
910
|
+
|
911
|
+
return tabs_widget.find(
|
912
|
+
'.ui-tabs-nav > li > a[href=#'+ panel.attr('id') +']'
|
913
|
+
).parent('li');
|
914
|
+
}
|
915
|
+
|
916
|
+
//
|
917
|
+
// Reveals the element at the given hash by (1) activating all
|
918
|
+
// tabs that contain it, (2) smoothly scrolling to it, and (3)
|
919
|
+
// updating the hash in the browser's location bar accordingly.
|
920
|
+
//
|
921
|
+
function reveal_hash(hash) {
|
922
|
+
var target = $(hash);
|
923
|
+
|
924
|
+
if (target.length) {
|
925
|
+
var target_is_panel = target.is('div') &&
|
926
|
+
target.parent('.ui-tabs').length;
|
927
|
+
|
928
|
+
var target_initially_hidden = target.is(':hidden');
|
929
|
+
|
930
|
+
//
|
931
|
+
// reveal all tabs which contain the target
|
932
|
+
//
|
933
|
+
if (target_initially_hidden) {
|
934
|
+
var panels = target.parents('.ui-tabs > div:hidden').get().reverse();
|
935
|
+
|
936
|
+
if (target_is_panel) {
|
937
|
+
panels.push(target);
|
938
|
+
}
|
939
|
+
|
940
|
+
for (var i in panels) {
|
941
|
+
var panel = $(panels[i]);
|
942
|
+
var tabs_widget = panel.parent('.ui-tabs');
|
943
|
+
var selected_index = tabs_widget.tabs('option', 'selected');
|
944
|
+
|
945
|
+
//
|
946
|
+
// map the panel to its tab because tabs do not
|
947
|
+
// have to be in the same order as their panels
|
948
|
+
//
|
949
|
+
var tab = tab_by_panel(panel, tabs_widget);
|
950
|
+
var wanted_index = tab.prevAll('li').length;
|
951
|
+
|
952
|
+
if (wanted_index != selected_index) {
|
953
|
+
tabs_widget.tabs('select', wanted_index);
|
954
|
+
}
|
955
|
+
}
|
956
|
+
}
|
957
|
+
|
958
|
+
function scroll_to_target_and_set_hash() {
|
959
|
+
if (target.is(':hidden')) {
|
960
|
+
//
|
961
|
+
// wait before scrolling because the
|
962
|
+
// tabs.select() calls above may not
|
963
|
+
// have fully taken effect yet and
|
964
|
+
// so the target may still be hidden
|
965
|
+
//
|
966
|
+
setTimeout(scroll_to_target_and_set_hash, 0);
|
967
|
+
}
|
968
|
+
else {
|
969
|
+
//
|
970
|
+
// scroll to the tab bar instead of the target
|
971
|
+
// because it contains the title for the target
|
972
|
+
//
|
973
|
+
var scroll_target = target_is_panel ?
|
974
|
+
target.parent('.ui-tabs') : target;
|
975
|
+
|
976
|
+
var screen_before_scroll = $(window).scrollTop();
|
977
|
+
|
978
|
+
$('html').animate({
|
979
|
+
scrollTop: Math.floor(scroll_target.offset().top)
|
980
|
+
}, 'slow', 'swing', function() {
|
981
|
+
set_hash(hash, target_is_panel);
|
982
|
+
|
983
|
+
if (
|
984
|
+
!target_initially_hidden &&
|
985
|
+
$(window).scrollTop() == screen_before_scroll
|
986
|
+
) {
|
987
|
+
//
|
988
|
+
// nothing changed on the screen.
|
989
|
+
// the target was already visible.
|
990
|
+
// highlight it to notify the user.
|
991
|
+
//
|
992
|
+
target.effect('highlight', 'slow');
|
993
|
+
}
|
994
|
+
});
|
995
|
+
}
|
996
|
+
}
|
997
|
+
|
998
|
+
scroll_to_target_and_set_hash();
|
999
|
+
}
|
704
1000
|
}
|
705
|
-
|
1001
|
+
|
1002
|
+
//
|
1003
|
+
// create jQuery UI tabs
|
1004
|
+
//
|
1005
|
+
$('.tabs').tabs();
|
1006
|
+
|
1007
|
+
//
|
1008
|
+
// make internal hyperlinks reveal their targets when clicked
|
1009
|
+
//
|
1010
|
+
$('a[href^=#]').click(function() {
|
1011
|
+
var link = $(this);
|
1012
|
+
var hash = link.attr('href');
|
1013
|
+
|
1014
|
+
if (link.parent('li').parent('.ui-tabs-nav').length) {
|
1015
|
+
// tab clicks should not cause the screen to scroll
|
1016
|
+
set_hash(hash, true);
|
1017
|
+
}
|
1018
|
+
else {
|
1019
|
+
reveal_hash(hash);
|
1020
|
+
}
|
1021
|
+
|
1022
|
+
return false;
|
1023
|
+
});
|
1024
|
+
|
1025
|
+
//
|
1026
|
+
// checkbox for printer friendly stylesheet
|
1027
|
+
//
|
1028
|
+
$('#__header__ > .authors_and_date').append(
|
1029
|
+
$('<span/>').append(
|
1030
|
+
$('<input/>').attr('type', 'checkbox').click(function() {
|
1031
|
+
if ($(this).is(':checked')) {
|
1032
|
+
$('style[media=screen]').attr('media', 'neercs');
|
1033
|
+
$('style[media=print]').attr('media', 'screen');
|
1034
|
+
}
|
1035
|
+
else {
|
1036
|
+
$('style[media=screen]').attr('media', 'print');
|
1037
|
+
$('style[media=neercs]').attr('media', 'screen');
|
1038
|
+
}
|
1039
|
+
return true;
|
1040
|
+
})
|
1041
|
+
).append(" <%= ERBook::PHRASES['Printer friendly'] %>")
|
1042
|
+
);
|
1043
|
+
|
1044
|
+
//
|
1045
|
+
// ready for action!
|
1046
|
+
//
|
1047
|
+
$('#__loading__').append("<%= ERBook::PHRASES['Ready!'] %>").
|
1048
|
+
fadeOut('slow', function() {
|
1049
|
+
$('#__body__').show();
|
1050
|
+
on_hash_change();
|
1051
|
+
});
|
1052
|
+
});
|
706
1053
|
//]]>
|
707
1054
|
</script>
|
708
1055
|
</head>
|
709
1056
|
<body>
|
710
|
-
<div id="body">
|
711
1057
|
<%
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
ERBook::PHRASES['Contents'],
|
716
|
-
lof_sections,
|
717
|
-
(ERBook::PHRASES['References'] if references)
|
718
|
-
].flatten.compact
|
1058
|
+
text_only_browser_divider = %{
|
1059
|
+
<div style="display: none"><br/><hr/><br/></div>
|
1060
|
+
}.strip
|
719
1061
|
%>
|
720
|
-
% if nav.length > 1
|
721
|
-
<div id="nav"><%=
|
722
|
-
nav.map do |section|
|
723
|
-
%{<a id="rev:#{ section }" href="##{ section }">#{ section }</a>}
|
724
|
-
end.join(' · ')
|
725
|
-
%></div>
|
726
|
-
|
727
|
-
<br style="display: none"/>
|
728
|
-
<hr style="display: none"/>
|
729
|
-
<br style="display: none"/>
|
730
|
-
|
731
|
-
|
732
|
-
%= node = @nodes_by_type['header_outside_above'].first and node.output
|
733
|
-
|
734
|
-
<div id="header">
|
735
|
-
%= node = @nodes_by_type['header_inside_above'].first and node.output
|
736
|
-
|
737
|
-
% if header = @nodes_by_type['header'].first
|
738
|
-
<%= header.output %>
|
739
|
-
% else
|
740
|
-
% if $logo
|
741
|
-
<div class="logo"><%= $logo %></div>
|
742
|
-
|
743
|
-
% if $title
|
744
|
-
<h1 class="title"><%= $title.to_s.to_inline_xhtml %></h1>
|
745
|
-
|
746
|
-
% if $subtitle
|
747
|
-
<h2 class="subtitle"><%= $subtitle.to_s.to_inline_xhtml %></h2>
|
748
|
-
|
749
|
-
% if $authors
|
750
|
-
<h3 class="authors"><%=
|
751
|
-
$authors.map do |name, url|
|
752
|
-
if url
|
753
|
-
%{<a href="#{url}">#{name}</a>}
|
754
|
-
else
|
755
|
-
name
|
756
|
-
end
|
757
|
-
end.join(', ')
|
758
|
-
%></h3>
|
759
|
-
|
760
|
-
% if $date
|
761
|
-
<h3 class="date"><%= $date %></h3>
|
762
|
-
|
763
|
-
%= node = @nodes_by_type['header_inside_below'].first and node.output
|
764
|
-
</div>
|
765
1062
|
|
766
|
-
|
1063
|
+
<div id="__loading__">
|
1064
|
+
<%= ERBook::PHRASES['Loading...'] %> <noscript><%= ERBook::PHRASES['Failed!'] %>
|
1065
|
+
<p><%= ERBook::PHRASES['Please enable JavaScript in your Web browser.'] %></p>
|
767
1066
|
|
1067
|
+
%= text_only_browser_divider
|
1068
|
+
</noscript>
|
1069
|
+
</div>
|
768
1070
|
|
769
|
-
|
1071
|
+
<div id="__body__">
|
1072
|
+
%= node.output if node = @nodes_by_type['header_outside_above'].first
|
1073
|
+
|
1074
|
+
<div id="__header__">
|
1075
|
+
%= node.output if node = @nodes_by_type['header_inside_above'].first
|
1076
|
+
|
1077
|
+
% if header = @nodes_by_type['header'].first
|
1078
|
+
<%= header.output %>
|
1079
|
+
% else
|
1080
|
+
% if $logo
|
1081
|
+
<div class="logo"><%= $logo %></div>
|
1082
|
+
|
1083
|
+
<div class="title_and_subtitle">
|
1084
|
+
% if $title
|
1085
|
+
<h1 class="title"><%= $title.to_s.to_inline_xhtml %></h1>
|
1086
|
+
|
1087
|
+
% if $subtitle
|
1088
|
+
<h2 class="subtitle"><%= $subtitle.to_s.to_inline_xhtml %></h2>
|
1089
|
+
</div>
|
1090
|
+
|
1091
|
+
<div class="authors_and_date">
|
1092
|
+
% if $authors
|
1093
|
+
<h3 class="authors"><%=
|
1094
|
+
$authors.map do |name, url|
|
1095
|
+
if url
|
1096
|
+
%{<a href="#{url}">#{name}</a>}
|
1097
|
+
else
|
1098
|
+
name
|
1099
|
+
end
|
1100
|
+
end.join(', ')
|
1101
|
+
%></h3>
|
1102
|
+
|
1103
|
+
% if $date
|
1104
|
+
<h3 class="date"><%= $date %></h3>
|
1105
|
+
</div>
|
1106
|
+
|
1107
|
+
%= node.output if node = @nodes_by_type['header_inside_below'].first
|
1108
|
+
</div>
|
770
1109
|
|
771
|
-
|
772
|
-
<hr style="display: none"/>
|
773
|
-
<br style="display: none"/>
|
1110
|
+
%= node.output if node = @nodes_by_type['header_outside_below'].first
|
774
1111
|
|
1112
|
+
<div class="tabs">
|
1113
|
+
<ul>
|
1114
|
+
% if abstract
|
1115
|
+
<li><a href="#__abstract__"><%= ERBook::PHRASES['Abstract'] %></a></li>
|
775
1116
|
|
776
|
-
|
777
|
-
<div id="toc">
|
778
|
-
<%= ERBook::Document::Node.navigation \
|
779
|
-
'Contents', 'rev:Contents', nil, nil %>
|
780
|
-
<h1 class="title"><%= ERBook::PHRASES['Contents'] %></h1>
|
781
|
-
<ul><%= toc %></ul>
|
782
|
-
</div>
|
1117
|
+
<li><a href="#__doc__"><%= ERBook::PHRASES['Document'] %></a></li>
|
783
1118
|
|
784
|
-
|
785
|
-
|
1119
|
+
% unless toc.empty?
|
1120
|
+
<li><a href="#__toc__"><%= ERBook::PHRASES['Contents'] %></a></li>
|
786
1121
|
|
787
|
-
|
788
|
-
|
789
|
-
<br style="display: none"/>
|
1122
|
+
% if references
|
1123
|
+
<li><a href="#__bib__"><%= ERBook::PHRASES['References'] %></a></li>
|
790
1124
|
|
1125
|
+
<li><a href="#__nfo__"><%= ERBook::PHRASES['About'] %></a></li>
|
1126
|
+
</ul>
|
791
1127
|
|
792
|
-
|
1128
|
+
%= abstract.output if abstract
|
793
1129
|
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
<h1 class="title"><%= ERBook::PHRASES['References'] %></h1>
|
799
|
-
<ol>
|
800
|
-
% references.each do |n|
|
801
|
-
<li id="<%= n.here_frag %>"><%= n.content_xhtml %></li>
|
802
|
-
</ol>
|
803
|
-
</div>
|
1130
|
+
% unless toc.empty?
|
1131
|
+
<div id="__toc__">
|
1132
|
+
<h1 class="title"><%= ERBook::PHRASES['Contents'] %></h1>
|
1133
|
+
<ul><%= toc %></ul>
|
804
1134
|
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
%= node = @nodes_by_type['footer_outside_above'].first and node.output
|
811
|
-
|
812
|
-
<div id="footer">
|
813
|
-
%= node = @nodes_by_type['footer_inside_above'].first and node.output
|
814
|
-
% if footer = @nodes_by_type['footer'].first
|
815
|
-
%= footer.content.to_s.to_xhtml
|
816
|
-
% else
|
817
|
-
<%=
|
818
|
-
ERBook::PHRASES[
|
819
|
-
'Generated by %s on %s.',
|
820
|
-
%{<a href="#{ERBook::WEBSITE}">#{ERBook::DISPLAY}</a>},
|
821
|
-
Time.now
|
822
|
-
]
|
823
|
-
%>
|
824
|
-
|
825
|
-
<div id="footer-credits">
|
826
|
-
<%
|
827
|
-
icon_credits = 'The icons shown above are part of %s, which is copyright %s and is distributed under %s.'
|
828
|
-
%>
|
829
|
-
<p>
|
830
|
-
% ICONS.select {|i| i.origin == 'tango' }.each do |icon|
|
831
|
-
%= icon.to_xhtml
|
1135
|
+
% unless lof.empty?
|
1136
|
+
<div id="__lof__"><%= lof %></div>
|
1137
|
+
</div>
|
832
1138
|
|
833
|
-
|
1139
|
+
<div id="__doc__" class="tabs">
|
1140
|
+
<h1 style="display: none"><%= ERBook::PHRASES['Document'] %></h1>
|
1141
|
+
<ul>
|
1142
|
+
% @roots.select {|n| n.defn['toc'] }.each do |n|
|
1143
|
+
<li><a href="#<%= n.here_frag %>"><%= n.title.to_s.to_inline_xhtml %></a></li>
|
1144
|
+
</ul>
|
834
1145
|
|
835
|
-
|
836
|
-
|
837
|
-
icon_credits,
|
1146
|
+
%= @content
|
1147
|
+
</div>
|
838
1148
|
|
839
|
-
|
1149
|
+
% if references
|
1150
|
+
<div id="__bib__">
|
1151
|
+
<h1 class="title"><%= ERBook::PHRASES['References'] %></h1>
|
1152
|
+
<ol>
|
1153
|
+
% references.each do |n|
|
1154
|
+
<li id="<%= n.here_frag %>"><%= n.content_xhtml %></li>
|
1155
|
+
</ol>
|
1156
|
+
</div>
|
840
1157
|
|
841
|
-
|
1158
|
+
%= text_only_browser_divider
|
842
1159
|
|
843
|
-
|
1160
|
+
<div id="__nfo__">
|
1161
|
+
<p><%=
|
1162
|
+
ERBook::PHRASES[
|
1163
|
+
'This document was generated by %s on %s using the following resources.',
|
1164
|
+
%{<a href="#{ERBook::WEBSITE}">#{ERBook::DISPLAY}</a>},
|
1165
|
+
%{<b>#{Time.now}</b>}
|
844
1166
|
]
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
1167
|
+
%></p>
|
1168
|
+
|
1169
|
+
<table border="1">
|
1170
|
+
<thead>
|
1171
|
+
<tr>
|
1172
|
+
<th><%= ERBook::PHRASES['Resource'] %></th>
|
1173
|
+
<th><%= ERBook::PHRASES['Origin'] %></th>
|
1174
|
+
<th><%= ERBook::PHRASES['License'] %></th>
|
1175
|
+
</tr>
|
1176
|
+
</thead>
|
1177
|
+
<tbody>
|
1178
|
+
<tr>
|
1179
|
+
<td>
|
1180
|
+
% ICONS.select {|i| i.origin == 'tango' }.each do |icon|
|
1181
|
+
%= icon.to_xhtml
|
1182
|
+
</td>
|
1183
|
+
<td>
|
1184
|
+
<a href="http://tango.freedesktop.org/Tango_Icon_Library">Tango Icon Theme</a>
|
1185
|
+
|
1186
|
+
<p>© 2005 <a href="http://tango.freedesktop.org">Tango Desktop Project</a></p>
|
1187
|
+
</td>
|
1188
|
+
<td>
|
1189
|
+
<a href="http://creativecommons.org/licenses/by-sa/2.5/">Creative Commons Attribution-ShareAlike 2.5 License Agreement</a>
|
1190
|
+
</td>
|
1191
|
+
</tr>
|
1192
|
+
|
1193
|
+
<tr>
|
1194
|
+
<td>
|
1195
|
+
% ICONS.select {|i| i.origin == 'mediawiki' }.each do |icon|
|
1196
|
+
%= icon.to_xhtml
|
1197
|
+
</td>
|
1198
|
+
<td>
|
1199
|
+
<a href="http://www.mediawiki.org/skins-1.5/monobook/external.png">MediaWiki Monobook Skin</a>
|
1200
|
+
|
1201
|
+
<p>© 2007 <a href="https://www.ohloh.net/projects/mediawiki/contributors">MediaWiki contributors</a></p>
|
1202
|
+
</td>
|
1203
|
+
<td>
|
1204
|
+
<a href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU General Public License, version 2</a>
|
1205
|
+
</td>
|
1206
|
+
</tr>
|
1207
|
+
</tbody>
|
1208
|
+
</table>
|
1209
|
+
|
1210
|
+
<p class="validations">
|
1211
|
+
<a href="http://validator.w3.org/check?uri=referer"><img
|
1212
|
+
src="http://www.w3.org/Icons/valid-xhtml10-blue"
|
1213
|
+
alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a>
|
1214
|
+
|
1215
|
+
<a href="http://jigsaw.w3.org/css-validator/check/referer?profile=css3"><img
|
1216
|
+
src="http://jigsaw.w3.org/css-validator/images/vcss-blue"
|
1217
|
+
alt="Valid CSS!" height="31" width="88" /></a>
|
1218
|
+
</p>
|
1219
|
+
</div>
|
1220
|
+
</div>
|
851
1221
|
|
852
|
-
<br/>
|
853
1222
|
|
854
|
-
|
855
|
-
ERBook::PHRASES[
|
856
|
-
icon_credits,
|
1223
|
+
%= node.output if node = @nodes_by_type['footer_outside_above'].first
|
857
1224
|
|
858
|
-
|
1225
|
+
<div id="__footer__">
|
1226
|
+
%= node.output if node = @nodes_by_type['footer_inside_above'].first
|
859
1227
|
|
860
|
-
|
1228
|
+
% if footer = @nodes_by_type['footer'].first
|
1229
|
+
%= footer.content.to_s.to_xhtml
|
861
1230
|
|
862
|
-
|
863
|
-
]
|
864
|
-
%>
|
865
|
-
</p>
|
866
|
-
|
867
|
-
<p style="margin-top: 3em">
|
868
|
-
<a href="http://validator.w3.org/check?uri=referer"><img
|
869
|
-
src="http://www.w3.org/Icons/valid-xhtml10-blue"
|
870
|
-
alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a>
|
871
|
-
|
872
|
-
<a href="http://jigsaw.w3.org/css-validator/check/referer?profile=css3"><img
|
873
|
-
src="http://jigsaw.w3.org/css-validator/images/vcss-blue"
|
874
|
-
alt="Valid CSS!" height="31" width="88" /></a>
|
875
|
-
</p>
|
1231
|
+
%= node.output if node = @nodes_by_type['footer_inside_below'].first
|
876
1232
|
</div>
|
877
|
-
%= node = @nodes_by_type['footer_inside_below'].first and node.output
|
878
|
-
</div>
|
879
1233
|
|
880
|
-
|
881
|
-
|
1234
|
+
%= node.output if node = @nodes_by_type['footer_outside_below'].first
|
1235
|
+
|
1236
|
+
</div>
|
882
1237
|
</body>
|
883
1238
|
</html>
|
884
1239
|
|
@@ -888,524 +1243,375 @@ fonts:
|
|
888
1243
|
sans-serif: Calibri, Verdana, sans-serif
|
889
1244
|
monospace: Monaco, Consolas, "Lucida Console", monospace
|
890
1245
|
|
891
|
-
styles:
|
1246
|
+
styles: # these are SASS templates
|
892
1247
|
- all: |
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
h2
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
1248
|
+
body
|
1249
|
+
color: #000000
|
1250
|
+
background-color: #FFFFFF
|
1251
|
+
line-height: 1.5em
|
1252
|
+
font-family: <%= @format['fonts']['sans-serif'] %>
|
1253
|
+
|
1254
|
+
|
1255
|
+
blockquote
|
1256
|
+
color: #333
|
1257
|
+
font-style: italic
|
1258
|
+
|
1259
|
+
|
1260
|
+
em, strong, dt
|
1261
|
+
font-family: <%= @format['fonts']['serif'] %>
|
1262
|
+
|
1263
|
+
|
1264
|
+
hr
|
1265
|
+
height: 0
|
1266
|
+
border: 0
|
1267
|
+
border-top: thin dashed #000000
|
1268
|
+
|
1269
|
+
|
1270
|
+
tt, code, pre
|
1271
|
+
font-family: <%= @format['fonts']['monospace'] %>
|
1272
|
+
// appears like "size: small" otherwise
|
1273
|
+
font-size: 100%
|
1274
|
+
|
1275
|
+
|
1276
|
+
// output of the syntax coloring library
|
1277
|
+
code.para
|
1278
|
+
white-space: pre
|
1279
|
+
|
1280
|
+
|
1281
|
+
a > img
|
1282
|
+
border: none
|
1283
|
+
|
1284
|
+
|
1285
|
+
dt
|
1286
|
+
margin-top: 1.5em
|
1287
|
+
font-weight: bolder
|
1288
|
+
|
1289
|
+
|
1290
|
+
h1, h2, h3, h4, h5, h6, .title
|
1291
|
+
font-weight: lighter
|
1292
|
+
font-family: <%= @format['fonts']['serif'] %>
|
1293
|
+
|
1294
|
+
|
1295
|
+
#__lof__
|
1296
|
+
h1, h2, h3, h4, h5, h6
|
1297
|
+
margin-top: 1.25em
|
1298
|
+
|
1299
|
+
|
1300
|
+
#__doc__
|
1301
|
+
h1, h2, h3, h4, h5, h6
|
1302
|
+
margin-top: 2.5em
|
1303
|
+
line-height: 1.25em
|
1304
|
+
|
1305
|
+
h1
|
1306
|
+
font-size: 2.0em
|
1307
|
+
|
1308
|
+
h2
|
1309
|
+
font-size: 1.8em
|
1310
|
+
|
1311
|
+
h3
|
1312
|
+
font-size: 1.6em
|
1313
|
+
|
1314
|
+
h4
|
1315
|
+
font-size: 1.4em
|
1316
|
+
|
1317
|
+
h5
|
1318
|
+
font-size: 1.2em
|
1319
|
+
|
1320
|
+
h6
|
1321
|
+
font-size: 1.0em
|
1322
|
+
|
1323
|
+
|
1324
|
+
table
|
1325
|
+
border: none
|
1326
|
+
// no spacing between cell borders
|
1327
|
+
border-collapse: collapse
|
1328
|
+
margin: auto
|
1329
|
+
margin-top: 1em
|
1330
|
+
margin-bottom: 1em
|
1331
|
+
|
1332
|
+
|
1333
|
+
th, td
|
1334
|
+
padding: 1em
|
1335
|
+
border: 1px solid #bbb
|
1336
|
+
vertical-align: top
|
1337
|
+
background-color: #FFFFFF
|
1338
|
+
|
1339
|
+
|
1340
|
+
th
|
1341
|
+
background-color: #F5F5F5
|
1342
|
+
|
1343
|
+
|
1344
|
+
#__header__ > .title
|
1345
|
+
font-size: 2.25em
|
1346
|
+
|
1347
|
+
|
1348
|
+
#__abstract__
|
1349
|
+
margin-bottom: 5em
|
1350
|
+
|
1351
|
+
|
1352
|
+
#__toc__
|
1353
|
+
ul > li
|
1354
|
+
list-style-type: none
|
1355
|
+
|
1356
|
+
li ul
|
1357
|
+
padding-bottom: 1em
|
1358
|
+
border-left: thick solid #F5F5F5
|
1359
|
+
|
1360
|
+
&:hover
|
1361
|
+
border-color: #DCDCDC
|
1362
|
+
|
1363
|
+
> ul
|
1364
|
+
padding-left: 1em
|
1365
|
+
|
1366
|
+
|
1367
|
+
#__footer__
|
1368
|
+
padding-top: 1em
|
1369
|
+
text-align: center
|
1370
|
+
margin: auto
|
1371
|
+
|
1372
|
+
|
1373
|
+
.part > .title, .chapter > .title
|
1374
|
+
padding-bottom: 0.5em
|
1375
|
+
|
1376
|
+
|
1377
|
+
.part > .title > big, .chapter > .title > big
|
1378
|
+
display: block
|
1379
|
+
margin-top: 0.25em
|
1380
|
+
|
1381
|
+
|
1382
|
+
.paragraph > .title, .tip > .title, .note > .title, .caution > .title, .warning > .title, .important > .title, .figure > .title, .table > .title, .example > .title, .equation > .title, .procedure > .title
|
1383
|
+
font-size: large
|
1384
|
+
margin-top: 2em
|
1385
|
+
|
1386
|
+
|
1387
|
+
.tip, .note, .caution, .warning, .important, .figure, .table, .example, .equation, .procedure
|
1388
|
+
margin: 3em
|
1389
|
+
|
1390
|
+
|
1391
|
+
.tip .nav, .note .nav, .caution .nav, .warning .nav, .important .nav, .figure .nav, .table .nav, .example .nav, .equation .nav, .procedure .nav
|
1392
|
+
margin-right: -3em
|
1393
|
+
|
1394
|
+
|
1395
|
+
.tip > .content, .note > .content, .caution > .content, .warning > .content, .important > .content, .figure > .content, .table > .content, .example > .content, .equation > .content, .procedure > .content
|
1396
|
+
// height of icon
|
1397
|
+
min-height: 48px
|
1398
|
+
|
1399
|
+
|
1400
|
+
.tip > .content > .icon, .note > .content > .icon, .caution > .content > .icon, .warning > .content > .icon, .important > .content > .icon
|
1401
|
+
float: left
|
1402
|
+
margin:
|
1403
|
+
top: 0
|
1404
|
+
right: 1em
|
1405
|
+
bottom: 1em
|
1406
|
+
left: 0
|
1407
|
+
|
1408
|
+
|
1409
|
+
.figure >
|
958
1410
|
.title
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
#lof h2,
|
966
|
-
#lof h3,
|
967
|
-
#lof h4,
|
968
|
-
#lof h5,
|
969
|
-
#lof h6
|
970
|
-
{
|
971
|
-
margin-top : 1.25em;
|
972
|
-
}
|
973
|
-
|
974
|
-
#content h1,
|
975
|
-
#content h2,
|
976
|
-
#content h3,
|
977
|
-
#content h4,
|
978
|
-
#content h5,
|
979
|
-
#content h6
|
980
|
-
{
|
981
|
-
margin-top : 2.5em;
|
982
|
-
line-height : 1.25em;
|
983
|
-
}
|
984
|
-
|
985
|
-
#content h1
|
986
|
-
{
|
987
|
-
font-size : 2.0em;
|
988
|
-
}
|
989
|
-
|
990
|
-
#content h2
|
991
|
-
{
|
992
|
-
font-size : 1.8em;
|
993
|
-
}
|
994
|
-
|
995
|
-
#content h3
|
996
|
-
{
|
997
|
-
font-size : 1.6em;
|
998
|
-
}
|
999
|
-
|
1000
|
-
#content h4
|
1001
|
-
{
|
1002
|
-
font-size : 1.4em;
|
1003
|
-
}
|
1004
|
-
|
1005
|
-
#content h5
|
1006
|
-
{
|
1007
|
-
font-size : 1.2em;
|
1008
|
-
}
|
1009
|
-
|
1010
|
-
#content h6
|
1011
|
-
{
|
1012
|
-
font-size : 1.0em;
|
1013
|
-
}
|
1014
|
-
|
1015
|
-
/* tables */
|
1016
|
-
table
|
1017
|
-
{
|
1018
|
-
border-collapse : collapse; /* no spacing between cell borders */
|
1019
|
-
margin : auto; /* center horizontally */
|
1020
|
-
margin-top : 1em;
|
1021
|
-
}
|
1022
|
-
|
1023
|
-
th,
|
1024
|
-
td
|
1025
|
-
{
|
1026
|
-
padding : 1em;
|
1027
|
-
border : 1px solid #bbb;
|
1028
|
-
vertical-align : top;
|
1029
|
-
background-color : #FFFFFF;
|
1030
|
-
}
|
1031
|
-
|
1032
|
-
th
|
1033
|
-
{
|
1034
|
-
background-color : #F5F5F5;
|
1035
|
-
}
|
1036
|
-
|
1037
|
-
/* document structure */
|
1038
|
-
#header
|
1039
|
-
{
|
1040
|
-
text-align : center;
|
1041
|
-
}
|
1042
|
-
|
1043
|
-
#header > .title
|
1044
|
-
{
|
1045
|
-
font-size : 2.25em;
|
1046
|
-
}
|
1047
|
-
|
1048
|
-
#header > .subtitle
|
1049
|
-
{
|
1050
|
-
}
|
1051
|
-
|
1052
|
-
#header > .authors
|
1053
|
-
{
|
1054
|
-
margin-top : 1.625em;
|
1055
|
-
margin-bottom : -0.25em;
|
1056
|
-
}
|
1057
|
-
|
1058
|
-
#header > .date
|
1059
|
-
{
|
1060
|
-
}
|
1061
|
-
|
1062
|
-
.logo,
|
1063
|
-
.header_outside_above,
|
1064
|
-
#header,
|
1065
|
-
.header_outside_below
|
1066
|
-
{
|
1067
|
-
margin-bottom : 5em;
|
1068
|
-
}
|
1069
|
-
|
1070
|
-
.footer_outside_above,
|
1071
|
-
#footer,
|
1072
|
-
.footer_outside_below
|
1073
|
-
{
|
1074
|
-
margin-top : 5em;
|
1075
|
-
}
|
1076
|
-
|
1077
|
-
#header .header_inside_above,
|
1078
|
-
#footer .footer_inside_above
|
1079
|
-
{
|
1080
|
-
margin-bottom : 4em;
|
1081
|
-
}
|
1082
|
-
|
1083
|
-
#header .header_inside_below,
|
1084
|
-
#footer .footer_inside_below
|
1085
|
-
{
|
1086
|
-
margin-top : 4em;
|
1087
|
-
}
|
1088
|
-
|
1089
|
-
#Abstract
|
1090
|
-
{
|
1091
|
-
margin-bottom : 5em;
|
1092
|
-
}
|
1093
|
-
|
1094
|
-
#toc li
|
1095
|
-
{
|
1096
|
-
list-style-type : none;
|
1097
|
-
}
|
1098
|
-
|
1099
|
-
#toc li ul
|
1100
|
-
{
|
1101
|
-
padding-bottom : 1em;
|
1102
|
-
border-left : thick solid #F5F5F5;
|
1103
|
-
}
|
1104
|
-
|
1105
|
-
#toc li ul:hover
|
1106
|
-
{
|
1107
|
-
border-color : #DCDCDC;
|
1108
|
-
}
|
1109
|
-
|
1110
|
-
#toc > ul
|
1111
|
-
{
|
1112
|
-
padding-left : 1em;
|
1113
|
-
}
|
1114
|
-
|
1115
|
-
#bib
|
1116
|
-
{
|
1117
|
-
margin-top : 5em;
|
1118
|
-
}
|
1119
|
-
|
1120
|
-
#footer
|
1121
|
-
{
|
1122
|
-
border-top : thick dotted #DCDCDC;
|
1123
|
-
padding-top : 1em;
|
1124
|
-
text-align : center;
|
1125
|
-
}
|
1126
|
-
|
1127
|
-
#footer-credits
|
1128
|
-
{
|
1129
|
-
margin-top : 2em;
|
1130
|
-
margin-bottom : 2em;
|
1131
|
-
}
|
1132
|
-
|
1133
|
-
/* document nodes */
|
1134
|
-
.part > .title,
|
1135
|
-
.chapter > .title
|
1136
|
-
{
|
1137
|
-
padding-bottom : 0.5em;
|
1138
|
-
}
|
1139
|
-
|
1140
|
-
.part > .title > big,
|
1141
|
-
.chapter > .title > big
|
1142
|
-
{
|
1143
|
-
display : block;
|
1144
|
-
margin-top : 0.25em;
|
1145
|
-
}
|
1146
|
-
|
1147
|
-
.paragraph > .title,
|
1148
|
-
.tip > .title,
|
1149
|
-
.note > .title,
|
1150
|
-
.caution > .title,
|
1151
|
-
.warning > .title,
|
1152
|
-
.important > .title,
|
1153
|
-
.figure > .title,
|
1154
|
-
.table > .title,
|
1155
|
-
.example > .title,
|
1156
|
-
.equation > .title,
|
1157
|
-
.procedure > .title
|
1158
|
-
{
|
1159
|
-
font-size : large;
|
1160
|
-
margin-top : 2em;
|
1161
|
-
}
|
1162
|
-
|
1163
|
-
.tip ,
|
1164
|
-
.note ,
|
1165
|
-
.caution ,
|
1166
|
-
.warning ,
|
1167
|
-
.important,
|
1168
|
-
.figure ,
|
1169
|
-
.table ,
|
1170
|
-
.example ,
|
1171
|
-
.equation ,
|
1172
|
-
.procedure
|
1173
|
-
{
|
1174
|
-
margin : 3em;
|
1175
|
-
}
|
1176
|
-
|
1177
|
-
.tip .nav,
|
1178
|
-
.note .nav,
|
1179
|
-
.caution .nav,
|
1180
|
-
.warning .nav,
|
1181
|
-
.important .nav,
|
1182
|
-
.figure .nav,
|
1183
|
-
.table .nav,
|
1184
|
-
.example .nav,
|
1185
|
-
.equation .nav,
|
1186
|
-
.procedure .nav
|
1187
|
-
{
|
1188
|
-
margin-right : -3em;
|
1189
|
-
}
|
1190
|
-
|
1191
|
-
.tip > .content,
|
1192
|
-
.note > .content,
|
1193
|
-
.caution > .content,
|
1194
|
-
.warning > .content,
|
1195
|
-
.important > .content,
|
1196
|
-
.figure > .content,
|
1197
|
-
.table > .content,
|
1198
|
-
.example > .content,
|
1199
|
-
.equation > .content,
|
1200
|
-
.procedure > .content
|
1201
|
-
{
|
1202
|
-
min-height : 48px; /* 48px is height of icon */
|
1203
|
-
}
|
1204
|
-
|
1205
|
-
.tip > .content > .icon,
|
1206
|
-
.note > .content > .icon,
|
1207
|
-
.caution > .content > .icon,
|
1208
|
-
.warning > .content > .icon,
|
1209
|
-
.important > .content > .icon
|
1210
|
-
{
|
1211
|
-
float : left;
|
1212
|
-
margin : 0 1em 1em 0; /* top right bottom left */
|
1213
|
-
}
|
1214
|
-
|
1215
|
-
.figure > .title
|
1216
|
-
{
|
1217
|
-
text-align : center;
|
1218
|
-
}
|
1219
|
-
|
1220
|
-
.figure > .content img
|
1221
|
-
{
|
1222
|
-
display : block;
|
1223
|
-
margin : auto;
|
1224
|
-
}
|
1411
|
+
text-align: center
|
1412
|
+
|
1413
|
+
.content img
|
1414
|
+
display: block
|
1415
|
+
margin: auto
|
1416
|
+
|
1225
1417
|
|
1226
1418
|
- screen: |
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1235
|
-
|
1236
|
-
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1242
|
-
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1246
|
-
|
1247
|
-
|
1248
|
-
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1253
|
-
|
1254
|
-
|
1255
|
-
|
1256
|
-
|
1257
|
-
|
1258
|
-
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1262
|
-
|
1263
|
-
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
1272
|
-
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1276
|
-
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1304
|
-
|
1305
|
-
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1419
|
+
body
|
1420
|
+
margin: 0
|
1421
|
+
padding: 0.5em
|
1422
|
+
background-color: #FFFFFF
|
1423
|
+
|
1424
|
+
|
1425
|
+
#__body__, #__abstract__ > .title, #__toc__ > .title, .part > .title, .chapter > .title, .section > .title, .paragraph > .title, #__bib__ > .title
|
1426
|
+
display: none
|
1427
|
+
|
1428
|
+
|
1429
|
+
.tabs
|
1430
|
+
// otherwise .nav becomes obscured by the tabs
|
1431
|
+
clear: both
|
1432
|
+
|
1433
|
+
|
1434
|
+
tt
|
1435
|
+
background-color: #F0F8FF
|
1436
|
+
|
1437
|
+
|
1438
|
+
pre
|
1439
|
+
cursor: text
|
1440
|
+
line-height: normal
|
1441
|
+
border: 1px solid #b1d827
|
1442
|
+
background-color: #F5FFDF
|
1443
|
+
padding: 1em
|
1444
|
+
|
1445
|
+
// fit container to content; no overflow!
|
1446
|
+
display: inline-block
|
1447
|
+
margin: 0
|
1448
|
+
min-width: 92.5%
|
1449
|
+
|
1450
|
+
|
1451
|
+
// output of the syntax coloring library
|
1452
|
+
code.para
|
1453
|
+
cursor: text
|
1454
|
+
line-height: normal
|
1455
|
+
border: 1px solid #b1d827
|
1456
|
+
background-color: #F5FFDF
|
1457
|
+
padding: 1em
|
1458
|
+
display: inline-block
|
1459
|
+
margin: 0
|
1460
|
+
min-width: 92.5%
|
1461
|
+
background-color: #FFFFE8
|
1462
|
+
border-color: #EEDD88
|
1463
|
+
|
1464
|
+
|
1465
|
+
pre.para
|
1466
|
+
background-color: #FFFFE8
|
1467
|
+
border-color: #EEDD88
|
1468
|
+
|
1469
|
+
|
1470
|
+
a
|
1471
|
+
text-decoration: none
|
1472
|
+
|
1473
|
+
&:hover
|
1474
|
+
text-decoration: underline
|
1475
|
+
|
1476
|
+
&:link
|
1477
|
+
// maximum saturation of RoyalBlue
|
1478
|
+
color: #0038E1
|
1479
|
+
|
1480
|
+
&:visited
|
1481
|
+
color: #800080
|
1482
|
+
|
1483
|
+
|
1484
|
+
#__toc__ a:target, #__lof__ a:target
|
1485
|
+
background: <%= ICON_BY_NAME['here_frag'].data_css %>
|
1486
|
+
background-position: center right
|
1487
|
+
background-repeat: no-repeat
|
1488
|
+
padding-right: 20px
|
1489
|
+
|
1490
|
+
|
1491
|
+
#__header__ >
|
1492
|
+
.logo
|
1493
|
+
float: left
|
1494
|
+
margin-right: 1em
|
1495
|
+
margin-top: 0.25em
|
1496
|
+
|
1497
|
+
img
|
1498
|
+
max-height: 4em
|
1499
|
+
max-width: 4em
|
1500
|
+
|
1501
|
+
.title_and_subtitle
|
1502
|
+
float: left
|
1503
|
+
margin-right: 1.5em
|
1504
|
+
|
1505
|
+
.title
|
1506
|
+
margin-top: 0.25em
|
1507
|
+
|
1508
|
+
.authors_and_date
|
1509
|
+
text-align: right
|
1510
|
+
|
1511
|
+
.authors, .date
|
1512
|
+
margin-top: 0
|
1513
|
+
margin-bottom: 0.25em
|
1514
|
+
|
1515
|
+
.date
|
1516
|
+
font-weight: lighter
|
1517
|
+
|
1518
|
+
|
1519
|
+
.nav
|
1520
|
+
float: right
|
1521
|
+
|
1522
|
+
> a > img
|
1523
|
+
border-top: thick solid #FFFFFF
|
1524
|
+
|
1525
|
+
&:hover
|
1526
|
+
border-top: thick solid #FA8072
|
1527
|
+
|
1528
|
+
|
1529
|
+
#__nfo__ > table td:first-child, #__nfo__ > .validations
|
1530
|
+
text-align: center
|
1531
|
+
|
1326
1532
|
|
1327
1533
|
- print: |
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
1346
|
-
|
1347
|
-
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
1360
|
-
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1381
|
-
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1405
|
-
|
1406
|
-
|
1407
|
-
|
1408
|
-
|
1409
|
-
|
1410
|
-
|
1411
|
-
|
1534
|
+
tt
|
1535
|
+
font-weight: normal
|
1536
|
+
|
1537
|
+
|
1538
|
+
pre
|
1539
|
+
border: none
|
1540
|
+
|
1541
|
+
|
1542
|
+
h1, h2, h3, h4, h5, h6
|
1543
|
+
font-weight: normal
|
1544
|
+
clear: both
|
1545
|
+
|
1546
|
+
|
1547
|
+
=emphasize_hyperlinks
|
1548
|
+
color: #0000FF
|
1549
|
+
text-decoration: underline
|
1550
|
+
font-weight: bolder
|
1551
|
+
|
1552
|
+
a
|
1553
|
+
// blend all hyperlinks with normal text
|
1554
|
+
&:link, &:visited
|
1555
|
+
color: #000000
|
1556
|
+
text-decoration: none
|
1557
|
+
|
1558
|
+
// emphasize external hyperlinks
|
1559
|
+
&[href]:not([href^="#"])
|
1560
|
+
&:link, &:visited
|
1561
|
+
+emphasize_hyperlinks
|
1562
|
+
|
1563
|
+
// emphasize cross-reference hyperlinks
|
1564
|
+
&.xref[title]
|
1565
|
+
&:link, &:visited
|
1566
|
+
+emphasize_hyperlinks
|
1567
|
+
|
1568
|
+
// show URL of destination for external hyperlinks
|
1569
|
+
&[href]:not([href^="#"]):after
|
1570
|
+
content: " " attr(href)
|
1571
|
+
font-family: <%= @format['fonts']['monospace'] %>
|
1572
|
+
|
1573
|
+
// show name of destination for cross-references
|
1574
|
+
&.xref[title]:after
|
1575
|
+
content: " " attr(title)
|
1576
|
+
|
1577
|
+
&:after
|
1578
|
+
font-weight: normal
|
1579
|
+
font-size: smaller
|
1580
|
+
|
1581
|
+
|
1582
|
+
.tabs > ul, .nav, #__lof__, #__nfo__ > .validations
|
1583
|
+
display: none
|
1584
|
+
|
1585
|
+
|
1586
|
+
#__toc__, .part, .chapter, #__bib__
|
1587
|
+
page-break-before: always
|
1588
|
+
|
1589
|
+
|
1590
|
+
#__header__, #__footer__
|
1591
|
+
text-align: center
|
1592
|
+
|
1593
|
+
|
1594
|
+
#__header__ > .authors
|
1595
|
+
margin-top: 1.625em
|
1596
|
+
margin-bottom: -0.25em
|
1597
|
+
|
1598
|
+
|
1599
|
+
.header_outside_above, #__header__, .header_outside_below, .logo
|
1600
|
+
margin-bottom: 5em
|
1601
|
+
|
1602
|
+
|
1603
|
+
.footer_outside_above, #__footer__, .footer_outside_below, #__bib__, #__nfo__
|
1604
|
+
margin-top: 5em
|
1605
|
+
|
1606
|
+
|
1607
|
+
#__header__ .header_inside_above, #__footer__ .footer_inside_above
|
1608
|
+
margin-bottom: 4em
|
1609
|
+
|
1610
|
+
|
1611
|
+
#__header__ .header_inside_below, #__footer__ .footer_inside_below
|
1612
|
+
margin-top: 4em
|
1613
|
+
|
1614
|
+
|
1615
|
+
.part > .title > big, .chapter > .title > big
|
1616
|
+
padding-bottom: 0.5em
|
1617
|
+
|