Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Include raw HTML at the end of each styleguide block to demonstrate i…

…ntended markup
  • Loading branch information...
commit 92cef6faea4d99b17bc6e6dfda4aa4c1c9069c68 1 parent 86d7e30
@begriffs begriffs authored
View
3  example/app.rb
@@ -17,6 +17,7 @@
def styleguide_block(section, &block)
@section = @styleguide.section(section)
@example_html = capture{ block.call }
+ @escaped_html = ERB::Util.html_escape @example_html
@_out_buf << erb(:_styleguide_block)
end
@@ -29,4 +30,4 @@ def capture(&block)
ensure
@_out_buf = out
end
-end
+end
View
5 example/public/stylesheets/layout.css
@@ -136,5 +136,8 @@ h1.styleguide {
font-size: 12px;
font-weight: normal;
color: #222; }
+ .styleguide-example > .styleguide-code {
+ font-family: Monaco, monospace;
+ }
-/* @end */
+/* @end */
View
3  example/views/_styleguide_block.erb
@@ -20,5 +20,6 @@
<%= @example_html.sub('$modifier_class', " #{modifier.class_name}") %>
</div>
<% end %>
+ <pre class="styleguide-code"><%= @escaped_html %></pre>
-</div>
+</div>
Please sign in to comment.
Something went wrong with that request. Please try again.