ldoc.ltp 22.7 KB
Newer Older
1
2
# local no_spaces = ldoc.no_spaces
# local use_li = ldoc.use_li
Alexis Brenon's avatar
Alexis Brenon committed
3
# local escape = ldoc.escape
4
5
6
7
8
9
# local display_name = ldoc.display_name
# local iter = ldoc.modules.iter
# local function M(txt,item) return ldoc.markup(txt,item,ldoc.plain) end
# local nowrap = ldoc.wrap and '' or 'nowrap'

# local html_root = (not ldoc.single and module) and "../" or "./"
Alexis Brenon's avatar
Alexis Brenon committed
10
11
# local show_return = not ldoc.no_return_or_parms
# local show_parms = show_return
12
13
14
15
16
17
18
19
20
21
22
23
24
25

# local need_module_nav = false
# if module then
#   for kind, items in module.kinds() do
#     for item in items() do
#       need_module_nav = true
#       break
#     end
#   end
# end

<!DOCTYPE html>
<html lang="en">
  <head>
Alexis Brenon's avatar
Alexis Brenon committed
26
    <meta http-equiv="Content-Type" content="text/html;charset=$(escape(ldoc.doc_charset))"/>
27
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
Alexis Brenon's avatar
Alexis Brenon committed
28
    <title>$(escape(ldoc.title))</title>
Alexis Brenon's avatar
Use CDN    
Alexis Brenon committed
29
30
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.4/css/bootstrap.min.css" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdn.materialdesignicons.com/1.7.22/css/materialdesignicons.min.css">
31
# if ldoc.custom_css then -- add custom CSS file if configured.
Alexis Brenon's avatar
Alexis Brenon committed
32
    <link rel="stylesheet" href="$(escape(ldoc.custom_css))" type="text/css" />
33
34
35
36
37
38
39
40
41
42
# end
  </head>

  <!-- **************************************************************** -->
  <!--                                                                  -->
  <!--                        BODY                                      -->
  <!--                                                                  -->
  <!-- **************************************************************** -->

  <body>
Alexis Brenon's avatar
Alexis Brenon committed
43
    <h1 style="display: none">$(ldoc.project)</h1>  
44
45
46
47
48
49
50
51
52
53
54
  <!-- **************************************************************** -->
  <!--                                                                  -->
  <!--                       PROJECT NAV BAR                            -->
  <!--                                                                  -->
  <!-- **************************************************************** -->

# -------- contents of project ----------
# local this_mod = module and module.name
<!-- Project navbar -->
<nav class="navbar navbar-full navbar-dark bg-primary">
  <div class="container">
Alexis Brenon's avatar
Alexis Brenon committed
55
    <a class="navbar-brand" href="$(escape(html_root))/$(escape(ldoc.output)).html">$(ldoc.project)</a>
56
57
    <div class="nav navbar-nav">

Alexis Brenon's avatar
Alexis Brenon committed
58
59
# for _, kind_name in ldoc.ipairs({"Scripts", "Packages", "Modules", "Classes"}) do
#   if ldoc.kinds[kind_name] then
60
      <a class="nav-item nav-link"
Alexis Brenon's avatar
Alexis Brenon committed
61
         id="project-nav-$(escape(no_spaces(kind_name)))-header"
62
63
         data-toggle="collapse"
         data-parent="#project-nav-accordion"
Alexis Brenon's avatar
Alexis Brenon committed
64
65
         href="#project-nav-$(escape(no_spaces(kind_name)))-collapsing"
         aria-controls="project-nav-$(escape(no_spaces(kind_name)))-collapsing"
66
         aria-expanded="false"
Alexis Brenon's avatar
Alexis Brenon committed
67
         aria-label="Show $(escape(kind_name))">
Alexis Brenon's avatar
Alexis Brenon committed
68
        $(kind_name)
69
      </a>
Alexis Brenon's avatar
Alexis Brenon committed
70
#   end
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# end

    </div> <!-- Navbar content -->
  </div> <!-- Container -->

  <!-- Kinds sub-navbars -->
  <div class="container panel"
       id="project-nav-accordion"
       role="navigation"
       style="background-color: rgba(255, 255, 255, 0.25);">

