Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/helpers/kss/application_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'ostruct'

module Kss
module ApplicationHelper
# Generates a styleguide block. A little bit evil with @_out_buf, but
Expand All @@ -15,5 +17,11 @@ def styleguide_block(section, &block)
content = capture(&block)
render 'kss/shared/styleguide_block', :section => @section, :example_html => content
end

def styleguide_entry(section)
@section = styleguide.section(section)
@section = OpenStruct.new({section: section}) unless @section.raw
render 'kss/shared/styleguide_entry', :section => @section
end
end
end
13 changes: 13 additions & 0 deletions app/views/kss/shared/_styleguide_entry.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div class="styleguide-example<%= unless section.raw then ' pending' end %>">
<% if section.raw %>
<h3><%= section.section %> <em><%= section.filename %></h3>
<div class="styleguide-description">
<%= section.description %>
</div>
<% else %>
<h3><%= section.section %></h3>
<p>
Section <%= section.section %> has not yet been created. Please add documentation for this section.
</p>
<% end %>
</div>