Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adjust the indexer to print out strobe-guide headers

  • Loading branch information...
commit 7ff669994711e9f4845f2c06bd29990b949b603a 1 parent a837a2a
@indirect indirect authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/guides/indexer.rb
View
5 lib/guides/indexer.rb
@@ -36,10 +36,11 @@ def process(string, current_level=3, counters=[1])
# This is needed. Go figure.
return level_hash
elsif level == current_level
- index = counters.join(".")
+ index = counters.dup
+ index[0] = sprintf('%02d', index[0])
idx ||= '#' + title_to_idx(title)
- raise "Parsing Fail" unless @result.sub!(s.matched, "h#{level}(#{idx}). #{index} #{title}")
+ raise "Parsing Fail" unless @result.sub!(s.matched, "h#{level}(#{idx}). <span class='header_index'>#{index.join('.')}.</span> #{title}")
key = {
:title => title,
Please sign in to comment.
Something went wrong with that request. Please try again.