Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
lipp committed Jan 27, 2016
1 parent 119ae94 commit 2b282f1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/models/doclet.js
Expand Up @@ -58,10 +58,10 @@ docletSchema.statics.createFromGitHubEvent = function (event, data, done) {
_.each(obj, function (value, key) {
doclet.set(key, value)
})
doclet.save(done)
} else if (err || !doclet) {
new Doclet(obj).save(done)
doclet = new Doclet(obj)
}
doclet.save(done)
})
}

Expand Down
2 changes: 1 addition & 1 deletion lib/view-params.js
Expand Up @@ -133,7 +133,7 @@ module.exports.getArticleParams = function (doclet, article) {
article = _.findWhere(data.articles, {
id: article
})
var html = structure.buildArticleHtml(article, doclet.repo.url, doclet.version)
var html = structure.buildArticleHtml(article, doclet._repo && doclet._repo.url, doclet.version)
return {
tree: structure.tree(data.doclets),
childs: structure.childs,
Expand Down
6 changes: 5 additions & 1 deletion views/details.jade
Expand Up @@ -81,6 +81,9 @@ mixin details(doclet)
if doclet.returns && doclet.returns.length > 0
h4 Returns:
+paramsList(doclet.returns)
if doclet.properties
h4 Properties:
+paramsList(doclet.properties)
if doclet.examples
+examples(doclet.examples)
if doclet.see
Expand Down Expand Up @@ -131,7 +134,8 @@ mixin doclet(doclet)
+title(doclet, id)
+infolist(doclet)
+details(doclet)
//p= JSON.stringify(doclet)
//if doclet.kind == 'event'
p= JSON.stringify(doclet)
mixin module(module)
h2.modulename(id=module.longname)
Expand Down

0 comments on commit 2b282f1

Please sign in to comment.