coursegen 0.9.2 → 0.9.8

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
  SHA256:
3
- metadata.gz: f9cb3cbe909c32d021c79b9c28bb7563364d92e2469a6504c249739b7599416a
4
- data.tar.gz: 7481e0ff4afd182159ed69342ea5bc22852c37b41105c0f4b61147fdf88ae1bc
3
+ metadata.gz: 6e795fda87f36793e17eacef4c0f6215b71c737acd921470f7328e311738f5b2
4
+ data.tar.gz: 657d2df1548654f5fb29ada51658878ac5eb87e056a42c8bfd96fda31952c783
5
5
  SHA512:
6
- metadata.gz: 944004fe2d95fec10e224c42b9b0979c669b1bbe276aaba06de92d7c1e1d37ad9bb1defff4ecf662dc2669b2c5a61438211a4fa2e7ebcdc5ab48d8997fd45f3a
7
- data.tar.gz: '0268bf1102d9297e7cee57b6808e1e712df5ea79b231fbd5f6955a2594329ae80a11da95f67418a72336275ab289050c2bb8561aff9a57839d0430b467e8b983'
6
+ metadata.gz: 03a0a6ed44e0e53ad19fdd2709123efb44527f2d2928365db32f518b59971ffddbb7079f442786677ae54a4f86fc686a452b2930a14841db2fd829e00ac752d2
7
+ data.tar.gz: d3596fcd8741f91ea19b2ffcfb4c428665740ac956e9e33b12a64819421dd86c7088081bfec792ffb13a4687a021d0ef743a0c06ed6ac7db010972bf8d3f5ca6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- coursegen (0.9.2)
4
+ coursegen (0.9.8)
5
5
  activesupport
6
6
  adsf
7
7
  byebug
@@ -19,29 +19,28 @@ PATH
19
19
  GEM
20
20
  remote: https://rubygems.org/
21
21
  specs:
22
- activesupport (6.0.3.1)
22
+ activesupport (6.1.3)
23
23
  concurrent-ruby (~> 1.0, >= 1.0.2)
24
- i18n (>= 0.7, < 2)
25
- minitest (~> 5.1)
26
- tzinfo (~> 1.1)
27
- zeitwerk (~> 2.2, >= 2.2.2)
24
+ i18n (>= 1.6, < 2)
25
+ minitest (>= 5.1)
26
+ tzinfo (~> 2.0)
27
+ zeitwerk (~> 2.3)
28
28
  addressable (2.7.0)
29
29
  public_suffix (>= 2.0.2, < 5.0)
30
- adsf (1.4.3)
30
+ adsf (1.4.5)
31
31
  rack (>= 1.0.0, < 3.0.0)
32
32
  byebug (11.1.3)
33
33
  coderay (1.1.3)
34
34
  colored (1.2)
35
- concurrent-ruby (1.1.6)
36
- cri (2.15.10)
35
+ concurrent-ruby (1.1.8)
36
+ cri (2.15.11)
37
37
  ddmemoize (1.0.0)
38
38
  ddmetrics (~> 1.0)
39
39
  ref (~> 2.0)
40
40
  ddmetrics (1.0.1)
41
- ddplugin (1.0.2)
41
+ ddplugin (1.0.3)
42
42
  diff-lcs (1.4.4)
43
- equatable (0.6.1)
44
- ffi (1.13.1)
43
+ ffi (1.14.2)
45
44
  formatador (0.2.5)
46
45
  guard (2.16.2)
47
46
  formatador (>= 0.2.4)
@@ -58,41 +57,41 @@ GEM
58
57
  guard-compat (~> 1.0)
59
58
  hamster (3.0.0)
60
59
  concurrent-ruby (~> 1.0)
61
- i18n (1.8.3)
60
+ i18n (1.8.9)
62
61
  concurrent-ruby (~> 1.0)
63
- icalendar (2.6.1)
62
+ icalendar (2.7.0)
64
63
  ice_cube (~> 0.16)
65
64
  ice_cube (0.16.3)
66
65
  json (2.3.0)
67
- json_schema (0.20.8)
68
- kramdown (2.2.1)
66
+ json_schema (0.20.9)
67
+ kramdown (2.3.0)
69
68
  rexml
