Skip to content

Commit

Permalink
Hardcode modules in nav in home
Browse files Browse the repository at this point in the history
  • Loading branch information
eternauta1337 committed Mar 3, 2017
1 parent 4daf596 commit 5554bd7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
18 changes: 16 additions & 2 deletions awaydoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,25 @@ handlebars.registerHelper('newLine', function () { return '\n'; });
buildToc(model, page.toc, 0);
});

// Keep camelcase in URLs.
// Modify urls.
var origGetUrls = app.renderer.theme.getUrls;
app.renderer.theme.getUrls = function modGetURls(project) {
console.log("~awaydoc~ modifying theme.getUrls()");

var origUrls = origGetUrls.call(this, project);

// Hardcode awayjs module urls.
var modUrls = origUrls.map(function(urlMapping) {
console.log("~awaydoc~ url: " + urlMapping.url);
if(urlMapping.url.indexOf("modules/") !== -1) {
var lastUrlComp = urlMapping.url.split("modules/")[1];
var noExt = lastUrlComp.split(".html")[0];
urlMapping.url = noExt + "/index.html";
urlMapping.model.url = noExt + "/index.html";
}
return urlMapping;
});

// Reflection.getAlias() uses toLowerCase(),
// here, we state that we want the original class names as aliases.
function applyAlias(obj) {
Expand All @@ -87,7 +101,7 @@ handlebars.registerHelper('newLine', function () { return '\n'; });
}
applyAlias(project);

return origGetUrls.call(this, project);
return modUrls;
}

return success;
Expand Down
9 changes: 9 additions & 0 deletions lib/dummy.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* Dummy file needed for typedoc to compile root module.
*/
export namespace core {}
export namespace graphics {}
export namespace materials {}
export namespace parsers {}
export namespace player {}
export namespace renderer {}
export namespace scene {}
export namespace stage {}
export namespace view {}

0 comments on commit 5554bd7

Please sign in to comment.