coursegen 0.9.3 → 0.9.9
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 +4 -4
- data/Gemfile.lock +6 -6
- data/lib/coursegen.rb +3 -0
- data/lib/coursegen/course/helpers/content_helpers.rb +16 -10
- data/lib/coursegen/course/helpers/visual_helpers.rb +8 -0
- data/lib/coursegen/course/lib/helpers_.rb +2 -1
- data/lib/coursegen/course/lib/nanoc_filters.rb +19 -0
- data/lib/coursegen/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03f1cff6597ed85fbcde71668cb790bb234d1c529d69e8dd5b2590b8fdbb029c
|
4
|
+
data.tar.gz: 17b93ad8dda84b6a73ea6f1f9c7ae01a2e8380ee693bf34b6823bfd2f0416724
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 471215f376cbd6990e4ae3fd1f0929e809c9f933019ca9398719d23bb79344cfd6725625bb4a2f515c88db5a90ea8b4553da16525822b115828cab79c8c78745
|
7
|
+
data.tar.gz: d5d69b84ef364720ac4172e8906bbff350f838b8481c7d49aca9893634460f9698beedfc9005469257e06cc28c12b581deb42d7b88fe58207f4b416ed4ba96e1
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
coursegen (0.9.
|
4
|
+
coursegen (0.9.9)
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
|
@@ -77,16 +78,21 @@ module ContentHelpers
|
|
77
78
|
<span class="badge badge-pill badge-primary">#{title}</span>#{body}
|
78
79
|
</div>
|
79
80
|
HTMLSTRING
|
81
|
+
else
|
82
|
+
"error in callout call #{style}"
|
80
83
|
end
|
81
|
-
"error in callout call."
|
82
84
|
end
|
83
85
|
|
84
86
|
def iconbadge1(icon, tooltip)
|
85
87
|
%(<img src="/bootstrap/bootstrap-icons-1.0.0/#{icon}.svg" title="#{tooltip}" class="iconbadge">)
|
86
88
|
end
|
87
89
|
|
88
|
-
def
|
89
|
-
%(<svg class="bi
|
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>)
|
90
96
|
end
|
91
97
|
|
92
98
|
def textbadge(text, tooltip)
|
@@ -98,31 +104,31 @@ module ContentHelpers
|
|
98
104
|
end
|
99
105
|
|
100
106
|
def pdfbadge
|
101
|
-
iconbadge('file-earmark-richtext-fill', 'Submit a pdf file')
|
107
|
+
iconbadge('file-earmark-richtext-fill', 'Submit a pdf file', "pdf")
|
102
108
|
end
|
103
109
|
|
104
110
|
def codebadge
|
105
|
-
iconbadge('file-code-fill', 'Work on code in your portfolio')
|
111
|
+
iconbadge('file-code-fill', 'Work on code in your portfolio', "portfolio")
|
106
112
|
end
|
107
113
|
|
108
114
|
def cloudbadge
|
109
|
-
iconbadge('cloud-fill', 'Work on code in your portfolio')
|
115
|
+
iconbadge('cloud-fill', 'Work on code in your portfolio', 'portfolio')
|
110
116
|
end
|
111
117
|
|
112
118
|
def zipbadge
|
113
|
-
iconbadge('file-earmark-zip-fill', 'Submit work
|
119
|
+
iconbadge('file-earmark-zip-fill', 'Submit work in a zipfile', 'zip')
|
114
120
|
end
|
115
121
|
|
116
122
|
def partbadge
|
117
|
-
iconbadge('heart-half', 'Graded for participation only - pass/fail')
|
123
|
+
iconbadge('heart-half', 'Graded for participation only - pass/fail', 'participation')
|
118
124
|
end
|
119
125
|
|
120
126
|
def timebadge
|
121
|
-
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')
|
122
128
|
end
|
123
129
|
|
124
130
|
def teambadge
|
125
|
-
iconbadge('people-fill', 'Team Deliverable')
|
131
|
+
iconbadge('people-fill', 'Team Deliverable', 'team deliverable')
|
126
132
|
end
|
127
133
|
|
128
134
|
def include_image_old(filename_string, extra_class: nil)
|
@@ -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
|
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.9.
|
4
|
+
version: 0.9.9
|
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-
|
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
|