Merge branch 'gh-pages' into adding-jquery-debugging
authorGreg Wilson <gvwilson@third-bit.com>
Fri, 7 Oct 2016 16:41:55 +0000 (12:41 -0400)
committerGreg Wilson <gvwilson@third-bit.com>
Fri, 7 Oct 2016 16:41:55 +0000 (12:41 -0400)
19 files changed:
_includes/all_keypoints.html
_includes/carpentries.html
_includes/episode_break.html
_includes/episode_navbar.html [new file with mode: 0644]
_includes/episode_overview.html
_includes/episode_title.html
_includes/javascript.html
_includes/lesson_footer.html
_includes/main_title.html
_includes/navbar.html
_includes/syllabus.html
_includes/workshop_footer.html
_layouts/base.html
_layouts/break.html
_layouts/episode.html
_layouts/workshop.html
bin/lesson_check.py
bin/lesson_initialize.py
bin/markdown_ast.rb

index e2c901c2158a279a35d20298a27697d854442554..8563df340a8df11ffb4a23e27c15f31be15ed56b 100644 (file)
@@ -7,7 +7,7 @@
   {% unless episode.break %}
     <tr>
       <td class="col-md-3">
-        <a href="{{ site.github.url }}{{ episode.url }}">{{ episode.title }}</a>
+        <a href="{{ page.root }}{{ episode.url }}">{{ episode.title }}</a>
       </td>
       <td class="col-md-9">
         <ul>
index a233117a0a8e308c32c8829dc43c0e6614f4684a..69e2e1cc59b859a60245e02ffb3e9f3eeafd3f4e 100644 (file)
@@ -1,6 +1,6 @@
 <div class="row">
   <div class="col-md-2" align="center">
-    <a href="{{ site.swc_site }}"><img src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" /></a>
+    <a href="{{ site.swc_site }}"><img src="{{ page.root }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" /></a>
   </div>
   <div class="col-md-8">
     Since 1998,
@@ -14,7 +14,7 @@
 <br/>
 <div class="row">
   <div class="col-md-2" align="center">
-    <a href="{{ site.dc_site }}"><img src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" /></a>
+    <a href="{{ site.dc_site }}"><img src="{{ page.root }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" /></a>
   </div>
   <div class="col-md-8">
     <a href="{{ site.dc_site }}">Data Carpentry</a> develops and teaches workshops on the fundamental data skills needed to conduct research.
index 81fd39e84ee158cc5c2155cadaadc1fc870e0e0d..36d2d2fad9a51547b01374f3f0df311b313b4f23 100644 (file)
@@ -1,4 +1,15 @@
 {% comment %}
-  Display information about a break.
+    Display a break's timings in a box similar to a learning episode's.
 {% endcomment %}
-<p>Break: {{page.break}} min</p>
+<blockquote class="objectives">
+  <h2>Overview</h2>
+
+  <div class="row">
+    <div class="col-md-3">
+      <strong>Break:</strong> {{ page.break }} min
+    </div>
+    <div class="col-md-9">
+    </div>
+  </div>
+
+</blockquote>
diff --git a/_includes/episode_navbar.html b/_includes/episode_navbar.html
new file mode 100644 (file)
index 0000000..a789d3d
--- /dev/null
@@ -0,0 +1,44 @@
+{% comment %}
+  Find previous and next episodes (if any).
+{% endcomment %}
+{% for episode in site.episodes  %}
+  {% if episode.url == page.url %}
+    {% unless forloop.first %}
+      {% assign prev_episode = prev %}
+    {% endunless %}
+    {% unless forloop.last %}
+      {% assign next_episode = site.episodes[forloop.index] %}
+    {% endunless %}
+  {% endif %}
+  {% assign prev = episode %}
+{% endfor %}
+
+{% comment %}
+  Display title and prev/next links.
+{% endcomment %}
+<div class="row">
+  <div class="col-md-1">
+    <h3>
+      {% if prev_episode %}
+      <a href="{{ page.root }}{{ prev_episode.url }}"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span><span class="sr-only">previous episode</span></a>
+      {% else %}
+      <a href="{{ page.root }}/"><span class="glyphicon glyphicon-menu-up" aria-hidden="true"></span><span class="sr-only">lesson home</span></a>
+      {% endif %}
+    </h3>
+  </div>
+  <div class="col-md-10">
+    {% if include.episode_navbar_title %}
+    <h3 class="maintitle"><a href="{{ page.root }}/">{{ site.title }}</a></h3>
+    <h1 class="maintitle">{{ page.title }}</h1>
+    {% endif %}
+  </div>
+  <div class="col-md-1">
+    <h3>
+      {% if next_episode %}
+      <a href="{{ page.root }}{{ next_episode.url }}"><span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span><span class="sr-only">next episode</span></a>
+      {% else %}
+      <a href="{{ page.root }}/"><span class="glyphicon glyphicon-menu-up" aria-hidden="true"></span><span class="sr-only">lesson home</span></a>
+      {% endif %}
+    </h3>
+  </div>
+</div>
index f22a1a6922786962a7e7c2eed7a3cf6e25a4f8f2..cb87e0f66bba6fc3595559be31489df1179e600f 100644 (file)
@@ -7,7 +7,7 @@
   <div class="row">
     <div class="col-md-3">
       <strong>Teaching:</strong> {{ page.teaching }} min
