helphelp 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/output.rb +21 -5
  2. data/lib/version.rb +1 -1
  3. metadata +4 -4
data/lib/output.rb CHANGED
@@ -154,9 +154,13 @@ extension."
154
154
  def render_content
155
155
  @out = ""
156
156
 
157
+ on "<div class=\"content page-#{@page.file_basename}\">"
158
+
157
159
  doc = Maruku.new @page.content
158
- o doc.to_html
160
+ on doc.to_html
159
161
 
162
+ on "</div>"
163
+
160
164
  @out
161
165
  end
162
166
 
@@ -172,15 +176,27 @@ extension."
172
176
  def render_toc_section parent_page
173
177
  on "<ul>"
174
178
  parent_page.children.each do |page|
175
- if parent_page == @root_page
176
- o "<li>"
177
- else
178
- o "<li class=\"sub-item\">"
179
+ item_classes = []
180
+
181
+ if parent_page != @root_page
182
+ item_classes.push "sub-item"
179
183
  end
184
+
180
185
  title = page.title
181
186
  if page.has_children?
182
187
  title += " >"
188
+ item_classes.push "has-children"
189
+ if page == @page
190
+ item_classes.push "expanded"
191
+ end
183
192
  end
193
+
194
+ if item_classes.empty?
195
+ o "<li>"
196
+ else
197
+ o "<li class=\"#{item_classes.join " "}\">"
198
+ end
199
+
184
200
  if page == @page
185
201
  o "<span class=\"current-page\">#{title}</span>"
186
202
  else
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Helphelp
2
2
 
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
 
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: helphelp
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Cornelius Schumacher
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-07-17 00:00:00 +02:00
18
+ date: 2012-07-18 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency