coursegen 0.9.15 → 0.9.16

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: 3122a6f1e196dc736ad8bb5559088b8a23268a75acf77ea556f8f3c0622de90b
4
+ data.tar.gz: d2c72e6dc943f818d444e314b6c1ff7eea0fae1e96b09d87c053b29e6797e958
5
5
  SHA512:
6
- metadata.gz: ce411f54298438077ce2b978a0c0585ef0bd91e563f02677e056be928bd6c5de1bdcff914c22d9e4faf3366c2f52c100646df77091bdd6f714d117276df8ae8c
7
- data.tar.gz: 471d7501b71ee5478dce759d3c2b274f8dae0d844f626d83d2f749bcaf58cc6f9db1391b9d64756307ee407b2b3a8d40a78a554e04e312c18deda23ec21e804f
6
+ metadata.gz: 03b6891fa609a2fd40fa083f7e2c7865ec29b9c31f12b8792b8feb68099391cb57fa883d5cdf0141cc75b9a303d7b864bb5869ebbd00085af415b75aeed109d2
7
+ data.tar.gz: 4ae5c38eeb4b5ed3c9c0018dab732a34a9780abb3298414a2fb3775842adc75b8d700e3dac6fc05724e42403d2e429706362d3bc74b14096a74bd2c77d733409
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.16)
5
5
  activesupport
6
6
  adsf
7
7
  byebug
@@ -67,19 +67,20 @@ module ContentHelpers
67
67
  HTMLSTRING
68
68
  end
69
69
 
70
- def callout(title, body, style=:big)
71
- if (style == :big)
70
+ def callout(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
 
@@ -1,30 +1,30 @@
1
1
  include VisualHelpers
2
2
 
3
3
  Nanoc::Filter.define(:handle_shortcodes) do |content, _params = {}|
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
4
+ prefix = /:/
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 + /image :(\w+)/.source), "<img src=\"/content/topics/images/\\1.jpg\" class=\"img-thumbnail\" style=\"height:300px;\"/>")
14
+ .gsub(Regexp.new(prefix.source + /lecture_end/.source), end_of_lecture)
15
+ .gsub(Regexp.new(prefix.source + /partbadge/.source), partbadge)
16
+ .gsub(Regexp.new(prefix.source + /pdfbadge/.source), pdfbadge)
17
+ .gsub(Regexp.new(prefix.source + /section_link :(\w+) :(\w+)/.source)) { link_to_section($1, $2) }
18
+ .gsub(Regexp.new(prefix.source + /slide_bigtitle (.+)$/.source), "<slide_break></slide_break>\n\n## \\1")
19
+ .gsub(Regexp.new(prefix.source + /slide_break/.source), "<slide_break></slide_break>")
20
+ .gsub(Regexp.new(prefix.source + /slide_subtitle (.+)$/.source), "<slide_break></slide_break>\n\n#### \\1")
21
+ .gsub(Regexp.new(prefix.source + /slide_title (.+)$/.source), "<slide_break></slide_break>\n\n### \\1")
22
+ .gsub(Regexp.new(prefix.source + /source_begin :(.+)$/.source)) { source_begin( ":language-"+$1) }
23
+ .gsub(Regexp.new(prefix.source + /source_end/.source), source_end)
24
+ .gsub(Regexp.new(prefix.source + /team_deliverable (.+)$/.source), "<%= team_deliverable( \"\\1\") %>")
25
+ .gsub(Regexp.new(prefix.source + /teambadge/.source), teambadge)
26
+ .gsub(Regexp.new(prefix.source + /topic_include :(\w+)$/.source)) { include_topic($1) }
27
+ .gsub(Regexp.new(prefix.source + /topic_link :(\w+)/.source)) { link_to_topic($1) }
28
+ .gsub(Regexp.new(prefix.source + /youtube \"(.+)\"$/.source)) { %Q!<iframe width="560" height="315" src="#{$1}"></iframe>! }
29
+ .gsub(Regexp.new(prefix.source + /zipbadge/.source), zipbadge)
30
+ 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.16'
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.16
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-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler