lib/sinatra/docs/collection.haml in sinatra-rabbit-1.0.11 vs lib/sinatra/docs/collection.haml in sinatra-rabbit-1.1.0
- old
+ new
@@ -1,24 +1,56 @@
%html
%head
+ %style{:type => 'text/css'}=css
%body
- %h1=@collection.name.gsub('Sinatra::Rabbit::', '')
- %blockquote=@collection.description
- .url=@collection.full_path
- .features
- - @collection.features.each do |f|
- %p.feature=f.name
- %table.operations
- %thead
- %tr
- %th Name
- %th Type
- %th Valid values
- %th Description
- %tbody
- - @collection.operations.each do |o|
+ %ul.breadcrumb.well{:style=>'margin-bottom:0;'}
+ %li
+ %a{ :href => url('/docs') } Documentation
+ %span.divider='/'
+ %li.active=collection.collection_name.to_s.split('_').map {|p| p.capitalize}.join(' ')
+ .container
+ %h1.pull-right=collection.collection_name.to_s.split('_').map {|p| p.capitalize}.join(' ')
+ %blockquote.clearfix
+ %p{ :style => 'width : 400px;font-size:small;padding-top:1em;'}
+ =collection.description || 'Collection does not have description set'
+ - if !collection.features.empty?
+ %h3 Features
+ %table.table.table-bordered
+ %thead
+ %tr
+ %th Name
+ %th Constraints
+ %th Description
+ %tbody
+ - collection.features.each do |f|
+ %tr
+ %td=f.name
+ %td
+ - f.constraints.each do |c, v|
+ ="#{c}=#{v}<br/>"
+ %td
+ %small=f.description
+
+ %h3 Operations
+ %table.table.table-bordered
+ %thead
%tr
- %td.name
- %a{:href => o.docs_url }
- %td.method=o.http_method.to_s.upcase
- %td.url
- %a{:href=>o.full_path}=o.full_path
+ %th Name
+ %th HTTP method
+ %th URL
+ %th Description
+ %tbody
+ - collection.operations.each do |o|
+ %tr
+ %td
+ %a{:href => url(o.docs_url) }=o.operation_name
+ %td=o.http_method.to_s.upcase
+ %td
+ %a{ :href=> url(o.full_path) }=o.full_path
+ %td
+ %small=o.description
+ %footer.footer
+ .container
+ %p
+ Documentation generated by
+ %a{ :href => 'http://github.com/mifo/sinatra-rabbit'} Rabbit
+ extension.