coursegen 0.9.4 → 0.9.10

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: '087e9a6b825c319f78dcca194ccce680b76a309bc47611d3eb706feaaed8c8b1'
4
- data.tar.gz: 5bdf60dbb0fa91c3b0c957f855a3d43f287049416b9f8193fc771ab10431c9f7
3
+ metadata.gz: e08a52cfed6836872be228d0a7c6dec8bfa087ee286cf079a76f6db3674a122b
4
+ data.tar.gz: a8d62798dcb08f373f10b9d632101db57b3a191819b1856e53b1dfe4769744f3
5
5
  SHA512:
6
- metadata.gz: '008f4ee0fbb60117d5989f3241c5500be02d679d5b51d72409e71ad4ec0ea69c02a34ccac82a11eed5bbe0d9fd564ebd870bdaf891e2ad2639243b2b3cfc45d3'
7
- data.tar.gz: 2c0bfc88ead3fcf7c22fc9f973a00645b2dbb410b8276f056a4c0607a3b38c4923712969f2860d2ed64f8ffcc21f6f68f50ca108f2b78384da87a94a67b753cb
6
+ metadata.gz: 3246fa9423de19c68223214da7ffc24a3c10c5b6384a1baf5b8fbeb2504362a7835598103549dbaf74c4c0dc09e409b1d439d19936039baadf15ad9283f32bce
7
+ data.tar.gz: d018679f27b6895ea70f2692fee9136450a040485fb1e6feaaabea5f567239fff9ade2c9892c1caec1bf906ce9c34f58495f24fd1c0776e1d7e0c2231498cad3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- coursegen (0.9.4)
4
+ coursegen (0.9.10)
5
5
  activesupport
6
6
  adsf
7
7
  byebug
@@ -19,7 +19,7 @@ PATH
19
19
  GEM
20
20
  remote: https://rubygems.org/
21
21
  specs:
22
- activesupport (6.1.1)
22
+ activesupport (6.1.3)
23
23
  concurrent-ruby (~> 1.0, >= 1.0.2)
24
24
  i18n (>= 1.6, < 2)
25
25
  minitest (>= 5.1)
@@ -57,12 +57,12 @@ GEM
57
57
  guard-compat (~> 1.0)
58
58
  hamster (3.0.0)
59
59
  concurrent-ruby (~> 1.0)
60
- i18n (1.8.7)
60
+ i18n (1.8.9)
61
61
  concurrent-ruby (~> 1.0)
62
62
  icalendar (2.7.0)
63
63
  ice_cube (~> 0.16)
64
64
  ice_cube (0.16.3)
65
- json (2.5.1)
65
+ json (2.3.0)
66
66
  json_schema (0.20.9)
67
67
  kramdown (2.3.0)
68
68
  rexml
@@ -71,7 +71,7 @@ GEM
71
71
  rb-inotify (~> 0.9, >= 0.9.10)
72
72
  lumberjack (1.2.8)
73
73
  method_source (1.0.0)
74
- minitest (5.14.3)
74
+ minitest (5.14.4)
75
75
  nanoc (4.11.23)
76
76
  addressable (~> 2.5)
77
77
  colored (~> 1.2)
@@ -125,7 +125,7 @@ GEM
125
125
  rb-inotify (0.10.1)
126
126
  ffi (~> 1.0)
127
127
  ref (2.0.0)
128
- rexml (3.2.4)
128
+ rexml (3.2.3)
129
129
  rspec (3.10.0)
130
130
  rspec-core (~> 3.10.0)
131
131
  rspec-expectations (~> 3.10.0)
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
@@ -86,8 +87,12 @@ module ContentHelpers
86
87
  %(<img src="/bootstrap/bootstrap-icons-1.0.0/#{icon}.svg" title="#{tooltip}" class="iconbadge">)
87
88
  end
88
89
 
89
- def iconbadge(icon, tooltip)
90
- %(<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})
92
+ end
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>)
91
96
  end
