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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49756c03a13b085ddf764599198c727ea994f2186d6e0e70a741a7a123abc1b4
4
- data.tar.gz: d73c9ab6104f269b5e89cf9e699de25fc2ee3f19ab110eb5627ca17cb85996d7
3
+ metadata.gz: 0e04b3546c2431660b1808e4a46648b73e332578f3ebeb46085d5f1ee675f3e5
4
+ data.tar.gz: 166cec22386a715de6da584a500b191affb35e707b8518b0346a2e4db45902fe
5
5
  SHA512:
6
- metadata.gz: ce411f54298438077ce2b978a0c0585ef0bd91e563f02677e056be928bd6c5de1bdcff914c22d9e4faf3366c2f52c100646df77091bdd6f714d117276df8ae8c
7
- data.tar.gz: 471d7501b71ee5478dce759d3c2b274f8dae0d844f626d83d2f749bcaf58cc6f9db1391b9d64756307ee407b2b3a8d40a78a554e04e312c18deda23ec21e804f
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.15)
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.2-x86_64-darwin)
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.0)
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 callout(title, body, style=:big)
71
- if (style == :big)
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 == :small)
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 discussion_box(string)
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
- content
6
- .gsub(Regexp.new(prefix.source + /h1 (.+)$/.source), "# \\1 ")
7
- .gsub(Regexp.new(prefix.source + /h2 (.+)$/.source), "## \\1 ")
8
- .gsub(Regexp.new(prefix.source + /h3 (.+)$/.source), "### \\1 ")
9
- .gsub(Regexp.new(prefix.source + /h4 (.+)$/.source), "#### \\1 ")
10
- .gsub(Regexp.new(prefix.source + /topic_include :(\w+)$/.source)) { |match| include_topic($1) }
11
- .gsub(Regexp.new(prefix.source + /topic_link :(\w+)/.source)) { |match| link_to_topic($1) }
12
- .gsub(Regexp.new(prefix.source + /section_link :(\w+) :(\w+)/.source)) { |match| link_to_section($1, $2) }
13
- .gsub(Regexp.new(prefix.source + /slide_title (.+)$/.source), "<slide_break></slide_break>\n\n### \\1")
14
- .gsub(Regexp.new(prefix.source + /slide_bigtitle (.+)$/.source), "<slide_break></slide_break>\n\n## \\1")
15
- .gsub(Regexp.new(prefix.source + /lecture_end/.source), end_of_lecture)
16
- .gsub(Regexp.new(prefix.source + /deliverable (.+)$/.source), "<%= deliverable( \"\\1\") %>")
17
- .gsub(Regexp.new(prefix.source + /pdfbadge/.source), pdfbadge)
18
- .gsub(Regexp.new(prefix.source + /partbadge/.source), partbadge)
19
- .gsub(Regexp.new(prefix.source + /teambadge/.source), teambadge)
20
- .gsub(Regexp.new(prefix.source + /zipbadge/.source), zipbadge)
21
- .gsub(Regexp.new(prefix.source + /slide_break/.source), "<slide_break></slide_break>")
22
- .gsub(Regexp.new(prefix.source + /youtube \"(.+)\"$/.source)) { |match| %Q!<iframe width="560" height="315" src="#{$1}"></iframe>! }
23
- # .gsub(Regexp.new(prefix.source + /youtube \"(.+)\"$/.source)) { |match| $1 }
24
- .gsub(Regexp.new(prefix.source + /source_begin :(.+)$/.source)) { |match| source_begin ( ":language-"+$1) }
25
- .gsub(Regexp.new(prefix.source + /source_end/.source), source_end)
26
- .gsub(Regexp.new(prefix.source + /team_deliverable (.+)$/.source), "<%= team_deliverable( \"\\1\") %>")
27
- .gsub(Regexp.new(prefix.source + /discussion_box (.+)$/.source), "<%= discussion_box( \"\\1\") %>")
28
- .gsub(Regexp.new(prefix.source + /image :(\w+)/.source), "<img src=\"/content/topics/images/\\1.jpg\" class=\"img-thumbnail\" style=\"height:300px;\"/>")
29
-
30
- end
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Coursegen
4
- VERSION = '0.9.15'
4
+ VERSION = '0.9.19'
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.15
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-04-08 00:00:00.000000000 Z
11
+ date: 2021-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler