coursegen 0.7.1 → 0.7.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +43 -35
- data/lib/coursegen/course/data/citem.rb +2 -1
- data/lib/coursegen/course/data/data_adaptor.rb +2 -0
- data/lib/coursegen/course/helpers/content_helpers.rb +79 -37
- data/lib/coursegen/course/helpers/list_of_helpers.rb +1 -0
- data/lib/coursegen/templates.rb +0 -3
- data/lib/coursegen/version.rb +1 -1
- data/templates/Guardfile +3 -3
- data/templates/Rules +21 -42
- data/templates/cg_config.rb +2 -1
- data/templates/cg_config.rb_sample +24 -30
- data/templates/content/bootstrap/css/custom.css +65 -23
- data/templates/content/bootstrap/css/full-width-pics.css +64 -0
- data/templates/content/bootstrap/css/prettyquote.css +31 -0
- data/templates/content/bootstrap/css/tipuesearch.css +163 -0
- data/templates/content/bootstrap/images/image1.jpg +0 -0
- data/templates/content/bootstrap/images/image10.jpg +0 -0
- data/templates/content/bootstrap/images/image2.jpg +0 -0
- data/templates/content/bootstrap/images/image22.jpg +0 -0
- data/templates/content/bootstrap/images/image3.png +0 -0
- data/templates/content/bootstrap/images/image4.jpg +0 -0
- data/templates/content/bootstrap/images/image8.jpg +0 -0
- data/templates/content/bootstrap/images/image8.png +0 -0
- data/templates/content/bootstrap/images/image9.jpg +0 -0
- data/templates/content/{tipuesearch/img → bootstrap/images}/loader.gif +0 -0
- data/templates/content/bootstrap/images/search.png +0 -0
- data/templates/content/{tipuesearch/tipuesearchnomin.js → bootstrap/js/tipuesearch.js} +106 -171
- data/templates/content/bootstrap/js/tipuesearch.min.js +12 -0
- data/templates/content/bootstrap/js/tipuesearch_content.js +13 -0
- data/templates/content/{tipuesearch → bootstrap/js}/tipuesearch_set.js +8 -7
- data/templates/content/content/intro/course_toc.md.erb +1 -0
- data/templates/layouts/banner.html.erb +9 -0
- data/templates/layouts/body_header.html.erb +4 -3
- data/templates/layouts/bottom_includes.html.erb +15 -0
- data/templates/layouts/course.html.erb +44 -0
- data/templates/layouts/main_navbar.html.erb +1 -1
- data/templates/layouts/nav-menus.html.erb +37 -0
- data/templates/layouts/sidebar.html.erb +14 -0
- data/templates/layouts/top_includes.html.erb +31 -0
- metadata +27 -19
- data/deleteme.rb +0 -2
- data/templates/body_footer.html +0 -8
- data/templates/body_header.html.erb +0 -6
- data/templates/content/chalkmark/chalkmark.js +0 -30
- data/templates/content/tipuesearch/img/search.png +0 -0
- data/templates/content/tipuesearch/tipuesearchmin.js +0 -14
- data/templates/content/tipuesearch_logic/search.md.erb +0 -8
- data/templates/content/tipuesearch_logic/tipuesearch_content.js.erb +0 -6
- data/templates/course.html +0 -59
- data/templates/helpful_box.html +0 -3
- data/templates/layouts/course.html +0 -59
- data/templates/main_navbar.html.erb +0 -21
@@ -0,0 +1,12 @@
|
|
1
|
+
(function($){$.fn.tipuesearch=function(options){var set=$.extend({"show":7,"newWindow":false,"showURL":true,"minimumLength":3,"descriptiveWords":25,"highlightTerms":true,"highlightEveryTerm":false,"mode":"static","liveDescription":"*","liveContent":"*","contentLocation":"tipuesearch/tipuesearch_content.json"},options);return this.each(function(){var tipuesearch_in={pages:[]};$.ajaxSetup({async:false});if(set.mode=="live")for(var i=0;i<tipuesearch_pages.length;i++)$.get(tipuesearch_pages[i],"",function(html){var cont=
|
2
|
+
$(set.liveContent,html).text();cont=cont.replace(/\s+/g," ");var desc=$(set.liveDescription,html).text();desc=desc.replace(/\s+/g," ");var t_1=html.toLowerCase().indexOf("<title>");var t_2=html.toLowerCase().indexOf("</title>",t_1+7);if(t_1!=-1&&t_2!=-1)var tit=html.slice(t_1+7,t_2);else var tit="No title";tipuesearch_in.pages.push({"title":tit,"text":desc,"tags":cont,"loc":tipuesearch_pages[i]})});if(set.mode=="json")$.getJSON(set.contentLocation,function(json){tipuesearch_in=$.extend({},json)});
|
3
|
+
if(set.mode=="static")tipuesearch_in=$.extend({},tipuesearch);var tipue_search_w="";if(set.newWindow)tipue_search_w=' target="_blank"';function getURLP(name){return decodeURIComponent(((new RegExp("[?|&]"+name+"="+"([^&;]+?)(&|#|;|$)")).exec(location.search)||[,""])[1].replace(/\+/g,"%20"))||null}if(getURLP("q")){$("#tipue_search_input").val(getURLP("q"));getTipueSearch(0,true)}$("#tipue_search_button").click(function(){getTipueSearch(0,true)});$(this).keyup(function(event){if(event.keyCode=="13")getTipueSearch(0,
|
4
|
+
true)});function getTipueSearch(start,replace){$("#tipue_search_content").hide();var out="";var results="";var show_replace=false;var show_stop=false;var d=$("#tipue_search_input").val().toLowerCase();d=$.trim(d);var d_w=d.split(" ");d="";for(var i=0;i<d_w.length;i++){var a_w=true;for(var f=0;f<tipuesearch_stop_words.length;f++)if(d_w[i]==tipuesearch_stop_words[f]){a_w=false;show_stop=true}if(a_w)d=d+" "+d_w[i]}d=$.trim(d);d_w=d.split(" ");if(d.length>=set.minimumLength){if(replace){var d_r=d;for(var i=
|
5
|
+
0;i<d_w.length;i++)for(var f=0;f<tipuesearch_replace.words.length;f++)if(d_w[i]==tipuesearch_replace.words[f].word){d=d.replace(d_w[i],tipuesearch_replace.words[f].replace_with);show_replace=true}d_w=d.split(" ")}var d_t=d;for(var i=0;i<d_w.length;i++)for(var f=0;f<tipuesearch_stem.words.length;f++)if(d_w[i]==tipuesearch_stem.words[f].word)d_t=d_t+" "+tipuesearch_stem.words[f].stem;d_w=d_t.split(" ");var c=0;found=new Array;for(var i=0;i<tipuesearch_in.pages.length;i++){var score=1E9;var s_t=tipuesearch_in.pages[i].text;
|
6
|
+
for(var f=0;f<d_w.length;f++){var pat=new RegExp(d_w[f],"i");if(tipuesearch_in.pages[i].title.search(pat)!=-1)score-=2E5-i;if(tipuesearch_in.pages[i].text.search(pat)!=-1)score-=15E4-i;if(set.highlightTerms){if(set.highlightEveryTerm)var patr=new RegExp("("+d_w[f]+")","gi");else var patr=new RegExp("("+d_w[f]+")","i");s_t=s_t.replace(patr,"<b>$1</b>")}if(tipuesearch_in.pages[i].tags.search(pat)!=-1)score-=1E5-i}if(score<1E9)found[c++]=score+"^"+tipuesearch_in.pages[i].title+"^"+s_t+"^"+tipuesearch_in.pages[i].loc}if(c!=
|
7
|
+
0){if(show_replace==1){out+='<div id="tipue_search_warning_head">Showing results for '+d+"</div>";out+='<div id="tipue_search_warning">Search for <a href="javascript:void(0)" id="tipue_search_replaced">'+d_r+"</a></div>"}if(c==1)out+='<div id="tipue_search_results_count">1 result</div>';else{c_c=c.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",");out+='<div id="tipue_search_results_count">'+c_c+" results</div>"}found.sort();var l_o=0;for(var i=0;i<found.length;i++){var fo=found[i].split("^");if(l_o>=
|
8
|
+
start&&l_o<set.show+start){out+='<div class="tipue_search_content_title"><a href="'+fo[3]+'"'+tipue_search_w+">"+fo[1]+"</a></div>";var t=fo[2];var t_d="";var t_w=t.split(" ");if(t_w.length<set.descriptiveWords)t_d=t;else for(var f=0;f<set.descriptiveWords;f++)t_d+=t_w[f]+" ";t_d=$.trim(t_d);if(t_d.charAt(t_d.length-1)!=".")t_d+=" ...";out+='<div class="tipue_search_content_text">'+t_d+"</div>";if(set.showURL)out+='<div class="tipue_search_content_loc"><a href="'+fo[3]+'"'+tipue_search_w+">"+fo[3]+
|
9
|
+
"</a></div>"}l_o++}if(c>set.show){var pages=Math.ceil(c/set.show);var page=start/set.show;out+='<div id="tipue_search_foot"><ul id="tipue_search_foot_boxes">';if(start>0)out+='<li><a href="javascript:void(0)" class="tipue_search_foot_box" id="'+(start-set.show)+"_"+replace+'">« Prev</a></li>';if(page<=2){var p_b=pages;if(pages>3)p_b=3;for(var f=0;f<p_b;f++)if(f==page)out+='<li class="current">'+(f+1)+"</li>";else out+='<li><a href="javascript:void(0)" class="tipue_search_foot_box" id="'+f*set.show+
|
10
|
+
"_"+replace+'">'+(f+1)+"</a></li>"}else{var p_b=pages+2;if(p_b>pages)p_b=pages;for(var f=page;f<p_b;f++)if(f==page)out+='<li class="current">'+(f+1)+"</li>";else out+='<li><a href="javascript:void(0)" class="tipue_search_foot_box" id="'+f*set.show+"_"+replace+'">'+(f+1)+"</a></li>"}if(page+1!=pages)out+='<li><a href="javascript:void(0)" class="tipue_search_foot_box" id="'+(start+set.show)+"_"+replace+'">Next »</a></li>';out+="</ul></div>"}}else out+='<div id="tipue_search_warning_head">Nothing found</div>'}else if(show_stop)out+=
|
11
|
+
'<div id="tipue_search_warning_head">Nothing found</div><div id="tipue_search_warning">Common words are largely ignored</div>';else{out+='<div id="tipue_search_warning_head">Search too short</div>';if(set.minimumLength==1)out+='<div id="tipue_search_warning">Should be one character or more</div>';else out+='<div id="tipue_search_warning">Should be '+set.minimumLength+" characters or more</div>"}$("#tipue_search_content").html(out);$("#tipue_search_content").slideDown(200);$("#tipue_search_replaced").click(function(){getTipueSearch(0,
|
12
|
+
false)});$(".tipue_search_foot_box").click(function(){var id_v=$(this).attr("id");var id_a=id_v.split("_");getTipueSearch(parseInt(id_a[0]),id_a[1])})}})}})(jQuery);
|
@@ -0,0 +1,13 @@
|
|
1
|
+
var tipuesearch = {"pages": [
|
2
|
+
{"title": "Tipue Search, a site search engine jQuery plugin", "text": "Tipue Search is a site search engine jQuery plugin. Tipue Search is open source and released under the MIT License, which means it's free for both commercial and non-commercial use. Tipue Search is responsive and works on all reasonably modern browsers.", "tags": "JavaScript", "loc": "http://www.tipue.com/search"},
|
3
|
+
{"title": "Tipue Search Static mode demo", "text": "This is a demo of Tipue Search Static mode.", "tags": "", "loc": "http://www.tipue.com/search/demos/static"},
|
4
|
+
{"title": "Tipue Image Search demo", "text": "This is a demo of Tipue Image Search.", "tags": "", "loc": "http://www.tipue.com/search/demos/images"},
|
5
|
+
{"title": "Tipue Search docs", "text": "If you haven't already done so, download Tipue Search. Copy the tipuesearch folder to your site.", "tags": "documentation", "loc": "http://www.tipue.com/search/docs"},
|
6
|
+
{"title": "Tipue drop, a search suggestion box jQuery plugin", "text": "Tipue drop is a search suggestion box jQuery plugin. Tipue drop is open source and released under the MIT License, which means it's free for both commercial and non-commercial use. Tipue drop is responsive and works on all reasonably modern browsers.", "tags": "JavaScript", "loc": "http://www.tipue.com/drop"},
|
7
|
+
{"title": "Tipue drop demo", "text": "Tipue drop demo. Tipue drop is a search suggestion box jQuery plugin.", "tags": "JavaScript", "loc": "http://www.tipue.com/drop/demo"},
|
8
|
+
{"title": "Support plans", "text": "Stuck? We offer a range of flexible support plans for our jQuery plugins.", "tags": "", "loc": "http://www.tipue.com/support"},
|
9
|
+
{"title": "About Tipue", "text": "Tipue is a small web development studio based in North London. We've been around for over a decade. We like Perl, MySQL and jQuery.", "tags": "", "loc": "http://www.tipue.com/about"}
|
10
|
+
]};
|
11
|
+
|
12
|
+
|
13
|
+
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
/*
|
3
|
-
Tipue Search
|
4
|
-
Copyright (c)
|
3
|
+
Tipue Search 3.1
|
4
|
+
Copyright (c) 2013 Tipue
|
5
5
|
Tipue Search is released under the MIT License
|
6
6
|
http://www.tipue.com/search
|
7
7
|
*/
|
@@ -10,13 +10,14 @@ http://www.tipue.com/search
|
|
10
10
|
var tipuesearch_stop_words = ["and", "be", "by", "do", "for", "he", "how", "if", "is", "it", "my", "not", "of", "or", "the", "to", "up", "what", "when"];
|
11
11
|
|
12
12
|
var tipuesearch_replace = {"words": [
|
13
|
-
{"word": "tipua",
|
14
|
-
{"word": "javscript",
|
13
|
+
{"word": "tipua", replace_with: "tipue"},
|
14
|
+
{"word": "javscript", replace_with: "javascript"}
|
15
15
|
]};
|
16
16
|
|
17
17
|
var tipuesearch_stem = {"words": [
|
18
|
-
{"word": "e-mail",
|
19
|
-
{"word": "javascript",
|
20
|
-
{"word": "javascript",
|
18
|
+
{"word": "e-mail", stem: "email"},
|
19
|
+
{"word": "javascript", stem: "script"},
|
20
|
+
{"word": "javascript", stem: "js"}
|
21
21
|
]};
|
22
22
|
|
23
|
+
|
@@ -2,3 +2,4 @@
|
|
2
2
|
title: List of lectures
|
3
3
|
---
|
4
4
|
<%= list_of(source: "lectures", rows: ["subsection","page"], cols: [:number, :date, :title, :desc, :homework], items: @items) %>
|
5
|
+
<%= list_of(source: "lectures", rows: ["subsection","page"], cols: [:number, :date, :title, :cat, :desc, :homework], items: @items) %>
|
@@ -1,6 +1,7 @@
|
|
1
|
-
<h3>
|
1
|
+
<h3 class="body-header">
|
2
2
|
<%= citem.title %>
|
3
3
|
<% if citem.lecture? %>
|
4
|
-
<small
|
4
|
+
<small>(<%= citem.lecture_date_s %>, <%= citem.lecture_number_s.to_s %>)</small>
|
5
5
|
<% end %>
|
6
|
-
</
|
6
|
+
<br/><small> <%= citem.desc %> </small>
|
7
|
+
</h3>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
|
2
|
+
<!-- Latest compiled and minified JavaScript -->
|
3
|
+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
|
4
|
+
|
5
|
+
<script src="/bootstrap/js/custom.js"></script>
|
6
|
+
<script src="/tipuesearch/tipuesearch_content.js"></script>
|
7
|
+
|
8
|
+
<script>
|
9
|
+
$(document).ready(function() {
|
10
|
+
$('#tipue_search_input').tipuesearch({
|
11
|
+
'show': 20,
|
12
|
+
'contextBuffer': 100
|
13
|
+
});
|
14
|
+
});
|
15
|
+
</script>
|
@@ -0,0 +1,44 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<%= render "/top_includes.*" %>
|
5
|
+
<title><%= @item[:title] %> - <%= COURSE_SHORT_NAME %></title>
|
6
|
+
</head>
|
7
|
+
|
8
|
+
<body>
|
9
|
+
<% @citem = Toc.instance.n2c(@item) %>
|
10
|
+
<!-- Navigation -->
|
11
|
+
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
|
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 -->
|
17
|
+
<section>
|
18
|
+
<div class="container-fluid">
|
19
|
+
<div class="row">
|
20
|
+
<div class="col-sm-12 header-main">
|
21
|
+
<%= 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
|
+
<%= yield %>
|
27
|
+
</div>
|
28
|
+
<%= render "/sidebar.*" %>
|
29
|
+
<!-- /.row -->
|
30
|
+
</div>
|
31
|
+
<!-- /.container -->
|
32
|
+
</div>
|
33
|
+
</section>
|
34
|
+
<!-- Footer -->
|
35
|
+
<footer>
|
36
|
+
<%= render "/body_footer.*" %>
|
37
|
+
</footer>
|
38
|
+
|
39
|
+
<!-- jQuery -->
|
40
|
+
<%= render "/bottom_includes.*" %>
|
41
|
+
|
42
|
+
</body>
|
43
|
+
|
44
|
+
</html>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<a class="navbar-brand" href="/"><%= COURSE_SHORT_NAME %> - <%= COURSE_LONG_NAME %></a>
|
5
5
|
</div>
|
6
6
|
<div class="col-xs-2">
|
7
|
-
<div class="btn-group
|
7
|
+
<div class="btn-group">
|
8
8
|
<%if citem.section != "root" %>
|
9
9
|
<%= link_to_prev toc, item %> <%= link_to_next toc, item %>
|
10
10
|
<% end %>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<div class="container">
|
2
|
+
<div class="row">
|
3
|
+
<button class="navbar-toggle" data-toggle="collapse" data-target=".navHeaderCollapse">
|
4
|
+
<span class="sr-only">Toggle navigation</span>
|
5
|
+
<span class="icon-bar"></span>
|
6
|
+
<span class="icon-bar"></span>
|
7
|
+
<span class="icon-bar"></span>
|
8
|
+
</button>
|
9
|
+
<div class="collapse navbar-collapse navHeaderCollapse">
|
10
|
+
<ul class="nav navbar-nav col-xs-7">
|
11
|
+
<li>
|
12
|
+
<a href="/content/intro/10_course_toc.md/">TOC</a>
|
13
|
+
</li>
|
14
|
+
<li>
|
15
|
+
<a href="/content/topics/nt/nt_outline.md/">Project Outline</a>
|
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>
|
36
|
+
</div>
|
37
|
+
</div>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<div class="col-xs-3">
|
2
|
+
<% if (HELPFUL_BOX) %>
|
3
|
+
<div class="row well right-nav" style="color: rgb(158, 48, 48);padding-top: 4px;padding-bottom: 4px;padding-left: 8px;padding-right: 8px;margin-bottom: 8px;">
|
4
|
+
<%= render "/helpful_box.*" %>
|
5
|
+
</div>
|
6
|
+
<% end %>
|
7
|
+
<div class="row well right-nav" style="padding: 5px;">
|
8
|
+
<ul>
|
9
|
+
<% SECTION_CONFIG.each do |sbb| %>
|
10
|
+
<%= section_helper(title: sbb.title, selector: sbb.selector) unless sbb.options[:hidden] %>
|
11
|
+
<% end %>
|
12
|
+
</ul>
|
13
|
+
</div>
|
14
|
+
</div>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<meta charset="utf-8">
|
2
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
3
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
4
|
+
<meta name="description" content="">
|
5
|
+
<meta name="author" content="">
|
6
|
+
|
7
|
+
<!-- Latest compiled and minified CSS -->
|
8
|
+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
9
|
+
|
10
|
+
<!-- Custom CSS -->
|
11
|
+
<link rel="stylesheet" href="/bootstrap/css/custom.css">
|
12
|
+
<link rel="stylesheet" href="/bootstrap/css/full-width-pics.css" >
|
13
|
+
|
14
|
+
<!-- tipueserch -->
|
15
|
+
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400">
|
16
|
+
|
17
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
|
18
|
+
|
19
|
+
<script src="/tipuesearch/tipuesearch_content.js"></script>
|
20
|
+
<link rel="stylesheet" href="/bootstrap/css/tipuesearch.css">
|
21
|
+
<script src="/bootstrap/js/tipuesearch_set.js"></script>
|
22
|
+
<script src="/bootstrap/js/tipuesearch.min.js"></script>
|
23
|
+
<!-- end tipueserch -->
|
24
|
+
|
25
|
+
|
26
|
+
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
27
|
+
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
28
|
+
<!--[if lt IE 9]>
|
29
|
+
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
30
|
+
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
31
|
+
<![endif]-->
|
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.7.
|
4
|
+
version: 0.7.6
|
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: 2019-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -237,7 +237,6 @@ files:
|
|
237
237
|
- Rakefile
|
238
238
|
- bin/cg
|
239
239
|
- coursegen.gemspec
|
240
|
-
- deleteme.rb
|
241
240
|
- lib/coursegen.rb
|
242
241
|
- lib/coursegen/cli.rb
|
243
242
|
- lib/coursegen/course/data/citem.rb
|
@@ -277,14 +276,29 @@ files:
|
|
277
276
|
- templates/.gitignore
|
278
277
|
- templates/Guardfile
|
279
278
|
- templates/Rules
|
280
|
-
- templates/body_footer.html
|
281
|
-
- templates/body_header.html.erb
|
282
279
|
- templates/cg_config.rb
|
283
280
|
- templates/cg_config.rb_sample
|
284
281
|
- templates/content/bootstrap/css/custom.css
|
282
|
+
- templates/content/bootstrap/css/full-width-pics.css
|
283
|
+
- templates/content/bootstrap/css/prettyquote.css
|
284
|
+
- templates/content/bootstrap/css/tipuesearch.css
|
285
285
|
- templates/content/bootstrap/fonts/glyphicons-halflings-regular.ttf
|
286
|
+
- templates/content/bootstrap/images/image1.jpg
|
287
|
+
- templates/content/bootstrap/images/image10.jpg
|
288
|
+
- templates/content/bootstrap/images/image2.jpg
|
289
|
+
- templates/content/bootstrap/images/image22.jpg
|
290
|
+
- templates/content/bootstrap/images/image3.png
|
291
|
+
- templates/content/bootstrap/images/image4.jpg
|
292
|
+
- templates/content/bootstrap/images/image8.jpg
|
293
|
+
- templates/content/bootstrap/images/image8.png
|
294
|
+
- templates/content/bootstrap/images/image9.jpg
|
295
|
+
- templates/content/bootstrap/images/loader.gif
|
296
|
+
- templates/content/bootstrap/images/search.png
|
286
297
|
- templates/content/bootstrap/js/custom.js
|
287
|
-
- templates/content/
|
298
|
+
- templates/content/bootstrap/js/tipuesearch.js
|
299
|
+
- templates/content/bootstrap/js/tipuesearch.min.js
|
300
|
+
- templates/content/bootstrap/js/tipuesearch_content.js
|
301
|
+
- templates/content/bootstrap/js/tipuesearch_set.js
|
288
302
|
- templates/content/content/extras/extra_content.md.erb
|
289
303
|
- templates/content/content/index.md.erb
|
290
304
|
- templates/content/content/intro/course_toc.md.erb
|
@@ -296,23 +310,18 @@ files:
|
|
296
310
|
- templates/content/content/lectures/part2/02_continue_part2.md.erb
|
297
311
|
- templates/content/content/lectures/part2/index.html
|
298
312
|
- templates/content/content/lectures/schedule.ical.erb
|
299
|
-
- templates/content/tipuesearch/img/loader.gif
|
300
|
-
- templates/content/tipuesearch/img/search.png
|
301
|
-
- templates/content/tipuesearch/tipuesearch_set.js
|
302
|
-
- templates/content/tipuesearch/tipuesearchmin.js
|
303
|
-
- templates/content/tipuesearch/tipuesearchnomin.js
|
304
|
-
- templates/content/tipuesearch_logic/search.md.erb
|
305
|
-
- templates/content/tipuesearch_logic/tipuesearch_content.js.erb
|
306
|
-
- templates/course.html
|
307
313
|
- templates/doc/readme.md
|
308
|
-
- templates/
|
314
|
+
- templates/layouts/banner.html.erb
|
309
315
|
- templates/layouts/body_footer.html
|
310
316
|
- templates/layouts/body_header.html.erb
|
311
|
-
- templates/layouts/
|
317
|
+
- templates/layouts/bottom_includes.html.erb
|
318
|
+
- templates/layouts/course.html.erb
|
312
319
|
- templates/layouts/helpful_box.html
|
313
320
|
- templates/layouts/main_navbar.html.erb
|
321
|
+
- templates/layouts/nav-menus.html.erb
|
322
|
+
- templates/layouts/sidebar.html.erb
|
323
|
+
- templates/layouts/top_includes.html.erb
|
314
324
|
- templates/lib/default.rb
|
315
|
-
- templates/main_navbar.html.erb
|
316
325
|
homepage: ''
|
317
326
|
licenses:
|
318
327
|
- MIT
|
@@ -332,8 +341,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
332
341
|
- !ruby/object:Gem::Version
|
333
342
|
version: '0'
|
334
343
|
requirements: []
|
335
|
-
|
336
|
-
rubygems_version: 2.7.3
|
344
|
+
rubygems_version: 3.0.1
|
337
345
|
signing_key:
|
338
346
|
specification_version: 4
|
339
347
|
summary: Use Nanoc to build courses and deploy them to S3
|
data/deleteme.rb
DELETED
data/templates/body_footer.html
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
function handle_helpful_link(yesno) {
|
2
|
-
$.ajax({
|
3
|
-
url: "http://chalkmark.herokuapp.com/api/helpful/vote/",
|
4
|
-
data: {url: document.title, value: yesno},
|
5
|
-
dataType: "jsonp",
|
6
|
-
success: function(data) { display_visit_stats(data); }}
|
7
|
-
)};
|
8
|
-
|
9
|
-
function display_visit_stats(response) {
|
10
|
-
yes_votes = response.true;
|
11
|
-
no_votes = response.false;
|
12
|
-
if (yes_votes > 0 || no_votes > 0) {
|
13
|
-
$("#helpful").addClass("text-center").html("<small>votes so far: Yes: " + response.true + " No: " + response.false + "</small>");
|
14
|
-
}
|
15
|
-
}
|
16
|
-
|
17
|
-
$("#yes-link").click( function() { handle_helpful_link("yes");});
|
18
|
-
$("#no-link").click( function() { handle_helpful_link("no");});
|
19
|
-
|
20
|
-
function record_visit() {
|
21
|
-
$.ajax({
|
22
|
-
url: "http://chalkmark.herokuapp.com/api/helpful/visiting/",
|
23
|
-
data: {url: document.title},
|
24
|
-
dataType: "jsonp",
|
25
|
-
success: function(data) { display_visit_stats(data) }}
|
26
|
-
)};
|
27
|
-
|
28
|
-
$(function() {
|
29
|
-
record_visit();
|
30
|
-
});
|
Binary file
|
@@ -1,14 +0,0 @@
|
|
1
|
-
(function($){$.fn.tipuesearch=function(options){var set=$.extend({"show":7,"newWindow":false,"showURL":true,"minimumLength":3,"descriptiveWords":25,"highlightTerms":true,"highlightEveryTerm":false,"mode":"static","liveDescription":"*","liveContent":"*","contentLocation":"tipuesearch/tipuesearch_content.json"},options);return this.each(function(){var tipuesearch_in={pages:[]};$.ajaxSetup({async:false});if(set.mode=="live")for(var i=0;i<tipuesearch_pages.length;i++)$.get(tipuesearch_pages[i],"",function(html){var cont=
|
2
|
-
$(set.liveContent,html).text();cont=cont.replace(/\s+/g," ");var desc=$(set.liveDescription,html).text();desc=desc.replace(/\s+/g," ");var t_1=html.toLowerCase().indexOf("<title>");var t_2=html.toLowerCase().indexOf("</title>",t_1+7);if(t_1!=-1&&t_2!=-1)var tit=html.slice(t_1+7,t_2);else var tit="No title";tipuesearch_in.pages.push({"title":tit,"text":desc,"tags":cont,"loc":tipuesearch_pages[i]})});if(set.mode=="json")$.getJSON(set.contentLocation,function(json){tipuesearch_in=$.extend({},json)});
|
3
|
-
if(set.mode=="static")tipuesearch_in=$.extend({},tipuesearch);var tipue_search_w="";if(set.newWindow)tipue_search_w=' target="_blank"';function getURLP(name){return decodeURIComponent(((new RegExp("[?|&]"+name+"="+"([^&;]+?)(&|#|;|$)")).exec(location.search)||[,""])[1].replace(/\+/g,"%20"))||null}if(getURLP("q")){$("#tipue_search_input").val(getURLP("q"));getTipueSearch(0,true)}$(this).keyup(function(event){if(event.keyCode=="13")getTipueSearch(0,true)});function getTipueSearch(start,replace){$("#tipue_search_content").hide();
|
4
|
-
var out="";var results="";var show_replace=false;var show_stop=false;var standard=true;var c=0;found=new Array;var d=$("#tipue_search_input").val().toLowerCase();d=$.trim(d);if(d.match('^"')&&d.match('"$')||d.match("^'")&&d.match("'$"))standard=false;if(standard){var d_w=d.split(" ");d="";for(var i=0;i<d_w.length;i++){var a_w=true;for(var f=0;f<tipuesearch_stop_words.length;f++)if(d_w[i]==tipuesearch_stop_words[f]){a_w=false;show_stop=true}if(a_w)d=d+" "+d_w[i]}d=$.trim(d);d_w=d.split(" ")}else d=
|
5
|
-
d.substring(1,d.length-1);if(d.length>=set.minimumLength){if(standard){if(replace){var d_r=d;for(var i=0;i<d_w.length;i++)for(var f=0;f<tipuesearch_replace.words.length;f++)if(d_w[i]==tipuesearch_replace.words[f].word){d=d.replace(d_w[i],tipuesearch_replace.words[f].replace_with);show_replace=true}d_w=d.split(" ")}var d_t=d;for(var i=0;i<d_w.length;i++)for(var f=0;f<tipuesearch_stem.words.length;f++)if(d_w[i]==tipuesearch_stem.words[f].word)d_t=d_t+" "+tipuesearch_stem.words[f].stem;d_w=d_t.split(" ");
|
6
|
-
for(var i=0;i<tipuesearch_in.pages.length;i++){var score=1E9;var s_t=tipuesearch_in.pages[i].text;for(var f=0;f<d_w.length;f++){var pat=new RegExp(d_w[f],"i");if(tipuesearch_in.pages[i].title.search(pat)!=-1)score-=2E5-i;if(tipuesearch_in.pages[i].text.search(pat)!=-1)score-=15E4-i;if(set.highlightTerms){if(set.highlightEveryTerm)var patr=new RegExp("("+d_w[f]+")","gi");else var patr=new RegExp("("+d_w[f]+")","i");s_t=s_t.replace(patr,'<span class="h01">$1</span>')}if(tipuesearch_in.pages[i].tags.search(pat)!=
|
7
|
-
-1)score-=1E5-i;if(d_w[f].match("^-")){pat=new RegExp(d_w[f].substring(1),"i");if(tipuesearch_in.pages[i].title.search(pat)!=-1||tipuesearch_in.pages[i].text.search(pat)!=-1||tipuesearch_in.pages[i].tags.search(pat)!=-1)score=1E9}}if(score<1E9)found[c++]=score+"^"+tipuesearch_in.pages[i].title+"^"+s_t+"^"+tipuesearch_in.pages[i].loc}}else for(var i=0;i<tipuesearch_in.pages.length;i++){var score=1E9;var s_t=tipuesearch_in.pages[i].text;var pat=new RegExp(d,"i");if(tipuesearch_in.pages[i].title.search(pat)!=
|
8
|
-
-1)score-=2E5-i;if(tipuesearch_in.pages[i].text.search(pat)!=-1)score-=15E4-i;if(set.highlightTerms){if(set.highlightEveryTerm)var patr=new RegExp("("+d+")","gi");else var patr=new RegExp("("+d+")","i");s_t=s_t.replace(patr,'<span class="h01">$1</span>')}if(tipuesearch_in.pages[i].tags.search(pat)!=-1)score-=1E5-i;if(score<1E9)found[c++]=score+"^"+tipuesearch_in.pages[i].title+"^"+s_t+"^"+tipuesearch_in.pages[i].loc}if(c!=0){if(show_replace==1){out+='<div id="tipue_search_warning_head">Showing results for '+
|
9
|
-
d+"</div>";out+='<div id="tipue_search_warning">Search instead for <a href="javascript:void(0)" id="tipue_search_replaced">'+d_r+"</a></div>"}if(c==1)out+='<div id="tipue_search_results_count">1 result</div>';else{c_c=c.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",");out+='<div id="tipue_search_results_count">'+c_c+" results</div>"}found.sort();var l_o=0;for(var i=0;i<found.length;i++){var fo=found[i].split("^");if(l_o>=start&&l_o<set.show+start){out+='<div class="tipue_search_content_title"><a href="'+
|
10
|
-
fo[3]+'"'+tipue_search_w+">"+fo[1]+"</a></div>";if(set.showURL)out+='<div class="tipue_search_content_url"><a href="'+fo[3]+'"'+tipue_search_w+">"+fo[3]+"</a></div>";var t=fo[2];var t_d="";var t_w=t.split(" ");if(t_w.length<set.descriptiveWords)t_d=t;else for(var f=0;f<set.descriptiveWords;f++)t_d+=t_w[f]+" ";t_d=$.trim(t_d);if(t_d.charAt(t_d.length-1)!=".")t_d+=" ...";out+='<div class="tipue_search_content_text">'+t_d+"</div>"}l_o++}if(c>set.show){var pages=Math.ceil(c/set.show);var page=start/set.show;
|
11
|
-
out+='<div id="tipue_search_foot"><ul id="tipue_search_foot_boxes">';if(start>0)out+='<li><a href="javascript:void(0)" class="tipue_search_foot_box" id="'+(start-set.show)+"_"+replace+'">Prev</a></li>';if(page<=2){var p_b=pages;if(pages>3)p_b=3;for(var f=0;f<p_b;f++)if(f==page)out+='<li class="current">'+(f+1)+"</li>";else out+='<li><a href="javascript:void(0)" class="tipue_search_foot_box" id="'+f*set.show+"_"+replace+'">'+(f+1)+"</a></li>"}else{var p_b=page+2;if(p_b>pages)p_b=pages;for(var f=page-
|
12
|
-
1;f<p_b;f++)if(f==page)out+='<li class="current">'+(f+1)+"</li>";else out+='<li><a href="javascript:void(0)" class="tipue_search_foot_box" id="'+f*set.show+"_"+replace+'">'+(f+1)+"</a></li>"}if(page+1!=pages)out+='<li><a href="javascript:void(0)" class="tipue_search_foot_box" id="'+(start+set.show)+"_"+replace+'">Next</a></li>';out+="</ul></div>"}}else out+='<div id="tipue_search_warning_head">Nothing found</div>'}else if(show_stop)out+='<div id="tipue_search_warning_head">Nothing found</div><div id="tipue_search_warning">Common words are largely ignored</div>';
|
13
|
-
else{out+='<div id="tipue_search_warning_head">Search too short</div>';if(set.minimumLength==1)out+='<div id="tipue_search_warning">Should be one character or more</div>';else out+='<div id="tipue_search_warning">Should be '+set.minimumLength+" characters or more</div>"}$("#tipue_search_content").html(out);$("#tipue_search_content").slideDown(200);$("#tipue_search_replaced").click(function(){getTipueSearch(0,false)});$(".tipue_search_foot_box").click(function(){var id_v=$(this).attr("id");var id_a=
|
14
|
-
id_v.split("_");getTipueSearch(parseInt(id_a[0]),id_a[1])})}})}})(jQuery);
|
@@ -1,8 +0,0 @@
|
|
1
|
-
---
|
2
|
-
title: Search Results
|
3
|
-
section: extras
|
4
|
-
---
|
5
|
-
|
6
|
-
> *note: for now, each search result includes the first several lines of the page, which may or may not include the occurences of the words you searched for. Don't let that make you think that the search didn't work. It's just that the results page can be improved (a lot)*
|
7
|
-
|
8
|
-
<div id="tipue_search_content"></div>
|
data/templates/course.html
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
<!DOCTYPE HTML>
|
2
|
-
<html lang="en">
|
3
|
-
<head>
|
4
|
-
<title><%= @item[:title] %> - <%= COURSE_SHORT_NAME %></title>
|
5
|
-
<meta charset="utf-8">
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7
|
-
|
8
|
-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
9
|
-
|
10
|
-
<link rel="stylesheet" href="/bootstrap/css/custom.css">
|
11
|
-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
|
12
|
-
<script src="/tipuesearch/tipuesearch_set.js"></script>
|
13
|
-
<script src="/tipuesearch/tipuesearch_content.js"></script>
|
14
|
-
<script src="/tipuesearch/tipuesearchmin.js"></script>
|
15
|
-
|
16
|
-
<!-- you don't need to keep this, but it's cool for stats! -->
|
17
|
-
<meta name="generator" content="nanoc <%= Nanoc::VERSION %>">
|
18
|
-
</head>
|
19
|
-
<body>
|
20
|
-
|
21
|
-
<% @citem = Toc.instance.n2c(@item) %>
|
22
|
-
<div class="themebg navbar navbar-inverse navbar-fixed-top">
|
23
|
-
<%= render "/main_navbar.*", toc: Toc.instance, item: item, citem: @citem %>
|
24
|
-
</div>
|
25
|
-
<div class="container">
|
26
|
-
<div class="row">
|
27
|
-
<div class="col-xs-12">
|
28
|
-
<%= render "/body_header.*", toc: Toc.instance, item: item, citem: @citem %>
|
29
|
-
</div>
|
30
|
-
</div>
|
31
|
-
<div class="row">
|
32
|
-
<div class="col-xs-9">
|
33
|
-
<%= yield %>
|
34
|
-
</div>
|
35
|
-
<div class="col-xs-3">
|
36
|
-
<div class="row well right-nav helpful" style="color: rgb(158, 48, 48);padding-top: 4px;padding-bottom: 4px;padding-left: 8px;padding-right: 8px;margin-bottom: 8px;">
|
37
|
-
<%= render "/helpful_box.*" %>
|
38
|
-
</div>
|
39
|
-
<div class="row well right-nav" style="padding: 5px;">
|
40
|
-
<ul>
|
41
|
-
<% SECTION_CONFIG.each do |sbb| %>
|
42
|
-
<%= section_helper(title: sbb.title, selector: sbb.selector) unless sbb.options[:hidden] %>
|
43
|
-
<% end %>
|
44
|
-
</ul>
|
45
|
-
</div>
|
46
|
-
</div>
|
47
|
-
</div>
|
48
|
-
<%= render "/body_footer.*" %>
|
49
|
-
</div>
|
50
|
-
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
|
51
|
-
<!-- Include all compiled plugins (below), or include individual files as needed -->
|
52
|
-
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
|
53
|
-
<script src="/bootstrap/js/custom.js"></script>
|
54
|
-
<script src="/chalkmark/chalkmark.js"></script>
|
55
|
-
<script> $(document).ready(function() {
|
56
|
-
$('#tipue_search_input').tipuesearch({'highlightEveryTerm': true, 'show': 8, 'showURL': false, 'descriptiveWords': 50});
|
57
|
-
});</script>
|
58
|
-
</body>
|
59
|
-
</html>
|