|
|
|
@ -52,15 +52,26 @@ glob(match, function(er, files){ |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
var output = "<!DOCTYPE html>\n<html>\n<head>\n<script type=\"text/javascript\" src=\"//highlightjs.org/static/highlight.pack.js\">\n</script>\n<script type=\"text/javascript\">\ndocument.addEventListener(\"DOMContentLoaded\", function(){hljs.initHighlightingOnLoad();});</script>\n<link rel=\"stylesheet\" href=\"//highlightjs.org/static/styles/github.css\" />\n<link rel=\"stylesheet\" href=\"/styles.css\" />\n</head>\n<body>\n"; |
|
|
|
output += "<ul>\n"; |
|
|
|
var output = "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n"; |
|
|
|
output += "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n"; |
|
|
|
output += "<script type=\"text/javascript\" src=\"//highlightjs.org/static/highlight.pack.js\">\n</script>\n<script type=\"text/javascript\">\ndocument.addEventListener(\"DOMContentLoaded\", function(){hljs.initHighlightingOnLoad();});</script>\n"; |
|
|
|
output += "<link rel=\"stylesheet\" href=\"//highlightjs.org/static/styles/github.css\" />\n"; |
|
|
|
output += "<link rel=\"stylesheet\" href=\"//getbootstrap.com/dist/css/bootstrap.min.css\" />\n"; |
|
|
|
output += "</head>\n<body>\n"; |
|
|
|
output += "<a class=\"btn btn-default\" href=\"#top\" style=\"position:fixed;bottom:1rem;right:1rem;z-index:100000;color:#000\">Jump To Top</a>\n"; |
|
|
|
output += "<div id=\"top\" class=\"container-fluid\">\n"; |
|
|
|
output += "<div class=\"row\">\n"; |
|
|
|
output += "<div class=\"col-sm-12\">\n"; |
|
|
|
output += "<h1>Node Dogapi</h1>\n"; |
|
|
|
output += "<ul class=\"nav nav-pills\">\n"; |
|
|
|
for(var section in docs){ |
|
|
|
if(!docs.hasOwnProperty(section)){ |
|
|
|
continue; |
|
|
|
} |
|
|
|
output += "<li><a href=\"#" + section + "\">" + section + "</a></li>\n"; |
|
|
|
output += "<li role=\"\"><a href=\"#" + section + "\">" + section + "</a>\n"; |
|
|
|
output += "</li>\n"; |
|
|
|
} |
|
|
|
output += "</ul>\n"; |
|
|
|
output += "</ul>\n</div>\n</div>\n"; |
|
|
|
|
|
|
|
for(var section in docs){ |
|
|
|
if(!docs.hasOwnProperty(section)){ |
|
|
|
@ -68,8 +79,19 @@ glob(match, function(er, files){ |
|
|
|
} |
|
|
|
methods = docs[section]; |
|
|
|
|
|
|
|
output += "<section id=\"" + section + "\">\n"; |
|
|
|
output += "<h2>" + section + "</h2>\n"; |
|
|
|
output += "<section id=\"" + section + "\" class=\"col-sm-12\">\n"; |
|
|
|
output += "<div class=\"row\">\n<h2 class=\"bg-primary\" style=\"text-indent:1rem\">" + section + "</h2></div>\n"; |
|
|
|
|
|
|
|
output += "<ul class=\"nav nav-pills\">\n"; |
|
|
|
for(var name in methods){ |
|
|
|
if(!methods.hasOwnProperty(name)){ |
|
|
|
continue; |
|
|
|
} |
|
|
|
output += "<li role\"presentation\"><a href=\"#" + section + "-" + name + "\">" + name + "</a></li>\n"; |
|
|
|
} |
|
|
|
|
|
|
|
output += "</ul>\n"; |
|
|
|
|
|
|
|
for(var name in methods){ |
|
|
|
if(!methods.hasOwnProperty(name)){ |
|
|
|
continue; |
|
|
|
@ -77,33 +99,42 @@ glob(match, function(er, files){ |
|
|
|
doc = methods[name]; |
|
|
|
|
|
|
|
var className = section + "-" + name; |
|
|
|
output += "<div class=\"function\" id=\"" + className + "\">\n"; |
|
|
|
output += "<div class=\"function row\" id=\"" + className + "\">\n"; |
|
|
|
|
|
|
|
var definition = name + "("; |
|
|
|
if(doc.params && typeof doc.params === "object"){ |
|
|
|
definition += Object.keys(doc.params).join(", "); |
|
|
|
} |
|
|
|
definition += ")"; |
|
|
|
|
|
|
|
output += "<h3>" + name + "</h3>\n"; |
|
|
|
output += "<div class=\"container\">\n"; |
|
|
|
output += "<div class=\"doc\">\n"; |
|
|
|
output += "<h3 class=\"bg-info\" style=\"text-indent:.5rem;padding:.5rem;margin-top:.5rem\">" + definition + "</h3>\n"; |
|
|
|
output += "<div class=\"col-md-6\">\n"; |
|
|
|
output += doc.comment; |
|
|
|
output += "<h4>Parameters:</h4>\n"; |
|
|
|
for(var param in doc.params){ |
|
|
|
if(!doc.params.hasOwnProperty(param)){ |
|
|
|
continue; |
|
|
|
if(doc.params){ |
|
|
|
output += "<h4>Parameters:</h4>\n"; |
|
|
|
output += "<dl>\n"; |
|
|
|
for(var param in doc.params){ |
|
|
|
if(!doc.params.hasOwnProperty(param)){ |
|
|
|
continue; |
|
|
|
} |
|
|
|
var comment = doc.params[param]; |
|
|
|
output += "<dt>" + param + "</dt>\n"; |
|
|
|
output += "<dd>" + comment + "</dd>\n"; |
|
|
|
} |
|
|
|
var comment = doc.params[param]; |
|
|
|
output += "<h5>" + param + "</h5>\n"; |
|
|
|
output += comment; |
|
|
|
output += "</dl>\n"; |
|
|
|
} |
|
|
|
output += "</div>\n"; |
|
|
|
|
|
|
|
output += "<div class=\"example\">\n"; |
|
|
|
output += "<div class=\"col-md-6\">\n"; |
|
|
|
output += doc.example; |
|
|
|
output += "</div>\n"; |
|
|
|
|
|
|
|
output += "</div>\n"; |
|
|
|
output += "</div>\n"; |
|
|
|
|
|
|
|
} |
|
|
|
output += "</section>\n"; |
|
|
|
} |
|
|
|
output += "</div>\n"; |
|
|
|
output += "<a href=\"https://github.com/brettlangdon/node-dogapi\"><img style=\"position: absolute; top: 0; right: 0; border: 0;\" src=\"https://camo.githubusercontent.com/a6677b08c955af8400f44c6298f40e7d19cc5b2d/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677261795f3664366436642e706e67\" alt=\"Fork me on GitHub\" data-canonical-src=\"https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png\"></a>"; |
|
|
|
output += "</body></html>"; |
|
|
|
console.log(output); |
|
|
|
}); |