70
- listen (3.2.1)
69
+ listen (3.4.1)
71
70
  rb-fsevent (~> 0.10, >= 0.10.3)
72
71
  rb-inotify (~> 0.9, >= 0.9.10)
73
- lumberjack (1.2.5)
72
+ lumberjack (1.2.8)
74
73
  method_source (1.0.0)
75
- mini_portile2 (2.4.0)
76
- minitest (5.14.1)
77
- nanoc (4.11.16)
74
+ minitest (5.14.4)
75
+ nanoc (4.11.23)
78
76
  addressable (~> 2.5)
79
77
  colored (~> 1.2)
80
78
  nanoc-checking (~> 1.0)
81
- nanoc-cli (= 4.11.16)
82
- nanoc-core (= 4.11.16)
79
+ nanoc-cli (= 4.11.23)
80
+ nanoc-core (= 4.11.23)
83
81
  nanoc-deploying (~> 1.0)
84
82
  parallel (~> 1.12)
85
83
  tty-command (~> 0.8)
86
84
  tty-which (~> 0.4)
87
- nanoc-checking (1.0.0)
85
+ nanoc-checking (1.0.1)
88
86
  nanoc-cli (~> 4.11, >= 4.11.15)
89
87
  nanoc-core (~> 4.11, >= 4.11.15)
90
- nanoc-cli (4.11.16)
88
+ nanoc-cli (4.11.23)
91
89
  cri (~> 2.15)
92
90
  diff-lcs (~> 1.3)
93
- nanoc-core (= 4.11.16)
91
+ nanoc-core (= 4.11.23)
94
92
  zeitwerk (~> 2.1)
95
- nanoc-core (4.11.16)
93
+ nanoc-core (4.11.23)
94
+ concurrent-ruby (~> 1.1)
96
95
  ddmemoize (~> 1.0)
97
96
  ddmetrics (~> 1.0)
98
97
  ddplugin (~> 1.0)
@@ -102,61 +101,60 @@ GEM
102
101
  tomlrb (~> 1.2)
103
102
  tty-platform (~> 0.2)
104
103
  zeitwerk (~> 2.1)
105
- nanoc-deploying (1.0.0)
104
+ nanoc-deploying (1.0.1)
106
105
  nanoc-checking (~> 1.0)
107
106
  nanoc-cli (~> 4.11, >= 4.11.15)
108
107
  nanoc-core (~> 4.11, >= 4.11.15)
109
108
  nenv (0.3.0)
110
- nokogiri (1.10.9)
111
- mini_portile2 (~> 2.4.0)
109
+ nokogiri (1.11.1-x86_64-darwin)
110
+ racc (~> 1.4)
112
111
  notiffany (0.1.3)
113
112
  nenv (~> 0.1)
114
113
  shellany (~> 0.0)
115
- parallel (1.19.1)
116
- pastel (0.7.4)
117
- equatable (~> 0.6)
114
+ parallel (1.20.1)
115
+ pastel (0.8.0)
118
116
  tty-color (~> 0.5)
119
117
  pry (0.13.1)
120
118
  coderay (~> 1.1)
121
119
  method_source (~> 1.0)
122
- public_suffix (4.0.5)
123
- rack (2.2.2)
124
- rake (13.0.1)
120
+ public_suffix (4.0.6)
121
+ racc (1.5.2)
122
+ rack (2.2.3)
123
+ rake (13.0.3)
125
124
  rb-fsevent (0.10.4)
126
125
  rb-inotify (0.10.1)
127
126
  ffi (~> 1.0)
128
127
  ref (2.0.0)
129
- rexml (3.2.4)
130
- rspec (3.9.0)
131
- rspec-core (~> 3.9.0)
132
- rspec-expectations (~> 3.9.0)
133
- rspec-mocks (~> 3.9.0)
134
- rspec-core (3.9.2)
135
- rspec-support (~> 3.9.3)
136
- rspec-expectations (3.9.2)
128
+ rexml (3.2.3)
129
+ rspec (3.10.0)
130
+ rspec-core (~> 3.10.0)
131
+ rspec-expectations (~> 3.10.0)
132
+ rspec-mocks (~> 3.10.0)
133
+ rspec-core (3.10.1)
134
+ rspec-support (~> 3.10.0)
135
+ rspec-expectations (3.10.1)
137
136
  diff-lcs (>= 1.2.0, < 2.0)
