coursegen 0.9.15 → 0.9.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/lib/coursegen/course/helpers/content_helpers.rb +28 -5
- data/lib/coursegen/course/lib/nanoc_filters.rb +32 -26
- data/lib/coursegen/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e04b3546c2431660b1808e4a46648b73e332578f3ebeb46085d5f1ee675f3e5
|
4
|
+
data.tar.gz: 166cec22386a715de6da584a500b191affb35e707b8518b0346a2e4db45902fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51f148ce7a2c272afceb6bd370085bc18590c3e4ccd0a2671c8e6a5cca8c81f6be7f65a939858983afcf1d6f172e1d52bbaa83def34592ad4ddab5c8a0d9df6f
|
7
|
+
data.tar.gz: 4887a9b340771d7796db1db3f56bfb83fe634eb2969eea2967234ba368c9b1eea46febb7f3cd2d65fd4ad3472801a24b7a06aedccb3e1428bc480db12936f296
|
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.19)
|
5
5
|
activesupport
|
6
6
|
adsf
|
7
7
|
byebug
|
@@ -105,7 +105,7 @@ GEM
|
|
105
105
|
nanoc-cli (~> 4.11, >= 4.11.15)
|
106
106
|
nanoc-core (~> 4.11, >= 4.11.15)
|
107
107
|
nenv (0.3.0)
|
108
|
-
nokogiri (1.11.
|
108
|
+
nokogiri (1.11.3-x86_64-darwin)
|
109
109
|
racc (~> 1.4)
|
110
110
|
notiffany (0.1.3)
|
111
111
|
nenv (~> 0.1)
|
@@ -113,7 +113,7 @@ GEM
|
|
113
113
|
parallel (1.20.1)
|
114
114
|
pastel (0.8.0)
|
115
115
|
tty-color (~> 0.5)
|
116
|
-
pry (0.14.
|
116
|
+
pry (0.14.1)
|
117
117
|
coderay (~> 1.1)
|
118
118
|
method_source (~> 1.0)
|
119
119
|
public_suffix (4.0.6)
|
@@ -67,22 +67,41 @@ module ContentHelpers
|
|
67
67
|
HTMLSTRING
|
68
68
|
end
|
69
69
|
|
70
|
-
def
|
71
|
-
if
|
70
|
+
def callout3(title, body, style="big")
|
71
|
+
style = style.to_s if style.class != String
|
72
|
+
if (style == "big")
|
72
73
|
%(<div class="jumbotron py-1 border border-primary border-rounded-lg">
|
73
74
|
<h1 class="display-5">#{title}</h1>
|
74
75
|
<p class="lead">#{body}</p></div>)
|
75
|
-
elsif (style ==
|
76
|
+
elsif (style == "small")
|
76
77
|
<<~HTMLSTRING
|
77
78
|
<div class="callout border border-primary rounded p-2 m-3">
|
78
79
|
<span class="badge badge-pill badge-primary">#{title}</span>#{body}
|
79
80
|
</div>
|
80
81
|
HTMLSTRING
|
81
82
|
else
|
82
|
-
"error in callout call #{style}"
|
83
|
+
"error in callout call: .#{style}. #{style.class}"
|
83
84
|
end
|
84
85
|
end
|
85
86
|
|
87
|
+
def callout(title, body, style="big")
|
88
|
+
style = style.to_s if style.class != String
|
89
|
+
if (style == "big")
|
90
|
+
%(<div class="callout callout-big">
|
91
|
+
<h1 class="display-5">#{title}</h1>
|
92
|
+
<p class="lead">#{body}</p></div>)
|
93
|
+
elsif (style == "small")
|
94
|
+
<<~HTMLSTRING
|
95
|
+
<div class="callout callout-small">
|
96
|
+
<span class="callout-badge">#{title}</span>#{body}
|
97
|
+
</div>
|
98
|
+
HTMLSTRING
|
99
|
+
else
|
100
|
+
"error in callout call: .#{style}. #{style.class}"
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
|
86
105
|
def iconbadge1(icon, tooltip)
|
87
106
|
%(<img src="/bootstrap/bootstrap-icons-1.0.0/#{icon}.svg" title="#{tooltip}" class="iconbadge">)
|
88
107
|
end
|
@@ -193,10 +212,14 @@ module ContentHelpers
|
|
193
212
|
"*Discussion:*{: style=\"color: blue\"} *#{string}*"
|
194
213
|
end
|
195
214
|
|
196
|
-
def
|
215
|
+
def discussion_box1(string)
|
197
216
|
%(<div class="alert alert-info"><strong>Discussion:</strong> #{string}</div>)
|
198
217
|
end
|
199
218
|
|
219
|
+
def discussion_box(string)
|
220
|
+
%(<div class="discussionbox"><strong>Discussion:</strong> #{string}</div>)
|
221
|
+
end
|
222
|
+
|
200
223
|
def homework_hdr(show_legend: :on)
|
201
224
|
body = '## Homework due for today'
|
202
225
|
legend = "\n**Legend**: #{partbadge}: Participation (pass/fail) | #{pdfbadge}: PDF | #{teambadge}: Team | #{zipbadge}: Attachment"
|
@@ -2,29 +2,35 @@ include VisualHelpers
|
|
2
2
|
|
3
3
|
Nanoc::Filter.define(:handle_shortcodes) do |content, _params = {}|
|
4
4
|
prefix = /:/
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
5
|
+
content
|
6
|
+
.gsub(Regexp.new(prefix.source + /callout :(\w+), "(.+)", "(.+)"/.source)) { callout($2, $3, $1) }
|
7
|
+
.gsub(Regexp.new(prefix.source + /deliverable (.+)$/.source)) { deliverable($1) }
|
8
|
+
.gsub(Regexp.new(prefix.source + /discussion_box "(.+)"/.source)) { discussion_box($1) }
|
9
|
+
.gsub(Regexp.new(prefix.source + /h1 (.+)$/.source), "# \\1 ")
|
10
|
+
.gsub(Regexp.new(prefix.source + /h2 (.+)$/.source), "## \\1 ")
|
11
|
+
.gsub(Regexp.new(prefix.source + /h3 (.+)$/.source), "### \\1 ")
|
12
|
+
.gsub(Regexp.new(prefix.source + /h4 (.+)$/.source), "#### \\1 ")
|
13
|
+
.gsub(Regexp.new(prefix.source + /h5 (.+)$/.source)) { "<h5>#{$1}</h5>" }
|
14
|
+
.gsub(Regexp.new(prefix.source + /image :(\w+)$/.source)) { "<img src=\"/content/topics/images/#{$1}.jpg\" class=\"img-thumbnail\" style=\"height:300px;\"/>" }
|
15
|
+
.gsub(Regexp.new(prefix.source + /image :(\w+), :(\w+)$/.source)) { "<img src=\"/content/topics/images/#{$2}.jpg\" class=\"img-thumbnail\" style=\"height:#{$1}px;\"/>" }
|
16
|
+
.gsub(Regexp.new(prefix.source + /lecture_end/.source), end_of_lecture)
|
17
|
+
.gsub(Regexp.new(prefix.source + /li (.+)$/.source)) { "<li>#{$1}</li>" }
|
18
|
+
.gsub(Regexp.new(prefix.source + /partbadge/.source), partbadge)
|
19
|
+
.gsub(Regexp.new(prefix.source + /pdfbadge/.source), pdfbadge)
|
20
|
+
.gsub(Regexp.new(prefix.source + /section_link :(\w+) :(\w+)/.source)) { link_to_section($1, $2) }
|
21
|
+
.gsub(Regexp.new(prefix.source + /slide_bigtitle (.+)$/.source), "<slide_break></slide_break>\n\n## \\1")
|
22
|
+
.gsub(Regexp.new(prefix.source + /slide_break/.source), "<slide_break></slide_break>")
|
23
|
+
.gsub(Regexp.new(prefix.source + /slide_subtitle (.+)$/.source), "<slide_break></slide_break>\n\n#### \\1")
|
24
|
+
.gsub(Regexp.new(prefix.source + /slide_title (.+)$/.source), "<slide_break></slide_break>\n\n### \\1")
|
25
|
+
.gsub(Regexp.new(prefix.source + /source_begin :(.+)$/.source)) { source_begin( ":language-"+$1) }
|
26
|
+
.gsub(Regexp.new(prefix.source + /source_end/.source), source_end)
|
27
|
+
.gsub(Regexp.new(prefix.source + /team_deliverable (.+)$/.source)) { team_deliverable($1) }
|
28
|
+
.gsub(Regexp.new(prefix.source + /teambadge/.source), teambadge)
|
29
|
+
.gsub(Regexp.new(prefix.source + /topic_include :(\w+)$/.source)) { include_topic($1) }
|
30
|
+
.gsub(Regexp.new(prefix.source + /topic_link :(\w+)/.source)) { link_to_topic($1) }
|
31
|
+
.gsub(Regexp.new(prefix.source + /ul_begin :(\w+)/.source)) { "<ul class=\"#{$1}\">" }
|
32
|
+
.gsub(Regexp.new(prefix.source + /ul_begin$/.source)) { "<ul>" }
|
33
|
+
.gsub(Regexp.new(prefix.source + /ul_end$/.source)) { "</ul>" }
|
34
|
+
.gsub(Regexp.new(prefix.source + /youtube \"(.+)\"$/.source)) { %Q!<iframe width="560" height="315" src="#{$1}"></iframe>! }
|
35
|
+
.gsub(Regexp.new(prefix.source + /zipbadge/.source), zipbadge)
|
36
|
+
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.19
|
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-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|