Codebase list lua-ldoc / d56252b
fixed style sheet added steve donovan 9 years ago
2 changed file(s) with 333 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
1616
1717 Otherwise, the output is very similar, which is no accident since the HTML templates are
1818 based directly on LuaDoc. You can ship your own customized templates and style sheets with
19 your [own project](http://nilnor.github.com/textui/docs/), however. You have an option to
20 use Markdown to process the documentation, which means no ugly HTML is needed in doc
21 comments. C/C++ extension modules may be documented in a similar way, although function
19 your [own project](http://nilnor.github.com/textui/docs/) (also see Graham Hannington's
20 documentation for [Lua for z/OS](lua4z.com/doc/)). LDoc comes with three extra themes; 'pale'
21 for those who like whitespace, 'one' for one-column output, and 'fixed' for a fixed navigation
22 bar down the left side.
23
24 You have an option to use Markdown to process the documentation, which means no ugly HTML
25 is needed in doc comments.
26 C/C++ extension modules may be documented in a similar way, although function
2227 names cannot be inferred from the code itself.
2328
2429 LDoc can provide integrated documentation, with traditional function comments, any documents
11381143 function fun (one,two,three,four)
11391144 end
11401145 ----> displayed as: fun (one [, two], three [, four])
1141
1146
11421147 A more typical Lua API would have a chain of optional arguments, like so:
11431148
11441149 ---- a chain of options
11491154 function fun (one,two,three,four)
11501155 end
11511156 ----> displayed as: fun (one [, two [, three [, four]]])
1152
1157
11531158 This is a bit tedious to type, so the rule is that a series of 'opt' modifiers will be interpreted
11541159 as 'opt','optchain'.... . If you want to be explicit, then do `convert_opt=true` in your
11551160 `config.ld`.
12441249 - `manual_url` point to an alternative or local location for the Lua manual, e.g.
12451250 'file:///D:/dev/lua/projects/lua-5.1.4/doc/manual.html'
12461251 - `no_summary` suppress the Contents summary
1247 - `custom_tags` define some new tags, which will be presented after the function description.
1252 - `custom_tags` define some new tags, which will be presented after the function description.
12481253 The format is `{<name>,[title=<name>,}{hidden=false,}{format=nil}}`. For instance
1249 `custom_tags={'remark',title='Remarks'}` will add a little `Remarks` section to the docs for any function
1254 `custom_tags={'remark',title='Remarks'}` will add a little `Remarks` section to the docs for any function
12501255 containing this tag. `format` can be a function - if not present the default formatter will be used,
12511256 e.g. Markdown
12521257 - `custom_see_handler` function that filters see-references
13481353 emphasizing parameter names). The narrative alone _can_ to be sufficient, if it is written
13491354 well.
13501355
1351 There are two other stylesheets available in LDoc since 1.4; the first is `ldoc_one.css` which is what
1356 There are three other stylesheets available in LDoc since 1.4; the first is `ldoc_one.css` which is what
13521357 you get from `one=true` and the second is `ldoc_pale.css`. This is a lighter theme which
13531358 might give some relief from the heavier colours of the default. You can use this style with
13541359 `style="!pale"` or `-s !pale`.
13551360 See the [Lake](http://stevedonovan.github.io/lake/modules/lakelibs.html) documentation
1356 as an example of its use.
1361 as an example of its use. With 1.4.3 there is also the `style='!fixed'` where the
1362 left navigation panel is fixed and does not scroll with the rest of the document;
1363 you may find this assists navigation in complex modules and documents.
13571364
13581365 Of course, there's no reason why LDoc must always generate HTML. `--ext` defines what output
13591366 extension to use; this can also be set in the configuration file. So it's possible to write
0 return [[
1 /* BEGIN RESET
2
3 Copyright (c) 2010, Yahoo! Inc. All rights reserved.
4 Code licensed under the BSD License:
5 http://developer.yahoo.com/yui/license.html
6 version: 2.8.2r1
7 */
8 html {
9 color: #000;
10 background: #FFF;
11 }
12 body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td {
13 margin: 0;
14 padding: 0;
15 }
16 table {
17 border-collapse: collapse;
18 border-spacing: 0;
19 }
20 fieldset,img {
21 border: 0;
22 }
23 address,caption,cite,code,dfn,em,strong,th,var,optgroup {
24 font-style: inherit;
25 font-weight: inherit;
26 }
27 del,ins {
28 text-decoration: none;
29 }
30 li {
31 list-style: bullet;
32 margin-left: 20px;
33 }
34 caption,th {
35 text-align: left;
36 }
37 h1,h2,h3,h4,h5,h6 {
38 font-size: 100%;
39 font-weight: bold;
40 }
41 q:before,q:after {
42 content: '';
43 }
44 abbr,acronym {
45 border: 0;
46 font-variant: normal;
47 }
48 sup {
49 vertical-align: baseline;
50 }
51 sub {
52 vertical-align: baseline;
53 }
54 legend {
55 color: #000;
56 }
57 input,button,textarea,select,optgroup,option {
58 font-family: inherit;
59 font-size: inherit;
60 font-style: inherit;
61 font-weight: inherit;
62 }
63 input,button,textarea,select {*font-size:100%;
64 }
65 /* END RESET */
66
67 body {
68 margin-left: 1em;
69 margin-right: 1em;
70 font-family: arial, helvetica, geneva, sans-serif;
71 background-color: #ffffff; margin: 0px;
72 }
73
74 code, tt { font-family: monospace; }
75 span.parameter { font-family:monospace; }
76 span.parameter:after { content:":"; }
77 span.types:before { content:"("; }
78 span.types:after { content:")"; }
79 .type { font-weight: bold; font-style:italic }
80
81 body, p, td, th { font-size: .95em; line-height: 1.2em;}
82
83 p, ul { margin: 10px 0 0 0px;}
84
85 strong { font-weight: bold;}
86
87 em { font-style: italic;}
88
89 h1 {
90 font-size: 1.5em;
91 margin: 0 0 20px 0;
92 }
93 h2, h3, h4 { margin: 15px 0 10px 0; }
94 h2 { font-size: 1.25em; }
95 h3 { font-size: 1.15em; }
96 h4 { font-size: 1.06em; }
97
98 a:link { font-weight: bold; color: #004080; text-decoration: none; }
99 a:visited { font-weight: bold; color: #006699; text-decoration: none; }
100 a:link:hover { text-decoration: underline; }
101
102 hr {
103 color:#cccccc;
104 background: #00007f;
105 height: 1px;
106 }
107
108 blockquote { margin-left: 3em; }
109
110 ul { list-style-type: disc; }
111
112 p.name {
113 font-family: "Andale Mono", monospace;
114 padding-top: 1em;
115 }
116
117 pre.example {
118 background-color: rgb(245, 245, 245);
119 border: 1px solid silver;
120 padding: 10px;
121 margin: 10px 0 10px 0;
122 font-family: "Andale Mono", monospace;
123 font-size: .85em;
124 }
125
126 pre {
127 background-color: rgb(245,245,255); // rgb(245, 245, 245);
128 border: 1px solid #cccccc; //silver;
129 padding: 10px;
130 margin: 10px 0 10px 0;
131 overflow: auto;
132 font-family: "Andale Mono", monospace;
133 }
134
135
136 table.index { border: 1px #00007f; }
137 table.index td { text-align: left; vertical-align: top; }
138
139 #container {
140 margin-left: 1em;
141 margin-right: 1em;
142 background-color: #ffffff;
143 }
144
145 #product {
146 text-align: center;
147 border-bottom: 1px solid #cccccc;
148 background-color: #ffffff;
149 }
150
151 #product big {
152 font-size: 2em;
153 }
154
155 #main {
156 background-color:#FFFFFF; // #f0f0f0;
157 border-left: 1px solid #cccccc;
158 }
159
160 #navigation {
161 position: fixed;
162 top: 0;
163 left: 0;
164 float: left;
165 width: 14em;
166 vertical-align: top;
167 background-color:#FFFFFF; // #f0f0f0;
168 border-right: 2px solid #cccccc;
169 overflow: visible;
170 overflow-y: scroll;
171 height: 100%;
172 padding-left: 1em;
173 }
174
175 #navigation h2 {
176 background-color:#FFFFFF;//:#e7e7e7;
177 font-size:1.1em;
178 color:#000000;
179 text-align: left;
180 padding:0.2em;
181 border-bottom:1px solid #dddddd;
182 }
183
184 #navigation ul
185 {
186 font-size:1em;
187 list-style-type: none;
188 margin: 1px 1px 10px 1px;
189 }
190
191 #navigation li {
192 text-indent: -1em;
193 display: block;
194 margin: 3px 0px 0px 22px;
195 }
196
197 #navigation li li a {
198 margin: 0px 3px 0px -1em;
199 }
200
201 #content {
202 margin-left: 14em;
203 padding: 1em;
204 padding-left: 2em;
205 width: 700px;
206 border-left: 2px solid #cccccc;
207 // border-right: 2px solid #cccccc;
208 background-color: #ffffff;
209 }
210
211 #about {
212 clear: both;
213 padding-left: 1em;
214 margin-left: 14em; // avoid the damn sidebar!
215 border-top: 2px solid #cccccc;
216 border-left: 2px solid #cccccc;
217 background-color: #ffffff;
218 }
219
220 @media print {
221 body {
222 font: 12pt "Times New Roman", "TimeNR", Times, serif;
223 }
224 a { font-weight: bold; color: #004080; text-decoration: underline; }
225
226 #main {
227 background-color: #ffffff;
228 border-left: 0px;
229 }
230
231 #container {
232 margin-left: 2%;
233 margin-right: 2%;
234 background-color: #ffffff;
235 }
236
237 #content {
238 padding: 1em;
239 background-color: #ffffff;
240 }
241
242 #navigation {
243 display: none;
244 }
245 pre.example {
246 font-family: "Andale Mono", monospace;
247 font-size: 10pt;
248 page-break-inside: avoid;
249 }
250 }
251
252 table.module_list {
253 border-width: 1px;
254 border-style: solid;
255 border-color: #cccccc;
256 border-collapse: collapse;
257 }
258 table.module_list td {
259 border-width: 1px;
260 padding: 3px;
261 border-style: solid;
262 border-color: #cccccc;
263 }
264 table.module_list td.name { background-color: #f0f0f0; ; min-width: 200px; }
265 table.module_list td.summary { width: 100%; }
266
267 table.function_list {
268 border-width: 1px;
269 border-style: solid;
270 border-color: #cccccc;
271 border-collapse: collapse;
272 }
273 table.function_list td {
274 border-width: 1px;
275 padding: 3px;
276 border-style: solid;
277 border-color: #cccccc;
278 }
279 table.function_list td.name { background-color: #f6f6ff; ; min-width: 200px; }
280 table.function_list td.summary { width: 100%; }
281
282 dl.table dt, dl.function dt {border-top: 1px solid #ccc; padding-top: 1em;}
283 dl.table dd, dl.function dd {padding-bottom: 1em; margin: 10px 0 0 20px;}
284 dl.table h3, dl.function h3 {font-size: .95em;}
285
286 ul.nowrap {
287 overflow:auto;
288 whitespace:nowrap;
289 }
290
291 /* stop sublists from having initial vertical space */
292 ul ul { margin-top: 0px; }
293 ol ul { margin-top: 0px; }
294 ol ol { margin-top: 0px; }
295 ul ol { margin-top: 0px; }
296
297 /* make the target distinct; helps when we're navigating to a function */
298 a:target + * {
299 background-color: #FF9;
300 }
301
302 /* styles for prettification of source */
303 pre .comment { color: #558817; }
304 pre .constant { color: #a8660d; }
305 pre .escape { color: #844631; }
306 pre .keyword { color: #2239a8; font-weight: bold; }
307 pre .library { color: #0e7c6b; }
308 pre .marker { color: #512b1e; background: #fedc56; font-weight: bold; }
309 pre .string { color: #a8660d; }
310 pre .number { color: #f8660d; }
311 pre .operator { color: #2239a8; font-weight: bold; }
312 pre .preprocessor, pre .prepro { color: #a33243; }
313 pre .global { color: #800080; }
314 pre .prompt { color: #558817; }
315 pre .url { color: #272fc2; text-decoration: underline; }
316 ]]