diff --git a/lib/rocco/layout.rb b/lib/rocco/layout.rb index 22d1201..7b790f0 100644 --- a/lib/rocco/layout.rb +++ b/lib/rocco/layout.rb @@ -18,9 +18,15 @@ class Rocco::Layout < Mustache num = 0 @doc.sections.map do |docs,code| { - :docs => docs, - :code => code, - :num => (num += 1) + :docs => docs, + :docs? => !docs.empty?, + :header? => /^.+<\/h.>$/.match( docs ), + + :code => code, + :code? => !code.empty?, + + :empty? => ( code.empty? && docs.empty? ), + :num => (num += 1) } end end