Skip to content

Commit

Permalink
simplified (bare-bones) package display
Browse files Browse the repository at this point in the history
  • Loading branch information
lloyd committed Jan 25, 2011
1 parent 0691ffe commit 137731a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
10 changes: 10 additions & 0 deletions docs/css/packages.css
Expand Up @@ -26,4 +26,14 @@
text-decoration: none;
color: gray;
font-size: .9em;
}

.package-detail .module-name {
font-size: 1.3em;
font-weight: bold;
margin-top: 1em;
}

.package-detail .module-desc {
margin: 0 2em 0 2em;
}
1 change: 0 additions & 1 deletion docs/index.html
Expand Up @@ -127,7 +127,6 @@ <h1>Parse Error in <span class="filename"></span></h1>
</div>
<div class="package-detail">
<h1>Package &ldquo;<span class="name"></span>&rdquo;</h1>
<ul class="modules">none</ul>
</div>
<div class="guide-section">
<h1 class="name"></h1>
Expand Down
28 changes: 17 additions & 11 deletions docs/js/main.js
Expand Up @@ -362,7 +362,7 @@ function startApp(jQuery, window) {
}
var count = 0;
for (var x in libs) {
moduleName = libs[x];
var moduleName = libs[x];
var module = $('<li class="module"></li>');
var hash = "#module/" + pkg.name + "/" + moduleName;
$('<a target="_self"></a>')
Expand All @@ -382,12 +382,22 @@ function startApp(jQuery, window) {

entry.find(".name").text(name);

// XXX: we need a nice way that package level documentation can
// be included... Previously there was a README.md file that
// could be associated with packages. That seems like a fine
// thing to revive... Alternately we could introduce a tag
// for package docs? options are abundant
listModules(pkg, entry);
var libs = [];
if (pkg.modules) {
libs = sortedKeys(pkg.modules);
}
for (var x in libs) {
var moduleName = libs[x];
var n = $("<div/>").addClass("module-name").text(moduleName);
n.appendTo(entry);
linkNode(n, "#module/" + name + "/" + moduleName);

if (pkg.modules[moduleName].desc) {
$("<div/>").addClass("module-desc")
.html(converter.makeHtml(pkg.modules[moduleName].desc)).
appendTo(entry);
}
}

queueMainContent(entry, function () {
showMainContent(entry, null);
Expand Down Expand Up @@ -451,15 +461,11 @@ function startApp(jQuery, window) {
}

function linkNode(node, url) {
var p = node.parent();
node.replaceWith($('<a target="_self"></a>')
.attr("href", url)
.append(node.clone()));
}




function showAPIRef(name, context) {
if (name === 'api-by-package') {
var entry = $("#templates .package-list").clone();
Expand Down

0 comments on commit 137731a

Please sign in to comment.