# for _, kind_name in ldoc.ipairs({"Scripts", "Modules"}) do
    <!-- Kind navbar -->
    <div class="panel-collapse collapse"
Alexis Brenon's avatar
Alexis Brenon committed
85
         id="project-nav-$(escape(no_spaces(kind_name)))-collapsing">
Alexis Brenon's avatar
Alexis Brenon committed
86
      <span class="navbar-brand">$(kind_name)</span>
87
88
      <div class="nav navbar-nav">

Alexis Brenon's avatar
Alexis Brenon committed
89
#   if ldoc.kinds[kind_name] then
90
91
#   for mod in ldoc.kinds[kind_name]() do 
        <a class="nav-item nav-link"
Alexis Brenon's avatar
Alexis Brenon committed
92
           href="$(escape(ldoc.ref_to_module(mod)))">
Alexis Brenon's avatar
Alexis Brenon committed
93
          $(display_name(mod))
94
        </a>
Alexis Brenon's avatar
Alexis Brenon committed
95
#   end
96
97
98
99
100
101
102
103
#   end

      </div> <!-- Navbar content -->
    </div> <!-- Kind navbar -->
# end

    <!-- Classes navbar -->
    <div class="panel-collapse collapse"
Alexis Brenon's avatar
Alexis Brenon committed
104
         id="project-nav-$(escape(no_spaces("Classes")))-collapsing">
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
      <span class="navbar-brand">Classes</span>
      <div class="nav navbar-nav">

        <!-- Group classes under their package -->
# local all_classes = {}
# for mod in ldoc.kinds["Modules"]() do
#   local classes = {}
# 	for class in ldoc.kinds.Classes() do
#			if class.package == mod.mod_name then
#				classes[#classes + 1] = class
#				all_classes[#all_classes + 1] = class
#			end
#		end
				
#		if #classes > 0 then
        <!-- Module dropdown -->
        <div class="nav-item nav-link dropdown">
          <a class="dropdown-toggle"
Alexis Brenon's avatar
Alexis Brenon committed
123
             id="project-nav-classes-$(escape(no_spaces(mod.name)))-dropdown-header"
124
125
126
             data-toggle="dropdown"
             aria-haspopup="true"
             aria-expanded="false">
Alexis Brenon's avatar
Alexis Brenon committed
127
            $(mod.name)
128
129
130
          </a>
          <!-- Classes in module -->
          <div class="dropdown-menu"
Alexis Brenon's avatar
Alexis Brenon committed
131
               aria-labelledby="project-nav-classes-$(escape(no_spaces(mod.name)))-dropdown-header">
132
133
134

#     for _, class in ldoc.ipairs(classes) do
            <a class="dropdown-item"
Alexis Brenon's avatar
Alexis Brenon committed
135
               href="$(escape(ldoc.ref_to_module(class)))">