92
97
 
93
98
  def textbadge(text, tooltip)
@@ -99,31 +104,31 @@ module ContentHelpers
99
104
  end
100
105
 
101
106
  def pdfbadge
102
- iconbadge('file-earmark-richtext-fill', 'Submit a pdf file')
107
+ iconbadge('file-earmark-richtext-fill', 'Submit a pdf file', "pdf")
103
108
  end
104
109
 
105
110
  def codebadge
106
- iconbadge('file-code-fill', 'Work on code in your portfolio')
111
+ iconbadge('file-code-fill', 'Work on code in your portfolio', "portfolio")
107
112
  end
108
113
 
109
114
  def cloudbadge
110
- iconbadge('cloud-fill', 'Work on code in your portfolio')
115
+ iconbadge('cloud-fill', 'Work on code in your portfolio', 'portfolio')
111
116
  end
112
117
 
113
118
  def zipbadge
114
- iconbadge('file-earmark-zip-fill', 'Submit work as an attachment')
119
+ iconbadge('file-earmark-zip-fill', 'Submit work in a zipfile', 'zip')
115
120
  end
116
121
 
117
122
  def partbadge
118
- iconbadge('heart-half', 'Graded for participation only - pass/fail')
123
+ iconbadge('heart-half', 'Graded for participation only - pass/fail', 'participation')
119
124
  end
120
125
 
121
126
  def timebadge
122
- 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')
123
128
  end
124
129
 
125
130
  def teambadge
126
- iconbadge('people-fill', 'Team Deliverable')
131
+ iconbadge('people-fill', 'Team Deliverable', 'team deliverable')
127
132
  end
128
133
 
129
134
  def include_image_old(filename_string, extra_class: nil)
@@ -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,19 @@
1
+ include VisualHelpers
2
+
3
+ Nanoc::Filter.define(:handle_shortcodes) do |content, _params = {}|
4
+ prefix = /:/
5
+ content
6
+ .gsub(/^\$\$TOPIC_INCLUDE :(\w+)$/) { "<%= include_topic( :#{Regexp.last_match(1)}) %>" }
7
+ .gsub(/\$\$TOPIC_LINK :(\w+)$/) { "<%= link_to_topic( :#{Regexp.last_match(1)}) %>" }
8
+ .gsub(/\$\$SLIDE_TITLE (.+)$/) { "<slide_break></slide_break>\n\n### #{Regexp.last_match(1)}" }
9
+ .gsub(/\$\$SLIDE_BREAK$/) { "<slide_break></slide_break>" }
10
+ .gsub(/\$\$LECTURE_END$/) { end_of_lecture }
11
+ .gsub(/\$\$LECTURE_BEGIN (.+)$/) { "## #{Regexp.last_match(1)} "}
12
+ .gsub(Regexp.new(prefix.source + /h1 (.+)$/.source), "# \\1 ")
13
+ .gsub(Regexp.new(prefix.source + /h2 (.+)$/.source), "## \\1 ")
14
+ .gsub(Regexp.new(prefix.source + /h3 (.+)$/.source), "### \\1 ")
15
+ .gsub(Regexp.new(prefix.source + /topic_include :(\w+)$/.source), "<%= include_topic( :\\1) %>")
16
+ .gsub(Regexp.new(prefix.source + /topic_link :(\w+)$/.source), "<%= link_to_topic( :\\1) %>")
17
+ .gsub(Regexp.new(prefix.source + /slide_title (.+)$/.source), "<slide_break></slide_break>\n\n### \\1")
18
+ .gsub(Regexp.new(prefix.source + /lecture_end/.source), end_of_lecture)
19
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Coursegen
4
- VERSION = '0.9.4'
4
+ VERSION = '0.9.10'
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.4
4
+ version: 0.9.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pito Salas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-27 00:00:00.000000000 Z
11
+ date: 2021-03-02 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