-      </br>
+      <br/>
       <strong>Exercises:</strong> {{ page.exercises }} min
     </div>
     <div class="col-md-9">
@@ -19,7 +19,7 @@
       </ul>
     </div>
   </div>
-  
+
   <div class="row">
     <div class="col-md-3">
     </div>
@@ -32,5 +32,5 @@
       </ul>
     </div>
   </div>
-  
+
 </blockquote>
index 7ea24a26c3a06ec56f1dc32d4075589f353bc71a..5b9c821cae653b287ad995116b5af7dccf9a0572 100644 (file)
   <div class="col-md-1">
     <h3>
       {% if prev_episode %}
-      <a href="{{ site.github.url }}{{ prev_episode.url }}"><span class="glyphicon glyphicon-menu-left"></span></a>
-      {% elsif site.github.url %}
-      <a href="{{ site.github.url }}"><span class="glyphicon glyphicon-menu-up"></span></a>
+      <a href="{{ page.root }}{{ prev_episode.url }}"><span class="glyphicon glyphicon-menu-left"></span></a>
       {% else %}
-      <a href="/"><span class="glyphicon glyphicon-menu-up"></span></a>
+      <a href="{{ page.root }}"><span class="glyphicon glyphicon-menu-up"></span></a>
       {% endif %}
     </h3>
   </div>
   <div class="col-md-10">
-    <h3 class="maintitle"><a href="{{ site.github.url }}/">{{ site.title }}</a></h3>
+    <h3 class="maintitle"><a href="{{ page.root }}/">{{ site.title }}</a></h3>
     <h1 class="maintitle">{{ page.title }}</h1>
   </div>
   <div class="col-md-1">
     <h3>
       {% if next_episode %}
-      <a href="{{ site.github.url }}{{ next_episode.url }}"><span class="glyphicon glyphicon-menu-right"></span></a>
-      {% elsif site.github.url %}
-      <a href="{{ site.github.url }}"><span class="glyphicon glyphicon-menu-up"></span></a>
+      <a href="{{ page.root }}{{ next_episode.url }}"><span class="glyphicon glyphicon-menu-right"></span></a>
       {% else %}
-      <a href="/"><span class="glyphicon glyphicon-menu-up"></span></a>
+      <a href="{{ page.root }}"><span class="glyphicon glyphicon-menu-up"></span></a>
       {% endif %}
     </h3>
   </div>
