coursegen 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b5302d4918cee33e02435651e809544e0b932766
4
- data.tar.gz: a3568fad7c15ef731efb57d1f71da15e37744de0
3
+ metadata.gz: 2320b5918cf59b1c0833aaece857f0877c7f23fe
4
+ data.tar.gz: f43633199e8da954aa8248f98cd40e329834a5d9
5
5
  SHA512:
6
- metadata.gz: 85fdd418e7c3951b205b7d12c629eb4ceb9f7101ef8de9e3f16e1c8fb45575dbdf04ae78a8f247bcc8de25df05b70b59be20fa241db5753fffc359f5b5d2d97d
7
- data.tar.gz: d7986dd2bc6b4f59ecff147407f89820312f28d070d490caaa8b02cbac3e8670f475a3ff779a906774403e12894e5198c453ca3c4f1991ac5fe7c5c150897d60
6
+ metadata.gz: 668c3ad6ca1d5a49fb4917e0272f09f5ed6d685be8bdd16c439c5aa2ba4874c7f704d09e3f093bdb62bbe1a50388d60f77ec04f823a40f88d68e13ad4f7e165b
7
+ data.tar.gz: d66bd04b7100b1ee763a7a848343b66a4ecd400b7c9a6c29149f2223cb6bfce9f55a9c0ed6177644b938ce6edfa75e365ff1c6fe8ae162c8b5b1fe14afce84b6
@@ -61,6 +61,12 @@ class Toc
61
61
  section
62
62
  end
63
63
 
64
+ def section_def selector
65
+ matching_defs = @section_config.select { |sd| sd.selector == selector}
66
+ fail "Invalid selector used in section_def" if matching_defs.length != 1
67
+ matching_defs.first
68
+ end
69
+
64
70
 
65
71
  def find_next_forn(nitem)
66
72
  p = find_next_for(n2c(nitem))
@@ -0,0 +1,2 @@
1
+ puts "hello" +
2
+ "goodbye"
@@ -4,6 +4,11 @@ module NavigationHelpers
4
4
  link_to_section :lectures, item_symbol
5
5
  end
6
6
 
7
+ def link_to_next_lecture
8
+ the_item = Toc.instance.find_next_forn(@item)
9
+ link_to(the_item.title, the_item.identifier)
10
+ end
11
+
7
12
  def link_to_topic item_symbol
8
13
  link_to_section :topics, item_symbol
9
14
  end
@@ -1,6 +1,7 @@
1
1
  module SidebarHelpers
2
2
  def section_helper title:nil, selector:nil
3
3
  sect = Toc.instance.section(selector)
4
+ @sect_def = Toc.instance.section_def(selector)
4
5
  str = "<li>
5
6
  <label class=\"tree-toggler level1\">
6
7
  #{collapsed_indicator(sect.collapsed?)}
@@ -42,7 +43,8 @@ module SidebarHelpers
42
43
  end
43
44
 
44
45
  def subsection_item_link tree_node
45
- "<li class=\"#{tree_node.content.css_class}\"><a href=\"#{tree_node.content.path}\">#{tree_node.content.title}</a></li>"
46
+ bullet = @sect_def.options[:bullet]
47
+ "<li class=\"#{tree_node.content.css_class}\">#{icon_markup(bullet)}<a href=\"#{tree_node.content.path}\">#{tree_node.content.title}</a></li>"
46
48
  end
47
49
 
48
50
  def flat_section sect
@@ -53,11 +55,15 @@ module SidebarHelpers
53
55
  end
54
56
 
55
57
  def flat_section_item_link citem
56
- "<li class=\"#{citem.css_class}\"><a href=\"#{citem.path}\">#{citem.title}</a></li>"
58
+ bullet = @sect_def.options[:bullet]
59
+ "<li class=\"#{citem.css_class}\">#{icon_markup(bullet)}<a href=\"#{citem.path}\">#{citem.title}</a></li>"
57
60
  end
58
61
 
59
62
  def icon_markup icon_type
60
- css_class = {star: "glyphicon-star", plus: "glyphicon-plus-sign", minus: "glyphicon-minus-sign"}.fetch(icon_type)
61
- "<span class=\"glyphicon #{css_class} glyphicon-small \"></span>"
63
+ return "" if icon_type.nil?
64
+ css_class = {dash: "glyphicon-minus", star: "glyphicon-star", plus: "glyphicon-plus-sign", minus: "glyphicon-minus-sign"}.fetch(icon_type)
65
+ "<span class=\"glyphicon #{css_class}\" style=#{STYLING_CONFIG[:bullet_style]}></span>"
62
66
  end
67
+
68
+
63
69
  end
@@ -1,3 +1,3 @@
1
1
  module Coursegen
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coursegen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pito Salas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-02 00:00:00.000000000 Z
11
+ date: 2014-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -219,6 +219,7 @@ files:
219
219
  - lib/coursegen/course/data/toc.rb
220
220
  - lib/coursegen/course/helpers/bootstrap_markup.rb
221
221
  - lib/coursegen/course/helpers/content_helpers.rb
222
+ - lib/coursegen/course/helpers/deleteme.rb
222
223
  - lib/coursegen/course/helpers/lecture_helpers.rb
223
224
  - lib/coursegen/course/helpers/list_of.rb
224
225
  - lib/coursegen/course/helpers/list_of_helpers.rb