Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

rough api documentation viewer

  • Loading branch information...
commit 250b55b23210a00294336294099706d388f48858 1 parent 1e84581
@collin authored
View
2  Rakefile
@@ -72,7 +72,7 @@ end
desc "Create json document object"
task :doc do
- puts "Building Alpha Simprini Docs"
+ puts "Building Alpha Simprini Docs".blue
doc_build.invoke
done
end
View
2  docs/AlphaSimprini-docs.js
1 addition, 1 deletion not shown
View
51 docs/doc.js
@@ -29,8 +29,14 @@
classes = $("#classes");
classdocs = $("#classdocs");
each([Pathology.Object].concat(Pathology.Object.descendants), function(klass) {
- var classArticle;
+ var classArticle, name, _i, _len, _ref;
classes.append("<a href=\"#" + (klass.path()) + "\">" + (klass.path()) + "</a>");
+ _ref = klass.instanceMethods || [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ name = _ref[_i];
+ if (klass.instanceMethod(name).definedOn !== klass.path()) continue;
+ classes.append("<a href=\"#" + (klass.path()) + ".instanceMethod." + name + "\">#" + name + "</a>");
+ }
classArticle = function() {
return article({
id: this.klass.path()
@@ -40,34 +46,38 @@
nav({
"class": 'ancestors'
}, function() {
- var ancestor, index, _len, _ref, _results;
- _ref = this.klass.ancestors;
- _results = [];
- for (index = 0, _len = _ref.length; index < _len; index++) {
- ancestor = _ref[index];
+ var ancestor, index, _j, _len2, _len3, _ref2, _ref3, _results;
+ _ref2 = this.klass.ancestors.slice(0, -1);
+ for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
+ ancestor = _ref2[_j];
if (ancestor === this.klass) continue;
a({
href: "#" + (ancestor.path())
}, function() {
return ancestor.path();
});
- if (index !== this.klass.ancestors.length - 1) {
- _results.push(text(" < "));
- } else {
- _results.push(void 0);
- }
+ text(" < ");
+ }
+ _ref3 = this.klass.ancestors.slice(-1);
+ _results = [];
+ for (index = 0, _len3 = _ref3.length; index < _len3; index++) {
+ ancestor = _ref3[index];
+ _results.push(a({
+ href: "#" + (ancestor.path())
+ }, function() {
+ return ancestor.path();
+ }));
}
return _results;
});
h2("Class Methods");
ul(function() {
- var method, name, _i, _len, _ref, _results;
- _ref = this.klass.classMethods || [];
+ var method, name, _j, _len2, _ref2, _results;
+ _ref2 = this.klass.classMethods || [];
_results = [];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- name = _ref[_i];
+ for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
+ name = _ref2[_j];
if (!(method = this.klass.classMethod(name))) continue;
- if (method.definedOn !== this.klass.path()) continue;
_results.push(li({
id: this.klass.path() + ".classMethod." + name
}, function() {
@@ -89,13 +99,12 @@
});
h2("Instance Methods");
return ul(function() {
- var method, name, _i, _len, _ref, _results;
- _ref = this.klass.instanceMethods || [];
+ var method, name, _j, _len2, _ref2, _results;
+ _ref2 = this.klass.instanceMethods || [];
_results = [];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- name = _ref[_i];
+ for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
+ name = _ref2[_j];
if (!(method = this.klass.instanceMethod(name))) continue;
- if (method.definedOn !== this.klass.path()) continue;
_results.push(li({
id: this.klass.path() + ".instanceMethod." + name
}, function() {
View
37 docs/index.html
@@ -15,14 +15,51 @@
<script type="text/javascript" src="doc.js"></script>
<link rel="stylesheet" type="text/css" href="docco.css">
<style type="text/css">
+ * { box-sizing: border-box; }
+
+ body {
+ font-family: Helvetica;
+ }
+
+ #classes {
+ width: 300px;
+ display: block;
+ position: absolute;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ overflow: scroll;
+ background-color: #dedede;
+ }
+
#classes a {
display: block;
}
+ #classdocs {
+ position: absolute;
+ top: 0;
+ left: 300px;
+ right: 0;
+ bottom: 0;
+ overflow: scroll;
+ margin-left: 50px;
+ }
+
+ #search {
+ padding: 10px;
+ }
+
+ #search input {
+ width: 100%;
+ }
</style>
</head>
<body>
<nav id="classes">
+ <section id="search">
+ <input type="search" placeholder="Filter">
+ </section>
</nav>
<section id="classdocs">
View
16 src/doc.coffee
@@ -21,23 +21,31 @@ jQuery ->
classes.append """
<a href="##{klass.path()}">#{klass.path()}</a>
"""
+ for name in klass.instanceMethods or []
+ continue unless klass.instanceMethod(name).definedOn is klass.path()
+ classes.append """
+ <a href="##{klass.path()}.instanceMethod.#{name}">##{name}</a>
+ """
classArticle = -> article id: @klass.path(), ->
h1 @klass.path()
h2 "Ancestors"
nav class:'ancestors', ->
- for ancestor, index in @klass.ancestors
+ for ancestor in @klass.ancestors[..-2]
continue if ancestor is @klass
a href:"##{ancestor.path()}", -> ancestor.path()
- text " < " unless index is @klass.ancestors.length - 1
+ text " < "
+
+ for ancestor, index in @klass.ancestors[-1..]
+ a href:"##{ancestor.path()}", -> ancestor.path()
h2 "Class Methods"
ul ->
for name in @klass.classMethods or []
continue unless method = @klass.classMethod(name)
- continue unless method.definedOn is @klass.path()
+ # continue unless method.definedOn is @klass.path()
li id: @klass.path() + ".classMethod." + name, ->
h1 method.name
span class:"private", -> "private api" if method.private
@@ -49,7 +57,7 @@ jQuery ->
ul ->
for name in @klass.instanceMethods or []
continue unless method = @klass.instanceMethod(name)
- continue unless method.definedOn is @klass.path()
+ # continue unless method.definedOn is @klass.path()
li id: @klass.path() + ".instanceMethod." + name, ->
h1 method.name
span class:"private", -> "private api" if method.private
Please sign in to comment.
Something went wrong with that request. Please try again.