index ccf0a887a0ebd831b47c86be69e25277ebd33366..010ae4af13d0e3b8c1c10e36d5a91527e3e51bf0 100644 (file)
@@ -1,3 +1,11 @@
-<script src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/js/jquery.min.js"></script>
-<script src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/js/bootstrap.min.js"></script>
-<script src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/js/lesson.js"></script>
+<script src="{{ page.root }}/assets/js/jquery.min.js"></script>
+<script src="{{ page.root }}/assets/js/bootstrap.min.js"></script>
+<script src="{{ page.root }}/assets/js/lesson.js"></script>
+<script>
+  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
+  ga('create', 'UA-37305346-2', 'auto');
+  ga('send', 'pageview');
+</script>
index 58d08fae539edd130bab6ab781996ab21ce35338..beef2cb38479f75cbf633044956afda873a837a5 100644 (file)
@@ -1,4 +1,3 @@
-<hr/>
 <footer>
   <div class="row">
     <div class="col-md-6" align="left">
index 06019b93051f401df04425c66da5f156f30e5ff8..60b8b06937c72e5125f392ba34c7327db92de906 100644 (file)
@@ -1 +1 @@
-<h1 class="maintitle"><a href="{{ site.github.url }}/">{{ site.title }}</a>{% if page.title %}: {{ page.title }}{% endif %}</h1>
+<h1 class="maintitle"><a href="{{ page.root }}/">{{ site.title }}</a>{% if page.title %}: {{ page.title }}{% endif %}</h1>
index b5dafb46562afe720ff2b397b3c570fe37003622..b0a2c3d83055b5105d0175106b01e85027efbd84 100644 (file)
       {% comment %} Select what logo to display. {% endcomment %}
       {% if page.carpentry == "swc" %}
       <a href="{{ site.swc_site }}" class="pull-left">
-        <img class="navbar-logo" src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" />
+        <img class="navbar-logo" src="{{ page.root }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" />
       </a>
       {% elsif page.carpentry == "dc" %}
       <a href="{{ site.dc_site }}" class="pull-left">
-        <img class="navbar-logo" src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" />
+        <img class="navbar-logo" src="{{ page.root }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" />
       </a>
       {% elsif site.carpentry == "swc" %}
       <a href="{{ site.swc_site }}" class="pull-left">
-        <img class="navbar-logo" src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" />
+        <img class="navbar-logo" src="{{ page.root }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" />
       </a>
       {% elsif site.carpentry == "dc" %}
       <a href="{{ site.dc_site }}" class="pull-left">
-        <img class="navbar-logo" src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" />
+        <img class="navbar-logo" src="{{ page.root }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" />
       </a>
       {% endif %}
 
       {% comment %} Always show link to home page. {% endcomment %}
-      <a class="navbar-brand" href="{{ site.github.url }}/">Home</a>
+      <a class="navbar-brand" href="{{ page.root }}/">Home</a>
 
     </div>
     <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
       <ul class="nav navbar-nav">
 
        {% comment %} Always show code of conduct. {% endcomment %}
-        <li><a href="{{ site.github.url }}/conduct/">Code of Conduct</a></li>
+        <li><a href="{{ page.root }}/conduct/">Code of Conduct</a></li>
 
        {% comment %} Show setup instructions, reference guide, and lesson episodes for lessons. {% endcomment %}
         {% if site.kind == "lesson" %}
-        <li><a href="{{ site.github.url }}/setup/">Setup</a></li>
-        <li><a href="{{ site.github.url }}/reference/">Reference</a></li>
+        <li><a href="{{ page.root }}/setup/">Setup</a></li>
+        <li><a href="{{ page.root }}/reference/">Reference</a></li>
         <li class="dropdown">
-          <a href="{{ site.github.url }}/" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Episodes <span class="caret"></span></a>
+          <a href="{{ page.root }}/" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Episodes <span class="caret"></span></a>
           <ul class="dropdown-menu">
             {% for episode in site.episodes %}
-            <li><a href="{{ site.github.url }}{{ episode.url }}">{{ episode.title }}</a></li>
+            <li><a href="{{ page.root }}{{ episode.url }}">{{ episode.title }}</a></li>
             {% endfor %}
           </ul>
         </li>
        {% comment %} Show extras for lessons or if this is the main workshop-template repo (where they contain documentation). {% endcomment %}
        {% if site.kind == "lesson" or site.github.repository_name == "workshop-template" %}
         <li class="dropdown">
-          <a href="{{ site.github.url }}/" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Extras <span class="caret"></span></a>
+          <a href="{{ page.root }}/" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Extras <span class="caret"></span></a>
           <ul class="dropdown-menu">
             {% for extra in site.extras %}
