coursegen 0.8.3 → 0.9.1
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/.github/workflows/pr.yml +19 -0
- data/.gitignore +3 -0
- data/Gemfile.lock +60 -35
- data/README.md +285 -69
- data/Rakefile +10 -1
- data/coursegen.gemspec +26 -26
- data/lib/coursegen.rb +5 -2
- data/lib/coursegen/cli.rb +49 -14
- data/lib/coursegen/course/data/citem.rb +10 -1
- data/lib/coursegen/course/data/data_adaptor.rb +16 -6
- data/lib/coursegen/course/data/section.rb +1 -1
- data/lib/coursegen/course/helpers/bootstrap_markup.rb +15 -15
- data/lib/coursegen/course/helpers/content_helpers.rb +86 -71
- data/lib/coursegen/course/helpers/formatting_helpers.rb +6 -10
- data/lib/coursegen/course/helpers/ical_feed_helpers.rb +2 -1
- data/lib/coursegen/course/helpers/lecture_helpers.rb +3 -2
- data/lib/coursegen/course/helpers/list_of.rb +40 -20
- data/lib/coursegen/course/helpers/list_of_helpers.rb +20 -14
- data/lib/coursegen/course/helpers/logging_helpers.rb +13 -12
- data/lib/coursegen/course/helpers/navigation_helpers.rb +62 -23
- data/lib/coursegen/course/helpers/sidebar_helpers.rb +19 -18
- data/lib/coursegen/course/helpers/table_helpers.rb +5 -4
- data/lib/coursegen/course/schedule/scheduler.rb +52 -19
- data/lib/coursegen/templates.rb +30 -23
- data/lib/coursegen/version.rb +3 -1
- data/spec/lectures_spec.rb +60 -50
- data/spec/play_spec.rb +24 -12
- data/spec/scheduler_spec.rb +87 -27
- data/tech_debt.md +5 -0
- data/templates/Rules +14 -19
- data/templates/cg_config.rb +105 -21
- data/templates/content/bootstrap/css/custom.css +87 -151
- data/templates/content/bootstrap/css/full-width-pics.css +8 -64
- data/templates/content/bootstrap/css/postit.css +7 -0
- data/templates/content/bootstrap/css/toasty.css +3 -0
- data/templates/content/content/index.md.erb +1 -1
- data/templates/content/content/intro/course_toc.md.erb +0 -1
- data/templates/content/content/intro/welcome.md.erb +1 -3
- data/templates/content/content/lectures/part1/02_here_we_go.md.erb +22 -1
- data/templates/content/content/lectures/part2/01_start_part2.md.erb +2 -1
- data/templates/content/content/lectures/part2/02_continue_part2.md.erb +3 -2
- data/templates/layouts/banner.html.erb +4 -4
- data/templates/layouts/body_footer.html +3 -4
- data/templates/layouts/body_header.html.erb +25 -7
- data/templates/layouts/bottom_includes.html.erb +21 -10
- data/templates/layouts/course.html.erb +7 -21
- data/templates/layouts/helpful_box.html +1 -1
- data/templates/layouts/nav-menus.html.erb +16 -36
- data/templates/layouts/sidebar.html.erb +9 -8
- data/templates/layouts/slides.html.erb +69 -0
- data/templates/layouts/top_includes.html.erb +24 -23
- metadata +32 -24
- data/.DS_Store +0 -0
- data/.vscode/settings.json +0 -2
- data/templates/.DS_Store +0 -0
- data/templates/Guardfile +0 -9
- data/templates/content/bootstrap/css/tipuesearch.css +0 -163
- data/templates/content/bootstrap/js/tipuesearch.js +0 -379
- data/templates/content/bootstrap/js/tipuesearch.min.js +0 -12
- data/templates/content/bootstrap/js/tipuesearch_content.js +0 -13
- data/templates/content/bootstrap/js/tipuesearch_set.js +0 -23
- data/templates/layouts/main_navbar.html.erb +0 -21
@@ -1,64 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
}
|
10
|
-
|
11
|
-
.image-bg-fluid-height,
|
12
|
-
.image-bg-fixed-height {
|
13
|
-
text-align: center;
|
14
|
-
-webkit-background-size: cover;
|
15
|
-
-moz-background-size: cover;
|
16
|
-
background-size: cover;
|
17
|
-
-o-background-size: cover;
|
18
|
-
}
|
19
|
-
|
20
|
-
.image-bg-fluid-height {
|
21
|
-
background: url('/bootstrap/images/image4.jpg') no-repeat center center scroll;
|
22
|
-
padding: 100px 0;
|
23
|
-
}
|
24
|
-
|
25
|
-
.image-bg-fixed-height {
|
26
|
-
background: url('/bootstrap/images/image4.jpg') no-repeat center center scroll;
|
27
|
-
height: 70px;
|
28
|
-
}
|
29
|
-
|
30
|
-
.img-center {
|
31
|
-
margin: 0 auto;
|
32
|
-
}
|
33
|
-
|
34
|
-
section {
|
35
|
-
padding: 15px 0;
|
36
|
-
}
|
37
|
-
|
38
|
-
.section-heading {
|
39
|
-
margin: 30px 0;
|
40
|
-
font-size: 4em;
|
41
|
-
}
|
42
|
-
|
43
|
-
.section-lead {
|
44
|
-
margin: 30px 0;
|
45
|
-
}
|
46
|
-
|
47
|
-
.section-paragraph {
|
48
|
-
margin: 30px 0;
|
49
|
-
}
|
50
|
-
|
51
|
-
footer {
|
52
|
-
margin: 50px 0;
|
53
|
-
}
|
54
|
-
|
55
|
-
@media(max-width:768px) {
|
56
|
-
section {
|
57
|
-
padding-top: 25px;
|
58
|
-
padding-bottom: 25px;
|
59
|
-
}
|
60
|
-
|
61
|
-
.section-heading {
|
62
|
-
font-size: 2em;
|
63
|
-
}
|
64
|
-
}
|
1
|
+
.masthead {
|
2
|
+
height: 70px;
|
3
|
+
background-image: url('/bootstrap/images/image1.jpg');
|
4
|
+
background-size: cover;
|
5
|
+
background-position: center;
|
6
|
+
background-repeat: no-repeat;
|
7
|
+
|
8
|
+
}
|
@@ -3,7 +3,7 @@ title: Welcome!
|
|
3
3
|
section: extras
|
4
4
|
---
|
5
5
|
<div class="jumbotron">
|
6
|
-
<
|
6
|
+
<h1>Welcome to the Sample Course!</h1>
|
7
7
|
<p>This course is generated when you first install Coursegen. It uses all the features (almost) of the software, to allow you to see what is possible.</p>
|
8
8
|
|
9
9
|
<p>Pito Salas, pitosalas@brandeis.edu</p>
|
@@ -1,5 +1,4 @@
|
|
1
1
|
---
|
2
2
|
title: List of lectures
|
3
3
|
---
|
4
|
-
<%= list_of(source: "lectures", rows: ["subsection","page"], cols: [:number, :date, :title, :desc, :homework], items: @items) %>
|
5
4
|
<%= list_of(source: "lectures", rows: ["subsection","page"], cols: [:number, :date, :title, :cat, :desc, :homework], items: @items) %>
|
@@ -1,5 +1,26 @@
|
|
1
1
|
---
|
2
2
|
title: Second Lecture - Here we go
|
3
|
+
desc: Advanced Features
|
4
|
+
slides: true
|
3
5
|
---
|
4
|
-
|
6
|
+
## Continuing
|
7
|
+
|
5
8
|
This page is the second one in the first part. It is the second lecture of the Sample Course.
|
9
|
+
|
10
|
+
<%= slide %>
|
11
|
+
|
12
|
+
## Headings
|
13
|
+
|
14
|
+
# h1
|
15
|
+
|
16
|
+
## h2
|
17
|
+
|
18
|
+
### h3
|
19
|
+
|
20
|
+
#### h4
|
21
|
+
|
22
|
+
<%= slide %>
|
23
|
+
|
24
|
+
## Next Lecture
|
25
|
+
|
26
|
+
Click "Third Lecture" on the sidebar to go to the next lecture.
|
@@ -1,9 +1,9 @@
|
|
1
|
-
<aside class="
|
1
|
+
<aside class="masthead">
|
2
2
|
<div class="container">
|
3
3
|
<div class="row">
|
4
|
-
<div class="col-
|
5
|
-
<a
|
4
|
+
<div class="col-md-7">
|
5
|
+
<a href="/"><%= COURSE_SHORT_NAME %> - <%= COURSE_LONG_NAME %></a>
|
6
6
|
</div>
|
7
7
|
</div>
|
8
8
|
</div>
|
9
|
-
</aside>
|
9
|
+
</aside>
|
@@ -1,7 +1,25 @@
|
|
1
|
-
<
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
<div class="row">
|
2
|
+
<div class="col-12">
|
3
|
+
<h1>
|
4
|
+
<%= citem.title %>
|
5
|
+
<span style="font-size: 1rem;">
|
6
|
+
<% if citem.lecture? %>
|
7
|
+
(<%= citem.lecture_date_s %>, lect <%= citem.lecture_number.to_s %>, wk <%= ((citem.lecture_number)/2).to_s %>)
|
8
|
+
<span class="float-right">
|
9
|
+
<% if citem.lecture? && citem.section != "root" %>
|
10
|
+
| <%= link_to_prev(toc, item) %>
|
11
|
+
<% end %>
|
12
|
+
<% if citem.lecture? && citem.section != "root" %>
|
13
|
+
| <%=link_to_next(toc, item) %>
|
14
|
+
<% end %>
|
15
|
+
<% if citem.slides %> |
|
16
|
+
<%= link_to_slides %>
|
17
|
+
<% end %>
|
18
|
+
| <%= link_to_homework citem %>
|
19
|
+
</span>
|
20
|
+
<% end %>
|
21
|
+
</span>
|
22
|
+
</h1>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
<h3 class="subheader"><%= citem.desc %></h3>
|
@@ -1,15 +1,26 @@
|
|
1
|
-
|
2
1
|
<!-- Latest compiled and minified JavaScript -->
|
3
|
-
|
2
|
+
<!-- Optional JavaScript -->
|
3
|
+
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
|
4
|
+
integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
|
4
5
|
|
5
6
|
<script src="/bootstrap/js/custom.js"></script>
|
6
|
-
<script src="/
|
7
|
-
|
7
|
+
<script src="https://cdn.jsdelivr.net/npm/docsearch.js@2.6.3/dist/cdn/docsearch.min.js"></script>
|
8
8
|
<script>
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
9
|
+
docsearch({
|
10
|
+
// Your apiKey and indexName will be given to you once
|
11
|
+
// we create your config
|
12
|
+
apiKey: '<%= SEARCH_CONFIG[:api_key] %>',
|
13
|
+
indexName: '<%= SEARCH_CONFIG[:index_name] %>',
|
14
|
+
<% if SEARCH_CONFIG[:app_id] != '' %>
|
15
|
+
appId: '<%= SEARCH_CONFIG[:app_id] %>',
|
16
|
+
<% end %>
|
17
|
+
algoliaOptions: {
|
18
|
+
hitsPerPage: 30
|
19
|
+
},
|
20
|
+
// Replace inputSelector with a CSS selector
|
21
|
+
// matching your search input
|
22
|
+
inputSelector: '#tipue_search_input',
|
23
|
+
// Set debug to true to inspect the dropdown
|
24
|
+
debug: <%= SEARCH_CONFIG[:debug] %>,
|
25
|
+
});
|
15
26
|
</script>
|
@@ -1,5 +1,6 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html lang="en">
|
3
|
+
|
3
4
|
<head>
|
4
5
|
<%= render "/top_includes.*" %>
|
5
6
|
<title><%= @item[:title] %> - <%= COURSE_SHORT_NAME %></title>
|
@@ -7,38 +8,23 @@
|
|
7
8
|
|
8
9
|
<body>
|
9
10
|
<% @citem = Toc.instance.n2c(@item) %>
|
10
|
-
|
11
|
-
|
12
|
-
<%= render "/banner.*", toc: Toc.instance, item: item, citem: @citem %>
|
13
|
-
<%= render "/nav-menus.*", toc: Toc.instance, item: item, citem: @citem %>
|
14
|
-
</nav>
|
15
|
-
|
16
|
-
<!-- Content Section -->
|
11
|
+
<%= render "/banner.*", toc: Toc.instance, item: item, citem: @citem %>
|
12
|
+
<%= render "/nav-menus.*", toc: Toc.instance, item: item, citem: @citem %>
|
17
13
|
<section>
|
18
|
-
<div class="container-
|
14
|
+
<div class="container DocSearch-content">
|
19
15
|
<div class="row">
|
20
|
-
<div class="col-
|
16
|
+
<div class="col-md-9">
|
21
17
|
<%= render "/body_header.*", toc: Toc.instance, item: item, citem: @citem %>
|
22
|
-
</div>
|
23
|
-
</div>
|
24
|
-
<div class="row">
|
25
|
-
<div class="body-main col-sm-9">
|
26
18
|
<%= yield %>
|
27
19
|
</div>
|
28
20
|
<%= render "/sidebar.*" %>
|
29
|
-
<!-- /.row -->
|
30
21
|
</div>
|
31
|
-
<!-- /.container -->
|
32
22
|
</div>
|
33
23
|
</section>
|
34
|
-
|
24
|
+
<%= render "/bottom_includes.*" %>
|
35
25
|
<footer>
|
36
26
|
<%= render "/body_footer.*" %>
|
37
27
|
</footer>
|
38
|
-
|
39
|
-
<!-- jQuery -->
|
40
|
-
<%= render "/bottom_includes.*" %>
|
41
|
-
|
42
28
|
</body>
|
43
29
|
|
44
|
-
</html>
|
30
|
+
</html>
|
@@ -1,37 +1,17 @@
|
|
1
|
-
<
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
<div class="
|
10
|
-
<
|
11
|
-
<
|
12
|
-
<
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
</li>
|
17
|
-
<li>
|
18
|
-
<a href="/content/intro/15_nt_links.md/">NanoTwitter</a>
|
19
|
-
</li>
|
20
|
-
<li>
|
21
|
-
<a href="/content/topics/syllabus/cosi105b_final_deliverables.md/">Deliverables</a>
|
22
|
-
</li>
|
23
|
-
</ul>
|
24
|
-
<div class="navbar-control col-xs-3">
|
25
|
-
<form role="form" class="form-inline" action="/content/tipuesearch/search.md/index.html">
|
26
|
-
<div class="input-group input-group-sm">
|
27
|
-
<input type="text" class="form-control" placeholder="search..." name="q" id="tipue_search_input" autocomplete="off" required>
|
28
|
-
</div>
|
29
|
-
</form>
|
30
|
-
</div>
|
31
|
-
<div class="btn-group btn-group-xs col-xs-2">
|
32
|
-
<%if citem.section != "root" %>
|
33
|
-
<%= link_to_prev toc, item %> <%= link_to_next toc, item %>
|
34
|
-
<% end %>
|
35
|
-
</div>
|
1
|
+
<nav class="navbar navbar-expand-lg bg-dark py-0">
|
2
|
+
<nav class="nav py-0">
|
3
|
+
<% MENULINKS.each do |label, link| %>
|
4
|
+
<a class="nav-link py-0 text-light" href="<%= link %>">
|
5
|
+
<%= label %>
|
6
|
+
</a>
|
7
|
+
<% end %>
|
8
|
+
</nav>
|
9
|
+
<div class="navbar-control py-0">
|
10
|
+
<form role="form" class="form-inline">
|
11
|
+
<div class="input-group input-group-sm">
|
12
|
+
<input type="search" class="form-control" placeholder="search..." id="tipue_search_input"
|
13
|
+
autocomplete="off" required />
|
14
|
+
</div>
|
15
|
+
</form>
|
36
16
|
</div>
|
37
|
-
</
|
17
|
+
</nav>
|
@@ -1,13 +1,14 @@
|
|
1
|
-
<div class="col-
|
2
|
-
<% if
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
<div class="col-md-3 border rounded-lg sidebar">
|
2
|
+
<% if HELPFUL_BOX %>
|
3
|
+
<div class="row well"
|
4
|
+
style="color: rgb(158, 48, 48);padding: 4px 8px;margin-bottom: 8px;">
|
5
|
+
<%= render "/helpful_box.*" %>
|
6
|
+
</div>
|
7
|
+
<% end %>
|
8
|
+
<div class="row">
|
8
9
|
<ul>
|
9
10
|
<% SECTION_CONFIG.each do |sbb| %>
|
10
|
-
|
11
|
+
<%= section_helper(title: sbb.title, selector: sbb.selector) unless sbb.options[:hidden] %>
|
11
12
|
<% end %>
|
12
13
|
</ul>
|
13
14
|
</div>
|
@@ -0,0 +1,69 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<title><%= COURSE_SHORT_NAME %></title>
|
6
|
+
<meta name="apple-mobile-web-app-capable" content="yes">
|
7
|
+
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
9
|
+
<link rel="stylesheet" href="https://unpkg.com/reveal.js@4.0.2/dist/reset.css">
|
10
|
+
<link rel="stylesheet" href="https://unpkg.com/reveal.js@4.0.2/dist/reveal.css">
|
11
|
+
<link rel="stylesheet" href="https://unpkg.com/reveal.js@4.0.2/dist/theme/white.css" id="theme">
|
12
|
+
<!--[if lt IE 9]>
|
13
|
+
<script src="https://unpkg.com/reveal.js@4.0.2/lib/js/html5shiv.js"></script>
|
14
|
+
<![endif]-->
|
15
|
+
|
16
|
+
<!-- Custom CSS -->
|
17
|
+
<link rel="stylesheet" href="/bootstrap/css/customslides.css">
|
18
|
+
|
19
|
+
<style>
|
20
|
+
.scrollable {
|
21
|
+
bottom: 0;
|
22
|
+
overflow-y: auto !important;
|
23
|
+
overflow-x: hidden !important;
|
24
|
+
}
|
25
|
+
|
26
|
+
<% SLIDES_CONFIG[:ignore_selectors].each do |s| %>
|
27
|
+
.slides <%= s %> {
|
28
|
+
display: none;
|
29
|
+
}
|
30
|
+
<% end %>
|
31
|
+
</style>
|
32
|
+
</head>
|
33
|
+
|
34
|
+
<body>
|
35
|
+
<div class="reveal">
|
36
|
+
<div class="slides">
|
37
|
+
<section data-markdown data-separator="^<slide_break></slide_break>" class="scrollable">
|
38
|
+
<textarea data-template>
|
39
|
+
<%= yield %>
|
40
|
+
</textarea>
|
41
|
+
</section>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<script src="https://unpkg.com/reveal.js@4.0.2/dist/reveal.js"></script>
|
46
|
+
<!-- Plugins -->
|
47
|
+
<script src="https://unpkg.com/reveal.js@4.0.2/plugin/markdown/markdown.js"></script>
|
48
|
+
<script src="https://unpkg.com/reveal.js@4.0.2/plugin/highlight/highlight.js"></script>
|
49
|
+
|
50
|
+
<script>
|
51
|
+
// Full list of configuration options available at:
|
52
|
+
// https://github.com/hakimel/reveal.js#configuration
|
53
|
+
Reveal.initialize({
|
54
|
+
minScale: 0.2,
|
55
|
+
maxScale: 1.4,
|
56
|
+
|
57
|
+
markdown: {
|
58
|
+
breaks: true
|
59
|
+
},
|
60
|
+
|
61
|
+
<% SLIDES_CONFIG[:revealjs_opts].each do |k, v| %>
|
62
|
+
<%= k %>: <%= v.to_json %>,
|
63
|
+
<% end %>
|
64
|
+
|
65
|
+
// Optional reveal.js plugins
|
66
|
+
plugins: [ RevealMarkdown, RevealHighlight ]
|
67
|
+
})
|
68
|
+
</script>
|
69
|
+
</body>
|