coursegen 0.0.9 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2320b5918cf59b1c0833aaece857f0877c7f23fe
|
4
|
+
data.tar.gz: f43633199e8da954aa8248f98cd40e329834a5d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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))
|
@@ -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
|
-
|
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
|
-
|
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
|
-
|
61
|
-
"
|
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
|
data/lib/coursegen/version.rb
CHANGED
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
|
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-
|
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
|