-            <li><a href="{{ site.github.url }}{{ extra.url }}">{{ extra.title }}</a></li>
+            <li><a href="{{ page.root }}{{ extra.url }}">{{ extra.title }}</a></li>
             {% endfor %}
           </ul>
         </li>
        {% endif %}
 
        {% comment %} Always show license. {% endcomment %}
-        <li><a href="{{ site.github.url }}/license/">License</a></li>
+        <li><a href="{{ page.root }}/license/">License</a></li>
       </ul>
       <form class="navbar-form navbar-right" role="search" id="search" onsubmit="google_search(); return false;">
         <div class="form-group">
-          <input type="text" id="google-search" placeholder="Search...">
+          <input type="text" id="google-search" placeholder="Search..." aria-label="Google site search">
         </div>
       </form>
     </div>
index 67fa23f8fbef4d0be73a94654b6e36474a87465e..bd520ed16c3c80b476b2f10de58e4970d395fbd9 100644 (file)
@@ -3,7 +3,7 @@
   Days are displayed if at least one episode has 'start = true'.
 {% endcomment %}
 <div class="syllabus">
-  <h2>Schedule</h2>
+  <h2 id="schedule">Schedule</h2>
 
   {% assign day = 0 %}
   {% assign multiday = false %}
@@ -34,7 +34,7 @@
       {% if multiday %}<td class="col-md-1">{% if episode.start %}Day {{ day }}{% endif %}</td>{% endif %}
       <td class="col-md-1">{% if hours < 10 %}0{% endif %}{{ hours }}:{% if minutes < 10 %}0{% endif %}{{ minutes }}</td>
       <td class="col-md-3">
-        <a href="{{ site.github.url }}{{ episode.url }}">{{ episode.title }}</a>
+        <a href="{{ page.root }}{{ episode.url }}">{{ episode.title }}</a>
       </td>
       <td class="col-md-7">
         {% if episode.break %}
@@ -62,4 +62,9 @@
     <td class="col-md-7"></td>
   </tr>
   </table>
+
+  <p>
+    The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.
+  </p>
+
 </div>
index 1b94957cbbbe6d32781bd76a93a9daa508fd1df6..31e5f37f36c83c88ac522c3d77b7e1d8894af690 100644 (file)
@@ -1,4 +1,3 @@
-<hr/>
 <footer>
   <div class="row">
     <div class="col-md-6" align="left">
index 20ce747ff4700626971da60e44f9631029610fa8..06f316df83824a4f5baa29cb0e8972de0f441acc 100644 (file)
@@ -7,10 +7,11 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta http-equiv="last-modified" content="{{ site.time }}">
     <meta name="viewport" content="width=device-width, initial-scale=1">
-    <meta name="search-domain" value="{{ site.github.url | replace_first: 'http:', 'https:' }}">
-    <link rel="stylesheet" type="text/css" href="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/css/bootstrap.css" />
-    <link rel="stylesheet" type="text/css" href="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/css/bootstrap-theme.css" />
-    <link rel="stylesheet" type="text/css" href="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/css/lesson.css" />
+    <!-- meta "search-domain" used for google site search function google_search() -->
+    <meta name="search-domain" value="{{ site.github.url }}">
+    <link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/bootstrap.css" />
+    <link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/bootstrap-theme.css" />
+    <link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/lesson.css" />
     {% if site.carpentry == "swc" %}
     <link rel="shortcut icon" type="image/x-icon" href="/favicon-swc.ico" />
     {% endif %}
index 91e4532b1481523b3a367b727e17f47de8cac428..6e2a6a092f60e11ddda3ddd0cbb891a46db48b15 100644 (file)
@@ -1,6 +1,7 @@
 ---
 layout: base
 ---
-{% include episode_title.html %}
+{% include episode_navbar.html episode_navbar_title=true %}
 {% include episode_break.html %}
 {{content}}
+{% include episode_navbar.html episode_navbar_title=false %}
index 3776397a14ddb6b7a21f6253c538882a5f09964b..d774a6814733acd55e13a7d9c2ac132cd2a4eba8 100644 (file)
@@ -1,7 +1,8 @@
 ---
 layout: base
 ---
