%html %head %meta(charset="utf-8") %meta(content="IE=edge,chrome=1" http-equiv="X-UA-Compatible") %title= class_name - if dev %link(href="/stylesheets/spacedocs/docs.css" media="screen, projection" rel="stylesheet" type="text/css") - else %link(href="/assets/spacedocs/docs.css" media="screen, projection" rel="stylesheet" type="text/css") %script(src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript") %body %pre %nav -class_names.each do |doc_class| - name = doc_class.gsub('#', '') -if doc_class == class_name %a.active(href="#{name}.html")= name -else %a(href="#{name}.html")= name - if method_list.length > 0 %section.method_list %h3= "#{class_name} Methods" .methods -method_list.sort.each do |method_name| %a(href="#{class_name}.html##{method_name}")= method_name .documentation -if class_summary %h1= "#{class_name} Summary" .description %section.summary = class_summary['description']['summary'] %section.usage %h3 Usage = class_summary['description']['body'] %hr -if methods.first -methods.keys.sort.each do |method_name| - method_data = methods[method_name] %a(name="#{method_name}") / TODO make sure method_data isn't nil - if method_data && method_data.first %h1= "#{class_name}#{method_name}(#{method_data['parameters'].keys.join ', '})" .description %section.summary= method_data['summary'] %section.usage %h3 Usage = preserve(method_data['code_sample']) - if method_data['parameters'].keys.length > 0 %section.parameters %h3 Parameters %ul - method_data['parameters'].each_pair do |param_name, param_data| %li %span.param_name= param_name = " - " %span.param_description= param_data['description'] -if method_data['returns'] %section.returns %h3 Returns %p Type: %a(href="#{method_data['returns']['type']}.html")= method_data['returns']['type'] %p.return_description= method_data['returns']['description'] %section.source %h3 Source %a.toggle_source Toggle %pre %code = preserve(method_data['source']) %hr :javascript $(function() { $(".documentation").on("click", ".toggle_source", function(e) { e.preventDefault(); return $(this).next().toggle(); }); return $("code.run").each(function() { var canvas, codeElement, compiledJs, source; codeElement = $(this); source = codeElement.text(); compiledJs = CoffeeScript.compile(source, { bare: true }); canvas = $("").pixieCanvas(); codeElement.after(canvas); return eval(compiledJs); }); });