css_doc 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/cssdoc +43 -0
- data/src/css_doc.rb +16 -0
- data/src/css_doc/css_writer.rb +20 -0
- data/src/css_doc/document.rb +31 -0
- data/src/css_doc/document_collection.rb +33 -0
- data/src/css_doc/document_documentation.rb +5 -0
- data/src/css_doc/document_handler.rb +36 -0
- data/src/css_doc/documentation.rb +111 -0
- data/src/css_doc/driver.rb +85 -0
- data/src/css_doc/examples.rb +12 -0
- data/src/css_doc/rule_set.rb +14 -0
- data/src/css_doc/rule_set_documentation.rb +5 -0
- data/src/css_doc/section.rb +17 -0
- data/src/css_doc/section_documentation.rb +5 -0
- data/src/css_doc/template.rb +47 -0
- data/src/css_pool/visitors/to_css.rb +9 -0
- data/src/rake/css_doc_task.rb +29 -0
- data/src/templates/default/css_doc.css +286 -0
- data/src/templates/default/document.html.erb +93 -0
- data/src/templates/default/example_index.html.erb +9 -0
- data/src/templates/default/file_index.html.erb +7 -0
- data/src/templates/default/index.html.erb +3 -0
- data/src/templates/default/layout.html.erb +30 -0
- data/src/templates/default/section_index.html.erb +14 -0
- data/src/templates/default/selector_index.html.erb +14 -0
- data/src/templates/simple/css_doc.css +282 -0
- data/src/templates/simple/document.html.erb +66 -0
- data/src/templates/simple/file_index.html.erb +7 -0
- data/src/templates/simple/index.html.erb +3 -0
- data/src/templates/simple/layout.html.erb +30 -0
- data/src/templates/simple/section_index.html.erb +14 -0
- data/src/templates/simple/selector_index.html.erb +14 -0
- metadata +98 -0
@@ -0,0 +1,30 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
6
|
+
<title><%= @title %> - CSS Documentation</title>
|
7
|
+
<link rel="stylesheet" media="all" href="<%= relative_root %>/css_doc.css" />
|
8
|
+
<link rel="stylesheet" media="all" href="<%= relative_root %>/styles.css" />
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
<div id="canvas">
|
12
|
+
<ul class="navigation">
|
13
|
+
<li><a href="<%= relative_root %>/index.html">Home</a></li>
|
14
|
+
<li><a href="<%= relative_root %>/file_index.html">File Index</a></li>
|
15
|
+
<li><a href="<%= relative_root %>/selector_index.html">Selector Index</a></li>
|
16
|
+
<li><a href="<%= relative_root %>/section_index.html">Section Index</a></li>
|
17
|
+
<li><a href="<%= relative_root %>/example_index.html">Example Index</a></li>
|
18
|
+
</ul>
|
19
|
+
|
20
|
+
<div class="content">
|
21
|
+
<%= content %>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<p id="footer">
|
25
|
+
Generated by css_doc. css_doc is Copyright (2009) Thomas Kadauke, imedo.de, das <a href="http://www.imedo.de">Gesundheitsportal</a>.
|
26
|
+
</p>
|
27
|
+
</div>
|
28
|
+
</body>
|
29
|
+
</html>
|
30
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<h1>Section Index</h1>
|
2
|
+
|
3
|
+
<dl class="index">
|
4
|
+
<% @collection.section_hash.sort.each do |name, sections| %>
|
5
|
+
<dt><%= name %></dt>
|
6
|
+
<dd>
|
7
|
+
<ul>
|
8
|
+
<% sections.each do |section| %>
|
9
|
+
<li><a href="<%= section.document.output_file_name %>#section-<%= section.object_id %>"><%= section.document.name %></a></li>
|
10
|
+
<% end %>
|
11
|
+
</ul>
|
12
|
+
</dd>
|
13
|
+
<% end %>
|
14
|
+
</dt>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<h1>Selector Index</h1>
|
2
|
+
|
3
|
+
<dl class="index">
|
4
|
+
<% @collection.selector_hash.sort.each do |name, selectors| %>
|
5
|
+
<dt><%= name %></dt>
|
6
|
+
<dd>
|
7
|
+
<ul>
|
8
|
+
<% selectors.each do |selector| %>
|
9
|
+
<li><a href="<%= selector.rule_set.document.output_file_name %>#rule-set-<%= selector.rule_set.object_id %>"><%= selector.rule_set.document.name %></a></li>
|
10
|
+
<% end %>
|
11
|
+
</ul>
|
12
|
+
</dd>
|
13
|
+
<% end %>
|
14
|
+
</dt>
|
@@ -0,0 +1,282 @@
|
|
1
|
+
/**
|
2
|
+
* @file css_doc.css
|
3
|
+
* @author Thomas Kadauke
|
4
|
+
* @css-for Safari 4, Firefox 3
|
5
|
+
*/
|
6
|
+
|
7
|
+
/**
|
8
|
+
* @section Reset styles
|
9
|
+
* These styles reset the default style sheet that comes with the user agent.
|
10
|
+
*/
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Set margins and paddings to 0, and font-properties to a default value.
|
14
|
+
*/
|
15
|
+
html, body, div, span, applet, object, iframe,
|
16
|
+
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
17
|
+
a, abbr, acronym, address, big, cite, code,
|
18
|
+
del, dfn, em, font, img, ins, kbd, q, s, samp,
|
19
|
+
small, strike, strong, sub, sup, tt, var,
|
20
|
+
dl, dt, dd, ol, ul, li,
|
21
|
+
fieldset, form, label, legend,
|
22
|
+
table, caption, tbody, tfoot, thead, tr, th, td {
|
23
|
+
margin: 0;
|
24
|
+
padding: 0;
|
25
|
+
border: 0;
|
26
|
+
outline: 0;
|
27
|
+
font-weight: inherit;
|
28
|
+
font-style: inherit;
|
29
|
+
font-size: 100%;
|
30
|
+
font-family: inherit;
|
31
|
+
vertical-align: baseline;
|
32
|
+
}
|
33
|
+
/**
|
34
|
+
* Reset focus styles to nothing.
|
35
|
+
* Remember to define focus styles in after this declaration.
|
36
|
+
*/
|
37
|
+
:focus {
|
38
|
+
outline: 0;
|
39
|
+
}
|
40
|
+
/**
|
41
|
+
* Reset text color and line height.
|
42
|
+
*/
|
43
|
+
body {
|
44
|
+
line-height: 1;
|
45
|
+
color: black;
|
46
|
+
background: white;
|
47
|
+
}
|
48
|
+
/**
|
49
|
+
* Remove default list decoration.
|
50
|
+
*/
|
51
|
+
ol, ul {
|
52
|
+
list-style: none;
|
53
|
+
}
|
54
|
+
/*
|
55
|
+
* Remove default table styling.
|
56
|
+
* Tables still need 'cellspacing="0"' in the markup.
|
57
|
+
*/
|
58
|
+
table {
|
59
|
+
border-collapse: separate;
|
60
|
+
border-spacing: 0;
|
61
|
+
}
|
62
|
+
/**
|
63
|
+
* Reset text alignment and typography for special tags.
|
64
|
+
*/
|
65
|
+
caption, th, td {
|
66
|
+
text-align: left;
|
67
|
+
font-weight: normal;
|
68
|
+
}
|
69
|
+
/**
|
70
|
+
* Remove CSS generated content around citation tags.
|
71
|
+
*/
|
72
|
+
blockquote:before, blockquote:after,
|
73
|
+
q:before, q:after {
|
74
|
+
content: "";
|
75
|
+
}
|
76
|
+
blockquote, q {
|
77
|
+
quotes: "" "";
|
78
|
+
}
|
79
|
+
|
80
|
+
/**
|
81
|
+
* @section Typography
|
82
|
+
*/
|
83
|
+
|
84
|
+
/**
|
85
|
+
* A font size of 100.01% on the html tag makes it possible to easily convert
|
86
|
+
* em's to pixels with default font size settings in all major browsers.
|
87
|
+
*/
|
88
|
+
html {
|
89
|
+
font-size: 100.01%;
|
90
|
+
}
|
91
|
+
|
92
|
+
/**
|
93
|
+
* Reset font size so that 1 em is 10 pixels.
|
94
|
+
*/
|
95
|
+
body {
|
96
|
+
font-size: 62.5%;
|
97
|
+
font-family: Arial, Verdana, Tahoma, 'Bitstream Vera Sans', sans serif;
|
98
|
+
}
|
99
|
+
|
100
|
+
/**
|
101
|
+
* Set font size and spacing.
|
102
|
+
*/
|
103
|
+
#canvas {
|
104
|
+
font-size: 1.2em;
|
105
|
+
line-height: 1.3;
|
106
|
+
}
|
107
|
+
|
108
|
+
p {
|
109
|
+
margin-bottom: 0.5em;
|
110
|
+
}
|
111
|
+
|
112
|
+
/**
|
113
|
+
* Use typewriter font for code examples.
|
114
|
+
*/
|
115
|
+
pre {
|
116
|
+
font-family: Courier;
|
117
|
+
width: 100%;
|
118
|
+
overflow: auto;
|
119
|
+
}
|
120
|
+
|
121
|
+
/**
|
122
|
+
* @section Headers
|
123
|
+
*/
|
124
|
+
|
125
|
+
/**
|
126
|
+
* All headers use the same font, same margins, but different font sizes.
|
127
|
+
*/
|
128
|
+
h1, h2, h3, h4, h5, h6 { font-family: 'Arial', sans serif; font-weight: normal; line-height: 1; margin: 0 0 .5em 0; padding: 0; }
|
129
|
+
h1 { font-size: 1.9em; }
|
130
|
+
h2 { font-size: 1.8333333em; }
|
131
|
+
h3 { font-size: 1.6em; }
|
132
|
+
h4 { font-size: 1.4em; }
|
133
|
+
h5 { font-size: 1em; }
|
134
|
+
h6 { font-size: 1em; }
|
135
|
+
|
136
|
+
/**
|
137
|
+
* @section Layout
|
138
|
+
*/
|
139
|
+
|
140
|
+
body {
|
141
|
+
padding: 1em;
|
142
|
+
}
|
143
|
+
|
144
|
+
/**
|
145
|
+
* Navigation is on the top, and items are inlined.
|
146
|
+
*/
|
147
|
+
.navigation {
|
148
|
+
text-align: center;
|
149
|
+
margin-bottom: 1em;
|
150
|
+
}
|
151
|
+
|
152
|
+
.navigation li {
|
153
|
+
display: inline;
|
154
|
+
}
|
155
|
+
|
156
|
+
.navigation li a {
|
157
|
+
border-right: 1px solid #000;
|
158
|
+
padding: 0 1em;
|
159
|
+
}
|
160
|
+
|
161
|
+
.navigation li:last-child a {
|
162
|
+
border: none;
|
163
|
+
}
|
164
|
+
|
165
|
+
/**
|
166
|
+
* @section Lists
|
167
|
+
*/
|
168
|
+
|
169
|
+
dl {
|
170
|
+
margin-bottom: 0.5em;
|
171
|
+
}
|
172
|
+
|
173
|
+
dt {
|
174
|
+
font-weight: bold;
|
175
|
+
}
|
176
|
+
|
177
|
+
/**
|
178
|
+
* Use nice indentation to make definition items more distinguishable from the
|
179
|
+
* terms.
|
180
|
+
*/
|
181
|
+
dd {
|
182
|
+
padding-left: 2em;
|
183
|
+
}
|
184
|
+
|
185
|
+
/**
|
186
|
+
* @section Indexes
|
187
|
+
*/
|
188
|
+
|
189
|
+
/**
|
190
|
+
* Index list items should be next to each other.
|
191
|
+
*/
|
192
|
+
dl.index ul li {
|
193
|
+
display: inline;
|
194
|
+
}
|
195
|
+
|
196
|
+
/**
|
197
|
+
* Separate index list items by commas via CSS.
|
198
|
+
*/
|
199
|
+
dl.index ul li:after {
|
200
|
+
content: ', ';
|
201
|
+
}
|
202
|
+
|
203
|
+
/**
|
204
|
+
* No comma for the last index list item.
|
205
|
+
*/
|
206
|
+
dl.index ul li:last-child:after {
|
207
|
+
content: '';
|
208
|
+
}
|
209
|
+
|
210
|
+
/**
|
211
|
+
* Actually use bullets for the file index.
|
212
|
+
*/
|
213
|
+
ul.file-index {
|
214
|
+
list-style-type: disc;
|
215
|
+
}
|
216
|
+
|
217
|
+
ul.file-index li {
|
218
|
+
margin-left: 3em;
|
219
|
+
}
|
220
|
+
|
221
|
+
/**
|
222
|
+
* @section Document page
|
223
|
+
*/
|
224
|
+
|
225
|
+
ul.rule-sets, ul.sections {
|
226
|
+
margin-bottom: 0.5em;
|
227
|
+
}
|
228
|
+
|
229
|
+
/**
|
230
|
+
* Like index lists, the table of contents lists on the document page should be
|
231
|
+
* inlined.
|
232
|
+
*/
|
233
|
+
ul.sections li, ul.rule-sets li {
|
234
|
+
display: inline;
|
235
|
+
}
|
236
|
+
|
237
|
+
/**
|
238
|
+
* Again, use CSS-generated commas to separate the items.
|
239
|
+
*/
|
240
|
+
ul.sections li:after, ul.rule-sets li:after {
|
241
|
+
content: ', ';
|
242
|
+
}
|
243
|
+
|
244
|
+
/**
|
245
|
+
* No comma for the last one.
|
246
|
+
*/
|
247
|
+
ul.sections li:last-child:after, ul.rule-sets li:last-child:after {
|
248
|
+
content: '';
|
249
|
+
}
|
250
|
+
|
251
|
+
/**
|
252
|
+
* Give section headers a visual emphasis.
|
253
|
+
*/
|
254
|
+
h2.section {
|
255
|
+
border-top: 1px solid #000;
|
256
|
+
border-bottom: 1px solid #000;
|
257
|
+
margin-top: 1em;
|
258
|
+
margin-bottom: 1em;
|
259
|
+
}
|
260
|
+
|
261
|
+
/**
|
262
|
+
* Examples are surrounded by a thick border. Also there is a rather large
|
263
|
+
* padding to make it clear where the example starts. This selector is the
|
264
|
+
* namespace for generated CSS, which is used to style the example in the box.
|
265
|
+
*/
|
266
|
+
div.example {
|
267
|
+
margin: 1em 0 1em 2em;
|
268
|
+
border: 2px solid #000;
|
269
|
+
padding: 1em;
|
270
|
+
}
|
271
|
+
|
272
|
+
/**
|
273
|
+
* @section Footer
|
274
|
+
*/
|
275
|
+
|
276
|
+
/**
|
277
|
+
* Center footer line.
|
278
|
+
*/
|
279
|
+
#footer {
|
280
|
+
margin-top: 2em;
|
281
|
+
text-align: center;
|
282
|
+
}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
<h1>Document <%= @document.name %></h1>
|
2
|
+
<% if @document.documentation %>
|
3
|
+
<dl>
|
4
|
+
<% if @document.documentation.author %>
|
5
|
+
<dt>Author</dt>
|
6
|
+
<dd><%= @document.documentation.author %></dd>
|
7
|
+
<% end %>
|
8
|
+
<% if @document.documentation.appdef %>
|
9
|
+
<dt>Application</dt>
|
10
|
+
<dd><%= @document.documentation.appdef %></dd>
|
11
|
+
<% end %>
|
12
|
+
<% if @document.documentation.link %>
|
13
|
+
<dt>URL</dt>
|
14
|
+
<dd><%= @document.documentation.link %></dd>
|
15
|
+
<% end %>
|
16
|
+
<% if @document.documentation.copyright %>
|
17
|
+
<dt>Copyright</dt>
|
18
|
+
<dd><%= @document.documentation.copyright %></dd>
|
19
|
+
<% end %>
|
20
|
+
<% if @document.documentation.css_for %>
|
21
|
+
<dt>Compatible browsers</dt>
|
22
|
+
<dd><%= @document.documentation.css_for %></dd>
|
23
|
+
<% end %>
|
24
|
+
<% if @document.documentation.author %>
|
25
|
+
<dt>Version</dt>
|
26
|
+
<dd><%= @document.documentation.author %></dd>
|
27
|
+
<% end %>
|
28
|
+
<% if @document.documentation.date %>
|
29
|
+
<dt>Date</dt>
|
30
|
+
<dd><%= @document.documentation.date %></dd>
|
31
|
+
<% end %>
|
32
|
+
<% if @document.documentation.license %>
|
33
|
+
<dt>License</dt>
|
34
|
+
<dd><%= @document.documentation.license %></dd>
|
35
|
+
<% end %>
|
36
|
+
</dl>
|
37
|
+
|
38
|
+
<%= @document.documentation.sections.to_html %>
|
39
|
+
<% end %>
|
40
|
+
|
41
|
+
<% @document.sections.each do |section| %>
|
42
|
+
<% if section.name %>
|
43
|
+
<h2 class="section" id="section-<%= section.object_id %>"><%= section.name %></h2>
|
44
|
+
<% end %>
|
45
|
+
|
46
|
+
<%= section.documentation.sections.to_html %>
|
47
|
+
|
48
|
+
<dl>
|
49
|
+
<% section.rule_sets.each do |rule_set| %>
|
50
|
+
<dt class="rule-set" id="rule-set-<%= rule_set.object_id %>">Rule set <%= rule_set.documentation.name || "(unnamed)" %></dt>
|
51
|
+
<dd>
|
52
|
+
<p><%= rule_set.selector_css %> <%= rule_set.declaration_css %></p>
|
53
|
+
|
54
|
+
<% if rule_set.documentation.formerly %>
|
55
|
+
<p>Formerly: <%= rule_set.documentation.formerly %></p>
|
56
|
+
<% end %>
|
57
|
+
|
58
|
+
<% if rule_set.documentation.deprecated %>
|
59
|
+
<p>Deprecated: <%= rule_set.documentation.deprecated %></p>
|
60
|
+
<% end %>
|
61
|
+
|
62
|
+
<%= rule_set.documentation.sections.to_html %>
|
63
|
+
</dd>
|
64
|
+
<% end %>
|
65
|
+
</dl>
|
66
|
+
<% end %>
|