jsdoc: Change the way the package-classes list is rendered by using nested <ul> tags, and have Global Scope appear outside of a nested list.

This commit is contained in:
Jürg Lehni 2011-06-08 15:52:32 +01:00
parent 39380b4c87
commit 75da343022
3 changed files with 17 additions and 12 deletions

View file

@ -1,5 +1,5 @@
var classLayout = {
'Paper.js': ['Global Scope:_global_'],
'_global_': ['Global Scope:_global_'],
'Basic Types': ['Point', 'Size', 'Rectangle', 'Matrix'],
'Items': ['Item', 'Layer', 'Group', 'Raster', 'PlacedSymbol'],
'Paths': ['Path', 'CompoundPath', 'Segment', 'Curve', 'PathStyle', 'ruler',

View file

@ -331,6 +331,8 @@ var Render = new function() {
classes: function() {
// TODO: Use a template instead?
var renderMode = publish.conf.renderMode;
var out = '<ul class="package-classes">';
load(JSDOC.opt.t + 'classLayout.js');
function parseClassNames(classNames) {
var out = '';
@ -347,6 +349,7 @@ var Render = new function() {
}
return out;
}
function getLink(name) {
var link = name;
if (name.indexOf(':') > 0) {
@ -364,16 +367,22 @@ var Render = new function() {
function getHeading(title) {
return '<li><h3>' + title + '</h3></li>\n';
}
var first = true,
out = '<ul class="package-classes">';
var first = true;
for (var i in classLayout) {
out += '<li' + (first ? ' class="first">' : '>');
out += '<h2>' + i + '</h2></li>\n';
if (i != '_global_') {
out += '<li' + (first ? ' class="first">' : '>\n');
out += '<h2>' + i + '</h2>\n';
out += '<ul>\n';
}
out += parseClassNames(classLayout[i]);
if (i != '_global_') {
out += '</ul>\n';
}
first = false;
}
out += '</ul>';
return out;
return out + '</ul>';
},
index: function(html) {
return templates.index.process(html);

View file

@ -114,14 +114,10 @@ ul.package-classes {
padding-bottom: 4px;
}
.package-classes li {
.package-classes ul {
margin-left: 10px;
}
.package-classes li h2 {
margin-left: -10px;
}
.reference h2 a {
font-weight: bold;
}