Alexis Brenon's avatar
Alexis Brenon committed
136
              $(class.names_hierarchy[#class.names_hierarchy])
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
            </a>
#			end -- For classes in Module

          </div> <!-- Classes in module -->
        </div> <!-- Module dropdown -->
# 	end -- If classes in module
# end -- For modules 
<!-- End package-grouped classes -->

<!-- Add classes not already listed -->
#	for class in ldoc.kinds.Classes() do
#	  local listed = false
#		for _, listed_class in ldoc.ipairs(all_classes) do
#			if listed_class == class then
#				listed = true
#				break
#			end
#		end

#		if not listed then
        <a class="nav-item nav-link"
Alexis Brenon's avatar
Alexis Brenon committed
158
           href="$(escape(ldoc.ref_to_module(class)))">
Alexis Brenon's avatar
Alexis Brenon committed
159
          $(class.name)
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
        </a>
#	  end

#	end -- For classes not listed

      </div> <!-- navbar content -->
    </div> <!-- Classes navbar -->
  </div> <!-- Kinds sub-navbars -->
</nav> <!-- Project navbar -->

  <!-- **************************************************************** -->
  <!--                                                                  -->
  <!--                       MODULE NAV BAR (SMALL SCREEN)              -->
  <!--                                                                  -->
  <!-- **************************************************************** -->

# --------- contents of module -------------
# if need_module_nav then 
#   local one_column_nav_display = (ldoc.one) and "" or "hidden-md-up"
<!-- Module horizontal navbar -->
Alexis Brenon's avatar
Alexis Brenon committed
180
<nav class="navbar navbar-light bg-faded $(escape(one_column_nav_display))">
181
182
183
184
185
186
  <div class="container">
    <a class="navbar-brand" href="#">Module content</a>
    <div class="nav navbar-nav">

#   for kind,items in module.kinds() do
      <a class="nav-item nav-link"
Alexis Brenon's avatar
Alexis Brenon committed
187
         id="module-horiz-nav-$(escape(no_spaces(kind)))-header"
188
189
         data-toggle="collapse"
         data-parent="#module-horiz-nav-accordion"
Alexis Brenon's avatar
Alexis Brenon committed
190
191
         href="#module-horiz-nav-$(escape(no_spaces(kind)))-collapsing"
         aria-controls="module-horiz-nav-$(escape(no_spaces(kind)))-collapsing"
192
         aria-expanded="false"
Alexis Brenon's avatar
Alexis Brenon committed
193
         aria-label="Show $(escape(kind))">
Alexis Brenon's avatar
Alexis Brenon committed
194
        $(kind)
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
      </a>
#   end

    </div> <!-- Navbar content -->
  </div> <!-- container -->

  <!-- Kinds sub-navbars -->
  <div class="container panel"
       id="module-horiz-nav-accordion"
       role="navigation"
       style="background-color: rgba(255, 255, 255, 0.25);">

#   for kind,items in module.kinds() do
    <!-- Kind navbar -->
    <div class="panel-collapse collapse"
Alexis Brenon's avatar
Alexis Brenon committed
210
         id="module-horiz-nav-$(escape(no_spaces(kind)))-collapsing">
Alexis Brenon's avatar
Alexis Brenon committed
211
      <span class="navbar-brand">$(kind)</span>
212
213
214
215
      <div class="nav navbar-nav">

#     for item in items() do
        <a class="nav-item nav-link"
Alexis Brenon's avatar
Alexis Brenon committed
216
           href="#$(escape(item.name))">
Alexis Brenon's avatar
Alexis Brenon committed
217
          $(display_name(item))
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
        </a>
#     end

      </div> <!-- Navbar content -->
    </div> <!-- Kind navbar -->
#   end -- for kind, items in module

  </div> <!-- Kinds sub-navbars -->
</nav> <!-- Module horizontal navbar -->
# end -- if need_module_nav

<div class="container m-t-1">
<div class="row">

  <!-- **************************************************************** -->
  <!--                                                                  -->
  <!--                       MODULE NAV BAR (MEDIUM SCREEN)             -->
  <!--                                                                  -->
  <!-- **************************************************************** -->

# local one_column_nav_display = ldoc.one and "hidden" or "hidden-sm-down"
Alexis Brenon's avatar
Alexis Brenon committed
239
<aside class="col-md-3 $(escape(one_column_nav_display))">
240
241
242
243
244
245
246
247
# if need_module_nav then -- bang out the functions on the side
  <!-- Vertical module navigation -->
  <nav class="m-b-1">
    <h2>Module content</h2>
    <!-- List group panel -->
    <div role="tablist"
         class="list-group panel"
         id="module-vert-nav-accordion"
Alexis Brenon's avatar
Alexis Brenon committed
248
         aria-multiselectable="false">
249
250
251

#   for kind,items in module.kinds() do
      <a class="list-group-item list-group-item-action bg-primary panel-heading panel-title"
Alexis Brenon's avatar
Alexis Brenon committed
252
         id="module-vert-nav-$(escape(no_spaces(kind)))-header"
253
254
         data-toggle="collapse"
         data-parent="#module-vert-nav-accordion"
Alexis Brenon's avatar
Alexis Brenon committed
255
         href="#module-vert-nav-$(escape(no_spaces(kind)))-collapsing"
256
         aria-expanded="false"
Alexis Brenon's avatar
Alexis Brenon committed
257
         aria-controls="module-vert-nav-$(escape(no_spaces(kind)))-collapsing">
Alexis Brenon's avatar
Alexis Brenon committed
258
        <strong>$(kind)</strong>
259
260
      </a>
      <!-- Kinds sub-list -->
Alexis Brenon's avatar
Alexis Brenon committed
261
      <div id="module-vert-nav-$(escape(no_spaces(kind)))-collapsing"
262
           class="panel-collapse collapse"
Alexis Brenon's avatar
Alexis Brenon committed
263
           aria-labelledby="module-vert-nav-$(escape(no_spaces(kind)))-header">
264
        <a class="list-group-item"
Alexis Brenon's avatar
Alexis Brenon committed
265
           href="#$(escape(no_spaces(kind)))">
266
267
268
269
270
271
272
          <strong>
            See all
          </strong>
        </a>

#     for item in items() do
        <a class="list-group-item" 
Alexis Brenon's avatar
Alexis Brenon committed
273
           href="#$(escape(item.name))">
Alexis Brenon's avatar
Alexis Brenon committed
274
          $(display_name(item))
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
        </a>
#     end

      </div> <!-- Kinds sub-list -->
#   end -- for kind, items in module

    </div> <!-- List group panel -->
  </nav> <!-- Vertical module navigation -->
# end -- if need_module_nav

<!-- **************************************************************** -->
<!--                                                                  -->
<!--                       MODULE GENERAL INFO                        -->
<!--                                                                  -->
<!-- **************************************************************** -->

# if module then
#   if module.info or module.tags.include or module.see then
  <!-- Module general info -->
  <div class="card card-block card-info">

#     if module.info then
    <!-- Module info -->
    <div>
      <strong class="card-title">Info:</strong>
      <ul class="card-text list-unstyled">
#       for tag, value in module.info:iter() do
#         local icon_name = nil
#         if tag == "Author" then icon_name = "mdi-pencil" end
#         if icon_name then
        <li>
Alexis Brenon's avatar
Alexis Brenon committed
306
          <strong class="$(escape(icon_name)) m-r-1" title="$(escape(tag))"></strong>
Alexis Brenon's avatar
Alexis Brenon committed
307
          $(M(value,module))
308
309
310
        </li>
#         else
        <li>
Alexis Brenon's avatar
Alexis Brenon committed
311
312
          <strong>$(tag)</strong>
          $(M(value, module))
313
314
315
316
317
318
319
320
321
322
323
324
        </li>
#         end -- if icon_name
#       end -- for tag, value
      </ul>
    </div> <!-- Module info -->
#     end -- if module.info

#     if module.tags.include then
    <!-- Module include -->
    <div>
      <strong class="card-title">References:</strong>
      <p class="card-text">
Alexis Brenon's avatar
Alexis Brenon committed
325
        $(M(ldoc.include_file(module.tags.include)))
326
327
328
329
330
331
332
333
334
335
      </p>
    </div> <!-- Module include -->
#     end

#     if module.see then
    <!-- Module sees -->
    <div>
      <strong class="card-title">See also:</strong>
      <ul class="card-text list-unstyled">
#       for see in iter(module.see) do
Alexis Brenon's avatar
Alexis Brenon committed
336
        <li><a href="$(escape(ldoc.href(see)))">$(see.mod.mod_name)</a></li>
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
#       end
      </ul>
    </div> <!-- Module sees -->
#     end

  </div> <!-- Module general info -->
#   end -- if info or sees or include
# end -- if module

</aside>

<!-- *****************************************************************  -->
<!--                                                                    -->
<!--                          PAGE MAIN PART                            -->
<!--                                                                    -->
<!-- *****************************************************************  -->

<main class="col-xs-12 col-md-9">

# if ldoc.body then -- verbatim HTML as contents; 'non-code' entries

Alexis Brenon's avatar
Alexis Brenon committed
358
	$(ldoc.body)
359
360
361
362
363
364
365
366
367

# elseif module then -- module documentation

	<!-- Module informations -->
	<header class="row module-header">

		<!-- Module name and summary -->
		<div class="col-xs-12">
			<h2>
Alexis Brenon's avatar
Alexis Brenon committed
368
369
				$(ldoc.module_typename(module))
				<code class="module-name">$(module.mod_name)</code>
370
371
372
			</h2>

			<div class="module-presentation">
Alexis Brenon's avatar
Alexis Brenon committed
373
374
				<p class="module-summary">$(M(module.summary,module))</p>
				<p class="module-description">$(M(module.description,module))</p>
375
376
377
378
379
380
381
			</div>
		</div> <!-- Name and summary -->

#		if module.info or module.tags.include or module.see then
#			local one_column_nav_display = ldoc.one and "" or "hidden-md-up"
    
		<!-- Info and references -->
Alexis Brenon's avatar
Alexis Brenon committed
382
		<div class="col-xs-12 card card-block card-info $(escape(one_column_nav_display)) module-info">
383
384
385
386
387
388
389
390
391
392
			<div class="row">

#			local sub_col_width = 12 / (
#				(module.info and 1 or 0) +
#				(module.tags.include and 1 or 0) +
#				(module.see and 1 or 0)
#			)
#			sub_col_width = sub_col_width == 12 and "12" or sub_col_width == 6 and "6" or "4"

#   	if module.info then
Alexis Brenon's avatar
Alexis Brenon committed
393
				<div class="col-xs-12 col-md-$(escape(sub_col_width))">
394
395
396
397
398
399
400
401
        	<strong class="card-title">Info:</strong>
          <ul class="card-text list-unstyled">

#     	for tag, value in module.info:iter() do
#       	local icon_name = nil
#       	if tag == "Author" then icon_name = "mdi-pencil" end
						<li>
#       	if icon_name then
Alexis Brenon's avatar
Alexis Brenon committed
402
	            <strong class="$(escape(icon_name)) m-r-1" title="$(escape(tag))"></strong>
403
#       	else
Alexis Brenon's avatar
Alexis Brenon committed
404
  	          <strong>$(tag)</strong>
405
#       	end
Alexis Brenon's avatar
Alexis Brenon committed
406
							$(M(value, module))
407
408
409
410
411
412
413
414
						</li>
#     	end -- for tags

          </ul>
				</div>
#   	end -- if module.info

#     if module.tags.include then
Alexis Brenon's avatar
Alexis Brenon committed
415
				<div class="col-xs-12 col-md-$(escape(sub_col_width))">
416
417
          <strong class="card-title">References:</strong>
          <p class="card-text">
Alexis Brenon's avatar
Alexis Brenon committed
418
						$(M(ldoc.include_file(module.tags.include)))
419
420
421
422
423
					</p>
				</div>
#     end

#     if module.see then
Alexis Brenon's avatar
Alexis Brenon committed
424
				<div class="col-xs-12 col-md-$(escape(sub_col_width))">
425
426
427
428
          <strong class="card-title">See also:</strong>
          <ul class="card-text list-unstyled">
#       for see in iter(module.see) do
          	<li>
Alexis Brenon's avatar
Alexis Brenon committed
429
							<a href="$(escape(ldoc.href(see)))">$(see.mod.mod_name)</a>
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
						</li>
#       end
          </ul>
				</div>
#     end -- if module.see
			</div> <!-- row -->
		</div> <!-- Info and references -->
#   end
        
#   if module.usage then
		<!-- Module usage-->
		<div class="col-xs-12 module-usage">
			<strong>Usage:</strong>
			<ul>
#     for usage in iter(module.usage) do
				<li>
Alexis Brenon's avatar
Alexis Brenon committed
446
					<pre><code>$(ldoc.escape(usage))</code></pre>
447
448
449
450
451
452
453
454
455
456
457
				</li>
#     end
			</ul>
		</div> <!-- Usage -->
#   end

	</header>

    
#   if need_module_nav then

Alexis Brenon's avatar
Alexis Brenon committed
458
459
460
461
462
463
<!-- *****************************************************************  -->
<!--                                                                    -->
<!--                          MODULE CONTENT                            -->
<!--                                                                    -->
<!-- *****************************************************************  -->

464
465
466
467
468
	<!-- Module content -->
	<div class="module-content">

#     for kind, items in module.kinds() do
#       local kitem = module.kinds:get_item(kind)
Alexis Brenon's avatar
Alexis Brenon committed
469
#       local has_sect_description = M(module.kinds:get_section_description(kind),nil) ~= ""
470
471
472
473
#       local has_description = kitem and ldoc.descript(kitem) ~= ""
#       local has_usage = kitem and kitem.usage and kitem.usage ~= ""

		<!-- Kind documentation -->
Alexis Brenon's avatar
Alexis Brenon committed
474
475
		<section class="card kind-section $(escape(no_spaces(kind)))-kind-section"
             id="$(escape(no_spaces(kind)))">
476
477

			<!-- Kind header -->
Alexis Brenon's avatar
Alexis Brenon committed
478
      <h3 class="card-header m-b-0">$(kind)</h3>
479

Alexis Brenon's avatar
Alexis Brenon committed
480
481
#       if has_sect_description or has_description or has_usage then
      <div class="card-block m-t-1">
Alexis Brenon's avatar
Alexis Brenon committed
482
        <span class="card-title">$(M(module.kinds:get_section_description(kind),nil))</span>
Alexis Brenon's avatar
Alexis Brenon committed
483
484
485

#         if has_description then
        <p class="card-text kind-section-description">
Alexis Brenon's avatar
Alexis Brenon committed
486
          $(M(ldoc.descript(kitem),kitem))
Alexis Brenon's avatar
Alexis Brenon committed
487
488
        </p>
#         end
489

Alexis Brenon's avatar
Alexis Brenon committed
490
491
#         if has_usage then
        <p class="card-text kind-section-usage">
492
493
          <strong>Usage:</strong>
          <pre><code>$(ldoc.prettify(kitem.usage))</code></pre>
Alexis Brenon's avatar
Alexis Brenon committed
494
495
496
497
        </p>
#         end
      </div> <!-- .card-block -->
#       end -- if has_...
498
499
500


      <!-- Kind items -->
Alexis Brenon's avatar
Alexis Brenon committed
501
      <ul class="list-group list-group-flush kind-list">
502
503

#       for item in items() do
Alexis Brenon's avatar
Alexis Brenon committed
504
        <li class="list-group-item"
Alexis Brenon's avatar
Alexis Brenon committed
505
            id="$(escape(item.name))">
Alexis Brenon's avatar
Alexis Brenon committed
506
          <div class="list-group-item-heading clearfix">
Alexis Brenon's avatar
Alexis Brenon committed
507
            <h4>$(display_name(item))</h4>
Alexis Brenon's avatar
Alexis Brenon committed
508

509
#         if ldoc.prettify_files and ldoc.is_file_prettified[item.module.file.filename] then
Alexis Brenon's avatar
Alexis Brenon committed
510
511
            <a class="float-xs-right" href="$(escape(ldoc.source_ref(item)))">
              <code>line $(escape(item.lineno))</code>
Alexis Brenon's avatar
Alexis Brenon committed
512
            </a>
513
514
#         end

Alexis Brenon's avatar
Alexis Brenon committed
515
516
517
518
519
520
          </div>

          <div class="list-group-item-text">
            <p>
              $(M(ldoc.descript(item),item))
            </p>
521
522
523
524
525

#         if ldoc.custom_tags then
#           for custom in iter(ldoc.custom_tags) do
#             local tag = item.tags[custom[1]]
#             if tag and not custom.hidden then
Alexis Brenon's avatar
Alexis Brenon committed
526
            <strong>$(custom.title or custom[1]):</strong>
Alexis Brenon's avatar
Alexis Brenon committed
527
            <ul>
528
#               for value in iter(tag) do
Alexis Brenon's avatar
Alexis Brenon committed
529
              <li>
Alexis Brenon's avatar
Alexis Brenon committed
530
                $(custom.format and custom.format(value) or M(value))
Alexis Brenon's avatar
Alexis Brenon committed
531
              </li>
532
#               end -- for
Alexis Brenon's avatar
Alexis Brenon committed
533
            </ul>
534
535
536
537
538
539
540
541
#             end -- if tag
#           end -- iter custom_tags
#         end -- if ldoc.custom_tags

#         if show_parms and item.params and #item.params > 0 then
#           local subnames = module.kinds:type_of(item).subnames

#           if subnames then
Alexis Brenon's avatar
Alexis Brenon committed
542
            <strong>$(subnames):</strong>
543
544
#           end

Alexis Brenon's avatar
Alexis Brenon committed
545
            <ul class="parameters">
546
547
548
549
550

#           for parm in iter(item.params) do
#             local param,sublist = item:subparam(parm)

#             if sublist then
Alexis Brenon's avatar
Alexis Brenon committed
551
              <li>
Alexis Brenon's avatar
Alexis Brenon committed
552
553
                <strong><code class="parameter">$(sublist)</code></strong>
                $(M(item.params.map[sublist],item))
Alexis Brenon's avatar
Alexis Brenon committed
554
                
Alexis Brenon's avatar
Alexis Brenon committed
555
                <ul class="parameters">
556
557
558
559
560
561
#             end -- if sublist

#             for p in iter(param) do
#               local name = item:display_name_of(p)
#               local tp = ldoc.typename(item:type_of_param(p))
#               local def = item:default_of_param(p)
Alexis Brenon's avatar
Alexis Brenon committed
562
                  <li>
563
#               if tp ~= '' then
Alexis Brenon's avatar
Alexis Brenon committed
564
                      <small><samp class="types">$(tp)</samp></small>
565
#               end
Alexis Brenon's avatar
Alexis Brenon committed
566
567
                    <strong><code class="parameter">$(escape(name))</code></strong>
                    <br/>
568

Alexis Brenon's avatar
Alexis Brenon committed
569
                    $(M(item.params.map[p],item))
570
571

#               if def == true then
Alexis Brenon's avatar
Alexis Brenon committed
572
                    (<em>optional</em>)
573
#               elseif def then
Alexis Brenon's avatar
Alexis Brenon committed
574
                    (<em>default</em> <code>$(escape(def))</code>)
575
576
577
#               end

#               if item:readonly(p) then
Alexis Brenon's avatar
Alexis Brenon committed
578
                    <em>readonly</em>
579
#               end
Alexis Brenon's avatar
Alexis Brenon committed
580
                  </li>
581
582
583
#             end -- for iter(param)

#             if sublist then
Alexis Brenon's avatar
Alexis Brenon committed
584
585
                </ul>
              </li>
586
587
588
#             end -- if sublist
#           end -- for param in iter params

Alexis Brenon's avatar
Alexis Brenon committed
589
            </ul>
590
591
592
593
594
595

#         end -- if show_params and...


#         if show_return and item.retgroups then
#	          local groups = item.retgroups
Alexis Brenon's avatar
Alexis Brenon committed
596
            <strong>Returns:</strong>
597
598
599

#   				for i, group in ldoc.ipairs(groups) do
#             local li,il = use_li(group)
Alexis Brenon's avatar
Alexis Brenon committed
600
            <ul class="returns">
601
602
603
604
#             for r in group:iter() do
#               local type, ctypes = item:return_type(r)
#								local rt = ldoc.typename(type)

Alexis Brenon's avatar
Alexis Brenon committed
605
              <li> 
606
#     					if rt ~= '' then
Alexis Brenon's avatar
Alexis Brenon committed
607
                <small><samp class="types">$(rt)</samp></small>
608
#     					end
Alexis Brenon's avatar
Alexis Brenon committed
609
                $(M(r.text,item))
610
611

#    						if ctypes then
Alexis Brenon's avatar
Alexis Brenon committed
612
                <ul>
613
#    						  for c in ctypes:iter() do
Alexis Brenon's avatar
Alexis Brenon committed
614
                  <li>
Alexis Brenon's avatar
Alexis Brenon committed
615
                    <span class="parameter">$(escape(c.name))</span>
Alexis Brenon's avatar
Alexis Brenon committed
616
                    <span class="types">$(ldoc.typename(c.type))</span>
Alexis Brenon's avatar
Alexis Brenon committed
617
                    $((M(c.comment,item))
Alexis Brenon's avatar
Alexis Brenon committed
618
                  </li>
619
#     						end -- for c in ctypes
Alexis Brenon's avatar
Alexis Brenon committed
620
                </ul>
621
#    						end -- if ctypes
Alexis Brenon's avatar
Alexis Brenon committed
622
              </li>
623
#     				end -- for r in group
Alexis Brenon's avatar
Alexis Brenon committed
624
            </ul>
625
626

#   					if i < #groups then
Alexis Brenon's avatar
Alexis Brenon committed
627
            <strong>Or</strong>
628
629
630
631
632
633
#   					end

#   				end -- for i, group in groups
#   			end -- if show_return and item.retgroups

#   			if show_return and item.raise then
Alexis Brenon's avatar
Alexis Brenon committed
634
635
            <strong>Raises:</strong>
            $(M(item.raise,item))
636
637
638
#   			end

#   			if item.see then
Alexis Brenon's avatar
Alexis Brenon committed
639
640
            <strong>See also:</strong>
            <ul>
641
#     			for see in iter(item.see) do
Alexis Brenon's avatar
Alexis Brenon committed
642
              <li>
Alexis Brenon's avatar
Alexis Brenon committed
643
                <a href="$(escape(ldoc.href(see)))">$(escape(see.label))</a>
Alexis Brenon's avatar
Alexis Brenon committed
644
              </li>
645
#    				end -- for see
Alexis Brenon's avatar
Alexis Brenon committed
646
            </ul>
647
648
649
#   			end -- if see

#   			if item.usage then
Alexis Brenon's avatar
Alexis Brenon committed
650
651
            <strong>Usage:</strong>
            <ul>
652
#     			for usage in iter(item.usage) do
Alexis Brenon's avatar
Alexis Brenon committed
653
              <li>
Alexis Brenon's avatar
Alexis Brenon committed
654
                <pre class="example"><code>$(ldoc.prettify(usage))</code></pre>
Alexis Brenon's avatar
Alexis Brenon committed
655
              </li>
656
#     			end -- for
Alexis Brenon's avatar
Alexis Brenon committed
657
            </ul>
658
659
#   			end -- if usage

Alexis Brenon's avatar
Alexis Brenon committed
660
661
          </div> <!-- item text -->
        </li> <!-- #item.name -->
662
663
# 			end -- for items

Alexis Brenon's avatar
Alexis Brenon committed
664
      </ul> <!-- Kind items -->
665
666
667
668
669
670
671
672
673
674
675
676
677

    </section> <!-- Kind documentation -->

# 		end -- for kind in kinds

	</div> <!-- Module content -->

# 	end -- if need_module_nav
# end -- if not ldoc.body and module

</main> <!-- Module documentation -->
</div> <!-- row -->

Alexis Brenon's avatar
Use CDN    
Alexis Brenon committed
678
    <footer class="row p-b-1">
679
680
681
682
      <div class="col-xs-12">
        <hr/>
      </div>
      <div class="col-xs-4">
Alexis Brenon's avatar
Alexis Brenon committed
683
        Generated by <a href="http://github.com/stevedonovan/LDoc">LDoc $(escape(ldoc.version))</a>
684
685
      </div>
      <div class="col-xs-4 text-center">
Alexis Brenon's avatar
Alexis Brenon committed
686
        <span class="icon icon-clock"></span>Last updated $(escape(ldoc.updatetime))
687
688
689
690
691
692
693
      </div>
      <div class="col-xs-4 text-right">
        Template and style by <a href="AlexisBRENON.github.io">AlexisBRENON</a>
      </div>
    </footer>
</div> <!-- container -->

Alexis Brenon's avatar
Use CDN    
Alexis Brenon committed
694
695
696
697
698
699
700
701
<script src="https://code.jquery.com/jquery-3.1.1.min.js"
        integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
        crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.3.7/js/tether.min.js"
        integrity="sha384-XTs3FgkjiBgo8qjEjBk0tGmf3wPrWtA6coPfQDfFEY8AnYJwjalXCiosYRBIBZX8" 
        crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.4/js/bootstrap.min.js"
        crossorigin="anonymous"></script>
702

Alexis Brenon's avatar
Use CDN    
Alexis Brenon committed
703
</body>
704
705
706
</html>