coursegen 0.9.21 → 0.9.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +9 -3
- data/lib/coursegen/course/helpers/content_helpers.rb +5 -7
- data/lib/coursegen/course/helpers/table_markup_helper.rb +21 -0
- data/lib/coursegen/course/lib/nanoc_filters.rb +52 -36
- data/lib/coursegen/version.rb +1 -1
- data/lib/coursegen.rb +1 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b476f56f838039a291620a88832b623746b4068c7c62a96c09ee6e4d80590781
|
4
|
+
data.tar.gz: 80d54c3af6d1fa3bcc7f112270896432fa9d52dcdc1eb122a07de7253a7528c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d897d3237b105438a2eab117a82c14b4ee004ac20ba3cce4124e37e25c2b2a623919b15e734c4838a1de9cce5f1e267608afef7454f1ba042771b8ec47067bf
|
7
|
+
data.tar.gz: 1a292e1e905dd84ab19d8f358c00d78435a578c164c2f3fa339b53bdb986e8e7a89269439b2841399c659303af0722656f50067f3a71c8020efe6802f389887e
|
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.25)
|
5
5
|
activesupport
|
6
6
|
adsf
|
7
7
|
byebug
|
@@ -80,6 +80,7 @@ GEM
|
|
80
80
|
lumberjack (1.2.8)
|
81
81
|
memo_wise (1.5.0)
|
82
82
|
method_source (1.0.0)
|
83
|
+
mini_portile2 (2.7.1)
|
83
84
|
minitest (5.15.0)
|
84
85
|
nanoc (4.12.4)
|
85
86
|
addressable (~> 2.5)
|
@@ -119,7 +120,8 @@ GEM
|
|
119
120
|
nanoc-cli (~> 4.11, >= 4.11.14)
|
120
121
|
nanoc-core (~> 4.11, >= 4.11.14)
|
121
122
|
nenv (0.3.0)
|
122
|
-
nokogiri (1.13.1
|
123
|
+
nokogiri (1.13.1)
|
124
|
+
mini_portile2 (~> 2.7.0)
|
123
125
|
racc (~> 1.4)
|
124
126
|
notiffany (0.1.3)
|
125
127
|
nenv (~> 0.1)
|
@@ -170,7 +172,11 @@ GEM
|
|
170
172
|
zeitwerk (2.5.3)
|
171
173
|
|
172
174
|
PLATFORMS
|
175
|
+
arm64-darwin-21
|
176
|
+
arm64-darwin-22
|
177
|
+
arm64-darwin-23
|
173
178
|
x86_64-darwin-21
|
179
|
+
x86_64-darwin-22
|
174
180
|
|
175
181
|
DEPENDENCIES
|
176
182
|
bundler
|
@@ -179,4 +185,4 @@ DEPENDENCIES
|
|
179
185
|
rspec
|
180
186
|
|
181
187
|
BUNDLED WITH
|
182
|
-
2.
|
188
|
+
2.4.10
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# ContentHelpers is used to annotate content.
|
2
2
|
module ContentHelpers
|
3
|
-
|
4
3
|
def include_topic(item_symbol)
|
5
4
|
incorporated_topic = lookup_nitem('topics', item_symbol.to_s)
|
6
5
|
items[incorporated_topic.identifier.to_s].compiled_content
|
@@ -75,9 +74,9 @@ module ContentHelpers
|
|
75
74
|
<p class="lead">#{body}</p></div>)
|
76
75
|
elsif (style == "small")
|
77
76
|
<<~HTMLSTRING
|
78
|
-
|
79
|
-
|
80
|
-
|
77
|
+
<div class="callout border border-primary rounded p-2 m-3">
|
78
|
+
<span class="badge badge-pill badge-primary">#{title}</span>#{body}
|
79
|
+
</div>
|
81
80
|
HTMLSTRING
|
82
81
|
else
|
83
82
|
"error in callout call: .#{style}. #{style.class}"
|
@@ -101,7 +100,6 @@ module ContentHelpers
|
|
101
100
|
end
|
102
101
|
end
|
103
102
|
|
104
|
-
|
105
103
|
def iconbadge1(icon, tooltip)
|
106
104
|
%(<img src="/bootstrap/bootstrap-icons-1.0.0/#{icon}.svg" title="#{tooltip}" class="iconbadge">)
|
107
105
|
end
|
@@ -359,11 +357,11 @@ module ContentHelpers
|
|
359
357
|
end
|
360
358
|
|
361
359
|
def source_begin(language)
|
362
|
-
"<pre class=\"#{language}\">"
|
360
|
+
"<pre><code class=\"#{language}\">"
|
363
361
|
end
|
364
362
|
|
365
363
|
def source_end
|
366
|
-
'</pre>'
|
364
|
+
'</code></pre>'
|
367
365
|
end
|
368
366
|
|
369
367
|
def postit_begin(title)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class TableMarkupHelper
|
2
|
+
def self.begin properties
|
3
|
+
@th = TableHelper.new(properties)
|
4
|
+
""
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.headers(labels)
|
8
|
+
@th.headers(*labels.split("\;"))
|
9
|
+
""
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.row(cells)
|
13
|
+
@th.row(*cells.split("\;"))
|
14
|
+
""
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.end
|
18
|
+
@th.render
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
@@ -2,39 +2,55 @@ 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
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
5
|
+
content
|
6
|
+
.gsub(Regexp.new(prefix.source + /callout :(\w+), "(.+)", "(.+)"/.source)) do
|
7
|
+
callout(Regexp.last_match(2),
|
8
|
+
Regexp.last_match(3), Regexp.last_match(1))
|
9
|
+
end
|
10
|
+
.gsub(Regexp.new(prefix.source + /deliverable (.+)$/.source)) { deliverable(Regexp.last_match(1)) }
|
11
|
+
.gsub(Regexp.new(prefix.source + /discussion "(.+)"/.source)) { discussion_box(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 + /h4 (.+)$/.source), "#### \\1 ")
|
16
|
+
.gsub(Regexp.new(prefix.source + /h5 (.+)$/.source)) { "<h5>#{Regexp.last_match(1)}</h5>" }
|
17
|
+
.gsub(Regexp.new(prefix.source + /image :(\w+)$/.source)) { "<img src=\"/content/topics/images/#{Regexp.last_match(1)}.jpg\" class=\"img-thumbnail d-block mx-auto\" style=\"height:300px;\"/>" }
|
18
|
+
.gsub(Regexp.new(prefix.source + /image :(\w+), :(\w+)$/.source)) { "<img src=\"/content/topics/images/#{Regexp.last_match(2)}.jpg\" class=\"img-thumbnail d-block mx-auto\" style=\"height:#{Regexp.last_match(1)}px;\"/>" }
|
19
|
+
.gsub(Regexp.new(prefix.source + /quote (.+)$/.source), "<blockquote class=\"pretty\">\\1</blockquote>")
|
20
|
+
.gsub(Regexp.new(prefix.source + /lecture_end/.source), end_of_lecture)
|
21
|
+
.gsub(Regexp.new(prefix.source + /li (.+)$/.source)) { "<li>#{Regexp.last_match(1)}</li>" }
|
22
|
+
.gsub(Regexp.new(prefix.source + /partbadge/.source), partbadge)
|
23
|
+
.gsub(Regexp.new(prefix.source + /pdfbadge/.source), pdfbadge)
|
24
|
+
.gsub(Regexp.new(prefix.source + /image_random "(\w+)", "(\w+)"/.source)) { "<img src=\"https://picsum.photos/#{Regexp.last_match(1)}/#{Regexp.last_match(2)}.jpg\" /> "}
|
25
|
+
.gsub(Regexp.new(prefix.source + /image_rnd :(\w+), "(.+)", "(.+)"/.source)) do
|
26
|
+
random_image(Regexp.last_match(1),
|
27
|
+
Regexp.last_match(2), Regexp.last_match(3))
|
28
|
+
end
|
29
|
+
.gsub(Regexp.new(prefix.source + /section_link :(\w+), :(\w+)/.source)) do
|
30
|
+
link_to_section(Regexp.last_match(1),
|
31
|
+
Regexp.last_match(2))
|
32
|
+
end
|
33
|
+
.gsub(Regexp.new(prefix.source + /section_include :(\w+), :(\w+)/.source)) do
|
34
|
+
include_from_section(Regexp.last_match(1),
|
35
|
+
Regexp.last_match(2))
|
36
|
+
end
|
37
|
+
.gsub(Regexp.new(prefix.source + /slide_bigtitle (.+)$/.source), "<slide_break></slide_break>\n\n## \\1")
|
38
|
+
.gsub(Regexp.new(prefix.source + /slide_break/.source), "<slide_break></slide_break>")
|
39
|
+
.gsub(Regexp.new(prefix.source + /slide_subtitle (.+)$/.source), "<slide_break></slide_break>\n\n#### \\1")
|
40
|
+
.gsub(Regexp.new(prefix.source + /slide_title (.+)$/.source), "<slide_break></slide_break>\n\n### \\1")
|
41
|
+
.gsub(Regexp.new(prefix.source + /source_begin :(.+)$/.source)) { source_begin("language-" + Regexp.last_match(1)) }
|
42
|
+
.gsub(Regexp.new(prefix.source + /source_end/.source), source_end)
|
43
|
+
.gsub(Regexp.new(prefix.source + /team_deliverable (.+)$/.source)) { team_deliverable(Regexp.last_match(1)) }
|
44
|
+
.gsub(Regexp.new(prefix.source + /teambadge/.source), teambadge)
|
45
|
+
.gsub(Regexp.new(prefix.source + /topic_include :(\w+)$/.source)) { include_topic(Regexp.last_match(1)) }
|
46
|
+
.gsub(Regexp.new(prefix.source + /topic_link :(\w+)/.source)) { link_to_topic(Regexp.last_match(1)) }
|
47
|
+
.gsub(Regexp.new(prefix.source + /ul_begin :(\w+)/.source)) { "<ul class=\"#{Regexp.last_match(1)}\">" }
|
48
|
+
.gsub(Regexp.new(prefix.source + /ul_begin$/.source)) { "<ul>" }
|
49
|
+
.gsub(Regexp.new(prefix.source + /ul_end$/.source)) { "</ul>" }
|
50
|
+
.gsub(Regexp.new(prefix.source + /youtube "(.+)"$/.source)) { %(<iframe width="560" height="315" src="#{Regexp.last_match(1)}"></iframe>) }
|
51
|
+
.gsub(Regexp.new(prefix.source + /zipbadge/.source), zipbadge)
|
52
|
+
.gsub(Regexp.new(prefix.source + /tbegin "(.+)"$/.source)) { TableMarkupHelper.begin(Regexp.last_match(1));}
|
53
|
+
.gsub(Regexp.new(prefix.source + /thead "(.+)"$/.source)) {TableMarkupHelper.headers(Regexp.last_match(1));}
|
54
|
+
.gsub(Regexp.new(prefix.source + /trow "(.+)"$/.source)) {TableMarkupHelper.row(Regexp.last_match(1));}
|
55
|
+
.gsub(Regexp.new(prefix.source + /tend/.source)) { TableMarkupHelper.end ;}
|
56
|
+
end
|
data/lib/coursegen/version.rb
CHANGED
data/lib/coursegen.rb
CHANGED
@@ -12,6 +12,7 @@ require 'coursegen/course/helpers/list_of_helpers'
|
|
12
12
|
require 'coursegen/course/helpers/formatting_helpers'
|
13
13
|
require 'coursegen/course/helpers/bootstrap_markup'
|
14
14
|
require 'coursegen/course/helpers/table_helpers'
|
15
|
+
require 'coursegen/course/helpers/table_markup_helper'
|
15
16
|
require 'coursegen/course/helpers/navigation_helpers'
|
16
17
|
require 'coursegen/course/data/section'
|
17
18
|
require 'coursegen/course/data/toc'
|
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.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pito Salas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -284,6 +284,7 @@ files:
|
|
284
284
|
- lib/coursegen/course/helpers/navigation_helpers.rb
|
285
285
|
- lib/coursegen/course/helpers/sidebar_helpers.rb
|
286
286
|
- lib/coursegen/course/helpers/table_helpers.rb
|
287
|
+
- lib/coursegen/course/helpers/table_markup_helper.rb
|
287
288
|
- lib/coursegen/course/helpers/visual_helpers.rb
|
288
289
|
- lib/coursegen/course/lib/helpers_.rb
|
289
290
|
- lib/coursegen/course/lib/ical_adaptor.rb
|
@@ -366,7 +367,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
366
367
|
- !ruby/object:Gem::Version
|
367
368
|
version: '0'
|
368
369
|
requirements: []
|
369
|
-
rubygems_version: 3.
|
370
|
+
rubygems_version: 3.4.10
|
370
371
|
signing_key:
|
371
372
|
specification_version: 4
|
372
373
|
summary: Use Nanoc to build courses and deploy them to S3
|