138
- rspec-support (~> 3.9.0)
139
- rspec-mocks (3.9.1)
137
+ rspec-support (~> 3.10.0)
138
+ rspec-mocks (3.10.1)
140
139
  diff-lcs (>= 1.2.0, < 2.0)
141
- rspec-support (~> 3.9.0)
142
- rspec-support (3.9.3)
140
+ rspec-support (~> 3.10.0)
141
+ rspec-support (3.10.1)
143
142
  rubytree (1.0.0)
144
143
  json (~> 2.1)
145
144
  structured_warnings (~> 0.3)
146
145
  shellany (0.0.1)
147
146
  slow_enumerator_tools (1.1.0)
148
147
  structured_warnings (0.4.0)
149
- thor (1.0.1)
150
- thread_safe (0.3.6)
148
+ thor (1.1.0)
151
149
  tomlrb (1.3.0)
152
- tty-color (0.5.1)
153
- tty-command (0.9.0)
154
- pastel (~> 0.7.0)
150
+ tty-color (0.6.0)
151
+ tty-command (0.10.0)
152
+ pastel (~> 0.8)
155
153
  tty-platform (0.3.0)
156
154
  tty-which (0.4.2)
157
- tzinfo (1.2.7)
158
- thread_safe (~> 0.1)
159
- zeitwerk (2.3.0)
155
+ tzinfo (2.0.4)
156
+ concurrent-ruby (~> 1.0)
157
+ zeitwerk (2.4.2)
160
158
 
161
159
  PLATFORMS
162
160
  ruby
data/lib/coursegen.rb CHANGED
@@ -4,6 +4,7 @@ require 'nokogiri'
4
4
 
5
5
  require 'coursegen/version'
6
6
  require 'coursegen/course/helpers/sidebar_helpers'
7
+ require 'coursegen/course/helpers/visual_helpers'
7
8
  require 'coursegen/course/helpers/lecture_helpers'
8
9
  require 'coursegen/course/helpers/content_helpers'
9
10
  require 'coursegen/course/helpers/logging_helpers'
@@ -26,6 +27,8 @@ require 'coursegen/course/lib/ical_adaptor'
26
27
  require 'coursegen/course/helpers/list_of'
27
28
  require 'coursegen/course/helpers/ical_feed_helpers'
28
29
  require 'coursegen/course/lib/helpers_'
30
+ require 'coursegen/course/lib/nanoc_filters.rb'
31
+
29
32
 
30
33
  # Coursegen is a course curriculum site generator based on nanoc, with
31
34
  # support for sections, lectures, code examples, homeworks, course
@@ -1,5 +1,6 @@
1
1
  # ContentHelpers is used to annotate content.
2
2
  module ContentHelpers
3
+
3
4
  def include_topic(item_symbol)
4
5
  incorporated_topic = lookup_nitem('topics', item_symbol.to_s)
5
6
  items[incorporated_topic.identifier.to_s].compiled_content
@@ -50,7 +51,7 @@ module ContentHelpers
50
51
  italic_red(string)
51
52
  end
52
53
 
53
- def callout_1(title, body)
54
+ def callout1(title, body)
54
55
  <<~HTMLSTRING
55
56
  <div class="well well-sm callout">
56
57
  <span class="themebg label label-primary">#{title}</span>#{body}
@@ -58,7 +59,7 @@ module ContentHelpers
58
59
  HTMLSTRING
59
60
  end
60
61
 
61
- def callout_2(title, body)
62
+ def callout2(title, body)
62
63
  <<~HTMLSTRING
63
64
  <div class="callout border border-primary rounded p-2 m-3">
64
65
  <span class="badge badge-pill badge-primary">#{title}</span>#{body}
@@ -66,20 +67,34 @@ module ContentHelpers
66
67
  HTMLSTRING
67
68
  end
68
69
 
69
- def callout(title, body)
70
- %(<div class="jumbotron py-1 border border-primary border-rounded-lg">
71
- <h1 class="display-5">#{title}</h1>
72
- <p class="lead">#{body}</p></div>)
70
+ def callout(title, body, style=:big)
71
+ if (style == :big)
72
+ %(<div class="jumbotron py-1 border border-primary border-rounded-lg">
73
+ <h1 class="display-5">#{title}</h1>
74
+ <p class="lead">#{body}</p></div>)
75
+ elsif (style == :small)
76
+ <<~HTMLSTRING
77
+ <div class="callout border border-primary rounded p-2 m-3">
78
+ <span class="badge badge-pill badge-primary">#{title}</span>#{body}
79
+ </div>
80
+ HTMLSTRING
81
+ else
82
+ "error in callout call #{style}"
83
+ end
73
84
  end
74
85
 
75
86
  def iconbadge1(icon, tooltip)
76
87
  %(<img src="/bootstrap/bootstrap-icons-1.0.0/#{icon}.svg" title="#{tooltip}" class="iconbadge">)
77
88
  end
78
89
 
79
- def iconbadge(icon, tooltip)
80
- %(<svg class="bi iconbadge" title="#{tooltip}" data-placement="top" data-title="#{tooltip}" data-toggle="tooltip" fill="blue"><use xlink:href="/bootstrap/bootstrap-icons-1.0.0/bootstrap-icons.svg##{icon}"/></svg>)
90
+ def iconbadge3(icon, tooltip, shorttext="")
91
+ %(<svg class="iconbadge bi" title="#{tooltip}" data-placement="top" data-title="#{tooltip}" data-toggle="tooltip" fill="blue"><use xlink:href="/bootstrap/bootstrap-icons-1.0.0/bootstrap-icons.svg##{icon}"/></svg>#{shorttext})
81
92
  end
82
-
93
+
94
+ def iconbadge(icon, tooltip, shorttext="")
95
+ %(<svg class="iconbadge bi" title="#{tooltip}" data-placement="top" data-title="#{tooltip}" data-toggle="tooltip" fill="blue"><use xlink:href="/bootstrap/bootstrap-icons-1.0.0/bootstrap-icons.svg##{icon}"/></svg><span class="icontext" >#{shorttext}</span>)
96
+ end
97
+
83
98
  def textbadge(text, tooltip)
84
99
  %(<span class="label label-info" data-toggle="tooltip" data-placement="top" title="#{tooltip}">#{text}</span>)
85
100
  end
@@ -89,31 +104,31 @@ module ContentHelpers
89
104
  end
90
105
 
91
106
  def pdfbadge
92
- iconbadge('file-earmark-richtext-fill', 'Submit a pdf file')
107
+ iconbadge('file-earmark-richtext-fill', 'Submit a pdf file', "pdf")
93
108
  end
94
109
 
95
110
  def codebadge
96
- iconbadge('file-code-fill', 'Work on code in your portfolio')
111
+ iconbadge('file-code-fill', 'Work on code in your portfolio', "portfolio")
97
112
  end
98
113
 
99
114
  def cloudbadge
100
- iconbadge('cloud-fill', 'Work on code in your portfolio')
115
+ iconbadge('cloud-fill', 'Work on code in your portfolio', 'portfolio')
101
116
  end
102
117
 
103
118
  def zipbadge
104
- iconbadge('file-earmark-zip-fill', 'Submit work as an attachment')
119
+ iconbadge('file-earmark-zip-fill', 'Submit work in a zipfile', 'zip')
105
120
  end
106
121
 
107
122
  def partbadge
108
- iconbadge('heart-half', 'Graded for participation only - pass/fail')
123
+ iconbadge('heart-half', 'Graded for participation only - pass/fail', 'participation')
109
124
  end
110
125
 
111
126
  def timebadge
112
- iconbadge('alarm-fill', 'Must be submitted first thing on day of class')
127
+ iconbadge('alarm-fill', 'Must be submitted first thing on day of class', 'early submit')
113
128
  end
114
129
 
115
130
  def teambadge
116
- iconbadge('people-fill', 'Team Deliverable')
131
+ iconbadge('people-fill', 'Team Deliverable', 'team deliverable')
117
132
  end
118
133
 
119
134
  def include_image_old(filename_string, extra_class: nil)
@@ -200,8 +215,8 @@ module ContentHelpers
200
215
  # body << %(" class="img-polaroid" alt=""></div>)
201
216
  # counter += 1
202
217
  # end
203
- # body << %(</div> <a class="left carousel-control" href="#myCarousel" data-slide="prev">‹</a>
204
- # <a class="right carousel-control" href="#myCarousel" data-slide="next">›</a>
218
+ # body << %(</div> <a class="left carousel-control" href="#myCarousel" data-slide="prev"></a>
219
+ # <a class="right carousel-control" href="#myCarousel" data-slide="next"></a>
205
220
  # </div>)
206
221
  # body
207
222
  # end
@@ -234,7 +249,7 @@ module ContentHelpers
234
249
  # body
235
250
  # end
236
251
 
237
- def carousel_V4(filenames)
252
+ def carousel_v4(filenames)
238
253
  body = <<~HEREDOC
239
254
  <div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
240
255
  <div class="carousel-inner">
@@ -0,0 +1,8 @@
1
+ module VisualHelpers
2
+
3
+ def end_of_lecture(type=:thatsall)
4
+ if (type == :thatsall)
5
+ %(<slide_break></slide_break><hr/><%= include_image "/content/topics/images/thatsallfolks.jpg" %>)
6
+ end
7
+ end
8
+ end
@@ -6,6 +6,7 @@ include SidebarHelpers
6
6
  include ListOfHelpers
7
7
  include ICalFeedHelpers
8
8
  include FormattingHelpers
9
+ include VisualHelpers
9
10
  include Nanoc::Helpers::Rendering
10
11
  include Nanoc::Helpers::LinkTo
11
- include Nanoc::Helpers::Tagging
12
+ include Nanoc::Helpers::Tagging
@@ -0,0 +1,9 @@
1
+ include VisualHelpers
2
+
3
+ Nanoc::Filter.define(:handle_shortcodes) do |content, _params = {}|
4
+ content
5
+ .gsub(/^\$\$INCLUDE_TOPIC :(\w+)$/) { "<%= include_topic( :#{$1}) %>" }
6
+ .gsub(/^\$\$SLIDE_TITLE (.+)$/) { "<slide_break></slide_break>\n\n### #{$1}" }
7
+ .gsub(/^\$\$SLIDE_BREAK$/) { "<slide_break></slide_break>" }
8
+ .gsub(/^\$\$END_OF_LECTURE$/) { end_of_lecture }
9
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Coursegen
4
- VERSION = '0.9.2'
4
+ VERSION = '0.9.8'
5
5
  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.9.2
4
+ version: 0.9.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pito Salas
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-07 00:00:00.000000000 Z
11
+ date: 2021-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -270,8 +270,10 @@ files:
270
270
  - lib/coursegen/course/helpers/navigation_helpers.rb
271
271
  - lib/coursegen/course/helpers/sidebar_helpers.rb
272
272
  - lib/coursegen/course/helpers/table_helpers.rb
273
+ - lib/coursegen/course/helpers/visual_helpers.rb
273
274
  - lib/coursegen/course/lib/helpers_.rb
274
275
  - lib/coursegen/course/lib/ical_adaptor.rb
276
+ - lib/coursegen/course/lib/nanoc_filters.rb
275
277
  - lib/coursegen/course/lib/search_data_generator.rb
276
278
  - lib/coursegen/course/schedule/schedule_def.rb
277
279
  - lib/coursegen/course/schedule/schedule_feed.rb
@@ -335,7 +337,7 @@ homepage: ''
335
337
  licenses:
336
338
  - MIT
337
339
  metadata: {}
338
- post_install_message:
340
+ post_install_message:
339
341
  rdoc_options: []
340
342
  require_paths:
341
343
  - lib
@@ -350,8 +352,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
350
352
  - !ruby/object:Gem::Version
351
353
  version: '0'
352
354
  requirements: []
353
- rubygems_version: 3.0.3
354
- signing_key:
355
+ rubygems_version: 3.1.4
356
+ signing_key:
355
357
  specification_version: 4
356
358
  summary: Use Nanoc to build courses and deploy them to S3
357
359
  test_files: