Permalink
Browse files

make documentation less ugly

  • Loading branch information...
1 parent fb1a175 commit 55529d82215cb3e3f20ee94692c267811e983e17 @bryanlarsen committed Mar 10, 2009
Showing with 65 additions and 27 deletions.
  1. +59 −25 lib/doc_generator.dryml
  2. +6 −2 lib/render.rake
View
@@ -10,36 +10,70 @@
<% } %>
</ul>
</def>
+
+<def tag="tag-link" attrs="link, content">
+ <li>
+ <a href="##{link}">
+ <span>
+ <%= content %>
+ </span>
+ </a>
+ </li>
+</def>
<html>
+ <head>
+ <link type="text/css" href="stylesheets/themes/smoothness/ui.all.css" rel="stylesheet" />
+ <script type="text/javascript" src="javascripts/jquery-1.3.2.min.js"></script>
+ <script type="text/javascript" src="javascripts/jquery-ui-1.7.custom.min.js"></script>
+ <script type="text/javascript">
+ jQuery(document).ready(function(){
+ jQuery("#tabs-top").tabs();
+ jQuery(".taglib").tabs();
+ jQuery(".source").accordion({collapsible: true, active: false, autoHeight: false });
+ });
+ </script>
+ </head>
<body>
- <p> This is the automatically generated documentation for
- hobo-contrib. If you want to help make it prettier, edit
- doc_generator.dryml. </p>
-
-
- <!-- unfortunately, <repeat> is problematic here -->
- <% this.each {|taglib| %>
- <h1><%= taglib.name %>.dryml</h1>
- <%= taglib.comment_html %>
- <% taglib.tag_defs.each {|tag| %>
-
- <h2><%= tag.name %></h2>
-
- <%= tag.comment_intro_html %>
-
- <% if !tag.parameters.empty? %>
- <h3>Parameters</h3>
- <param-list with="&tag.parameters"/>
- <% end %>
-
- <%= tag.comment_rest_html %>
-
- <h3>Source</h3>
- <pre><code><%= h tag.source %></code></pre>
+ <div id="tabs-top">
+ <ul>
+ <% this.each {|taglib| %>
+ <tag-link content="&taglib.name" link="#{taglib.name}-taglib"/>
+ <% } %>
+ </ul>
+ <!-- unfortunately, <repeat> is problematic here -->
+ <% this.each {|taglib| %>
+ <div class="taglib" id="#{taglib.name}-taglib">
+ <%= taglib.comment_html %>
+ <ul>
+ <% taglib.tag_defs.each {|tag| %>
+ <tag-link content="&tag.name" link="#{tag.name}-tag"/>
+ <% } %>
+ </ul>
+ <% taglib.tag_defs.each {|tag| %>
+ <div id="#{tag.name}-tag">
+
+ <h2><%= tag.name %></h2>
+
+ <%= tag.comment_intro_html %>
+
+ <% if !tag.parameters.empty? %>
+ <h3>Parameters</h3>
+ <param-list with="&tag.parameters"/>
+ <% end %>
+
+ <%= tag.comment_rest_html %>
+ <div class="source">
+ <h3><a href="#">Source</a></h3>
+ <pre><code><%= h tag.source %></code></pre>
+ </div>
+
+ </div>
+ <% } %>
+ </div>
<% } %>
- <% } %>
+ </div>
</body>
</html>
View
@@ -6,11 +6,15 @@
desc "generate documentation"
file "../hobo-contrib-gh-pages/documentation.html" => ["#{RAILS_ROOT}/app/views/taglibs/doc_generator.dryml", :environment]+Dir["#{RAILS_ROOT}/../hobo-contrib/taglibs/**/*.dryml"] do |t|
- taglibs = Dir["#{RAILS_ROOT}/../hobo-contrib/taglibs/**/*.dryml"].map {|filename|
+
+ require 'maruku'
+
+ taglibs = Dir["#{RAILS_ROOT}/../hobo-contrib/taglibs/**/*.dryml"].reject {|filename|
+ File.basename(filename).match(/^hobo-contrib-.*/)
+ }.map {|filename|
Hobo::Dryml::DrymlDoc::Taglib.new("#{RAILS_ROOT}/../hobo-contrib/taglibs", filename)
}
- require 'maruku'
src = open(t.prerequisites.first).read
locals = []
imports = []

0 comments on commit 55529d8

Please sign in to comment.