-{% include episode_title.html %}
+{% include episode_navbar.html episode_navbar_title=true %}
 {% include episode_overview.html %}
 {{content}}
 {% include episode_keypoints.html %}
+{% include episode_navbar.html episode_navbar_title=false %}
index d52ee6246c86b694bf9693e5515681ef72e3e3df..f29e3ce117ccce3dd5cf6837e203169c692166b0 100644 (file)
@@ -25,9 +25,9 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta http-equiv="last-modified" content="{{ site.time }}">
     <meta name="viewport" content="width=device-width, initial-scale=1">
-    <link rel="stylesheet" type="text/css" href="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/css/bootstrap.css" />
-    <link rel="stylesheet" type="text/css" href="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/css/bootstrap-theme.css" />
-    <link rel="stylesheet" type="text/css" href="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/css/lesson.css" />
+    <link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/bootstrap.css" />
+    <link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/bootstrap-theme.css" />
+    <link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/lesson.css" />
     {% if site.carpentry == "swc" %}
     <link rel="shortcut icon" type="image/x-icon" href="/favicon-swc.ico" />
     {% endif %}
index 7bc09a361c1729a8a3210ea9f31690320262ca8d..311687e92ac851ba3c5c5af2720ce45d03490902 100755 (executable)
@@ -155,6 +155,10 @@ def check_config(reporter, source_dir):
     reporter.check_field(config_file, 'configuration', config, 'title')
     reporter.check_field(config_file, 'configuration', config, 'email')
 
+    reporter.check({'values': {'root': '..'}} in config.get('defaults', []),
+                   'configuration',
+                   '"root" not set to ".." in configuration')
+
 
 def read_all_markdown(source_dir, parser):
     """Read source files, returning
@@ -424,6 +428,12 @@ class CheckIndex(CheckBase):
         super(CheckIndex, self).__init__(args, filename, metadata, metadata_len, text, lines, doc)
         self.layout = 'lesson'
 
+    def check_metadata(self):
+        super(CheckIndex, self).check_metadata()
+        self.reporter.check(self.metadata.get('root', '') == '.',
+                            self.filename,
+                            'Root not set to "."')
+
 
 class CheckEpisode(CheckBase):
     """Check an episode page."""
index 537a535cb066abd520bfe5b296a5cb7db69be9dc..e0c2881bf80d35a1a0550ec29b9c497da2d90ad9 100755 (executable)
@@ -211,6 +211,7 @@ training_site: "https://swcarpentry.github.io/instructor-training"
 # Surveys.
 pre_survey: "https://www.surveymonkey.com/r/swc_pre_workshop_v1?workshop_id="
 post_survey: "https://www.surveymonkey.com/r/swc_post_workshop_v1?workshop_id="
+training_post_survey: "https://www.surveymonkey.com/r/post-instructor-training"
 
 # Start time in minutes (0 to be clock-independent, 540 to show a start at 09:00 am).
 start_time: 0
@@ -225,6 +226,8 @@ collections:
 
 # Set the default layout for things in the episodes collection.
 defaults:
+  - values:
+      root: ..
   - scope:
       path: ""
       type: episodes
@@ -243,6 +246,7 @@ highlighter: false
 ROOT_INDEX_MD = '''\
 ---
 layout: lesson
+root: .
 ---
 FIXME: home page introduction
 
@@ -316,7 +320,7 @@ permalink: /figures/
 EXTRAS_GUIDE_MD = '''\
 ---
 layout: page
-title: "Instructors' Guide"
+title: "Instructor Notes"
 permalink: /guide/
 ---
 FIXME
index a88cd5f879117de9b8673f0ed5c6cd214e9a342d..c3fd0b5e2982319b5c1f6f85358572d52bef5235 100755 (executable)
@@ -3,7 +3,7 @@
 # Use Kramdown parser to produce AST for Markdown document.
 
 require "kramdown"
-require "json" 
+require "json"
 
 markdown = STDIN.read()
 doc = Kramdown::Document.new(markdown)