Permalink
Browse files

rough api documentation viewer

  • Loading branch information...
1 parent 1e84581 commit 250b55b23210a00294336294099706d388f48858 @collin committed Aug 7, 2012
Showing with 81 additions and 27 deletions.
  1. +1 −1 Rakefile
  2. +1 −1 docs/AlphaSimprini-docs.js
  3. +30 −21 docs/doc.js
  4. +37 −0 docs/index.html
  5. +12 −4 src/doc.coffee
View
@@ -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

Large diffs are not rendered by default.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -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
@@ -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

0 comments on commit 250b55b

Please sign in to comment.