Skip to content

Commit c24b6e6

Browse files
committed
documentation template : classes names indentation
1 parent 289b5b2 commit c24b6e6

4 files changed

Lines changed: 46 additions & 10 deletions

File tree

docs/build/docstrap-master/template/publish.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,10 @@ function buildNav( members ) {
285285
members.classes.forEach( function ( c ) {
286286
if ( !hasOwnProp.call( seen, c.longname ) ) {
287287

288-
nav.class.members.push( linkto( c.longname, c.name ) );
288+
nav.class.members.push( {
289+
link: linkto( c.longname, c.name ),
290+
depth: c.longname.split('.').length - 1
291+
} );
289292
}
290293
seen[c.longname] = true;
291294
} );
@@ -309,7 +312,10 @@ function buildNav( members ) {
309312
members.namespaces.forEach( function ( n ) {
310313
if ( !hasOwnProp.call( seen, n.longname ) ) {
311314

312-
nav.namespace.members.push( linkto( n.longname, n.name ) );
315+
nav.namespace.members.push( {
316+
link: linkto( n.longname, n.name ),
317+
depth: 0
318+
} );
313319
}
314320
seen[n.longname] = true;
315321
} );

docs/build/docstrap-master/template/static/styles/sunlight.default.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,4 +341,24 @@
341341
/* erlang */
342342
.sunlight-erlang .sunlight-atom {
343343
font-weight: bold !important;
344+
}
345+
346+
dt.class-depth-0 a,
347+
.dropdown-menu > li.class-depth-0 > a {
348+
padding-left: 0;
349+
}
350+
351+
dt.class-depth-1 a,
352+
.dropdown-menu > li.class-depth-1 > a {
353+
padding-left: 0;
354+
}
355+
356+
dt.class-depth-2 a,
357+
.dropdown-menu > li.class-depth-2 > a {
358+
padding-left: 20px;
359+
}
360+
361+
dt.class-depth-3 a,
362+
.dropdown-menu > li.class-depth-3 > a {
363+
padding-left: 40px;
344364
}

docs/build/docstrap-master/template/tmpl/container.tmpl

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,24 @@
7777

7878
<?js
7979
var classes = self.find({kind: 'class', memberof: doc.longname});
80+
8081
if (doc.kind !== 'globalobj' && classes && classes.length) {
8182
?>
8283
<h3 class="subsection-title">Classes</h3>
8384

84-
<dl><?js classes.forEach(function(c) { ?>
85-
<dt><?js= self.linkto(c.longname, c.name) ?></dt>
86-
<dd><?js if (c.summary) { ?><?js= c.summary ?><?js } ?></dd>
87-
<?js }); ?></dl>
85+
<dl>
86+
<?js classes.forEach(function(c) { ?>
87+
<?js var depth = c.memberof ? c.memberof.split('.').length : 0 ?>
88+
<dt class="class-depth-<?js= depth ?>">
89+
<?js= self.linkto(c.longname, c.name) ?>
90+
</dt>
91+
<dd>
92+
<?js if (c.summary) { ?>
93+
<?js= c.summary ?>
94+
<?js } ?>
95+
</dd>
96+
<?js }); ?>
97+
</dl>
8898
<?js } ?>
8999

90100
<?js

docs/build/docstrap-master/template/tmpl/layout.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<?js var that = this; ?>
2+
<?js var that = this;?>
33
<html lang="en">
44
<head>
55
<meta charset="utf-8">
@@ -31,8 +31,8 @@
3131

3232
<ul class="dropdown-menu <?js= that.navOptions.navType ==='inline' ? 'inline' : '' ?>">
3333
<?js entry.members.forEach(function(member){ ?>
34-
<li>
35-
<?js= member ?>
34+
<li class="class-depth-<?js= member.depth || 0 ?>">
35+
<?js= member.link ?>
3636
</li>
3737
<?js }); ?>
3838

@@ -99,7 +99,7 @@
9999
<script>
100100
$( function () {
101101
$( "#toc" ).toc( {
102-
anchorName : function(i, heading, prefix) {
102+
anchorName : function(i, heading, prefix) {
103103
return $(heading).attr("id") || ( prefix + i );
104104
},
105105
selectors : "h1,h2,h3,h4",

0 commit comments

Comments
 (0)