Merge branch 'gh-pages' into gh-pages
authorSarah Brown <sarah_m_brown@brown.edu>
Mon, 24 Sep 2018 16:12:33 +0000 (12:12 -0400)
committerGitHub <noreply@github.com>
Mon, 24 Sep 2018 16:12:33 +0000 (12:12 -0400)
41 files changed:
.editorconfig [new file with mode: 0644]
.gitignore
CODE_OF_CONDUCT.md
Makefile
_includes/all_keypoints.html
_includes/base_path.html [new file with mode: 0644]
_includes/carpentries.html
_includes/episode_navbar.html
_includes/favicons.html
_includes/gh_variables.html [new file with mode: 0644]
_includes/javascript.html
_includes/lc/intro.html
_includes/lesson_footer.html
_includes/life_cycle.html [new file with mode: 0644]
_includes/links.md
_includes/main_title.html
_includes/navbar.html
_includes/syllabus.html
_includes/workshop_calendar.html [new file with mode: 0644]
_layouts/base.html
_layouts/lesson.html
_layouts/page.html
_layouts/workshop.html
assets/css/lesson.scss
assets/js/lesson.js
bin/boilerplate/CONTRIBUTING.md
bin/boilerplate/README.md
bin/boilerplate/_config.yml
bin/boilerplate/_episodes/01-introduction.md
bin/boilerplate/_extras/about.md
bin/boilerplate/_extras/discuss.md
bin/boilerplate/_extras/figures.md
bin/boilerplate/_extras/guide.md
bin/boilerplate/aio.md
bin/boilerplate/index.md
bin/boilerplate/reference.md
bin/boilerplate/setup.md
bin/chunk-options.R
bin/generate_md_episodes.R
bin/knit_lessons.sh
bin/lesson_check.py

diff --git a/.editorconfig b/.editorconfig
new file mode 100644 (file)
index 0000000..1d7d564
--- /dev/null
@@ -0,0 +1,25 @@
+root = true
+
+[*]
+charset = utf-8
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+[*.md]
+indent_size = 2
+indent_style = space
+max_line_length = 100  # Please keep this in sync with bin/lesson_check.py!
+
+[*.r]
+max_line_length = 80
+
+[*.py]
+indent_size = 4
+indent_style = space
+max_line_length = 79
+
+[*.sh]
+end_of_line = lf
+
+[Makefile]
+indent_style = tab
index 8b84b8e6a397550df92dbf785ddb519bb5beef6e..128437da45e107d9c7e14e943c29e84cb723065c 100644 (file)
@@ -6,3 +6,6 @@
 __pycache__
 _site
 .Rproj.user
+.Rhistory
+.RData
+
index acf6fb69a2966172764542a6ae3284cf96d1f0e1..c3b9669073c596aa8081d17f06a0f8a04c677c08 100644 (file)
@@ -1,7 +1,6 @@
 ---
 layout: page
 title: "Contributor Code of Conduct"
-permalink: /conduct/
 ---
 As contributors and maintainers of this project,
 we pledge to follow the [Carpentry Code of Conduct][coc].
index 74f655d6f8c79d9d3f847d2efb229a17d51a3a06..ac587b879e52e3fb22134f0b9786c1188f207bd9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,7 @@
 # Settings
 MAKEFILES=Makefile $(wildcard *.mk)
 JEKYLL=jekyll
+JEKYLL_VERSION=3.7.3
 PARSER=bin/markdown_ast.rb
 DST=_site
 
@@ -16,6 +17,10 @@ all : commands
 commands :
        @grep -h -E '^##' ${MAKEFILES} | sed -e 's/## //g'
 
+## docker-serve     : use docker to build the site
+docker-serve :
+       docker run --rm -it -v ${PWD}:/srv/jekyll -p 127.0.0.1:4000:4000 jekyll/jekyll:${JEKYLL_VERSION} make serve
+
 ## serve            : run a local server.
 serve : lesson-md
        ${JEKYLL} serve
@@ -38,7 +43,7 @@ clean :
        @find . -name '*.pyc' -exec rm {} \;
 
 ## clean-rmd        : clean intermediate R files (that need to be committed to the repo).
-clear-rmd :
+clean-rmd :
        @rm -rf ${RMD_DST}
        @rm -rf fig/rmd-*
 
@@ -83,9 +88,8 @@ HTML_DST = \
 ## lesson-md        : convert Rmarkdown files to markdown
 lesson-md : ${RMD_DST}
 
-# Use of .NOTPARALLEL makes rule execute only once
-${RMD_DST} : ${RMD_SRC}
-       @bin/knit_lessons.sh ${RMD_SRC}
+_episodes/%.md: _episodes_rmd/%.Rmd
+       @bin/knit_lessons.sh $< $@
 
 ## lesson-check     : validate lesson Markdown.
 lesson-check : lesson-fixme
index 8563df340a8df11ffb4a23e27c15f31be15ed56b..e4fd289ff5a3baf4a834cdf3d11d31843aa90880 100644 (file)
@@ -1,13 +1,16 @@
 {% comment %}
   Display key points of all episodes for reference.
 {% endcomment %}
+
+{% include base_path.html %}
+
 <h2>Key Points</h2>
 <table class="table table-striped">
 {% for episode in site.episodes %}
   {% unless episode.break %}
     <tr>
       <td class="col-md-3">
-        <a href="{{ page.root }}{{ episode.url }}">{{ episode.title }}</a>
+        <a href="{{ relative_root_path }}{{ episode.url }}">{{ episode.title }}</a>
       </td>
       <td class="col-md-9">
         <ul>
diff --git a/_includes/base_path.html b/_includes/base_path.html
new file mode 100644 (file)
index 0000000..7efb357
--- /dev/null
@@ -0,0 +1,27 @@
+{% comment %}
+This is adapted from: https://ricostacruz.com/til/relative-paths-in-jekyll
+
+`page.url` gives the URL of the current page with a leading /:
+
+- when the URL ends with the extension (e.g., /foo/bar.html) then we can get
+  the depth by counting the number of / and remove - 1
+- when the URL ends with a / (e.g. /foo/bar/) then the number / gives the depth
+  directly
+{% endcomment %}
+
+{% assign relative_root_path = '' %}
+
+{% assign last_char = page.url | slice: -1 %}
+
+{% if last_char == "/"}
+{% assign offset = 0 %}
+{% else %}
+{% assign offset = 1 %}
+{% endif %}
+
+{% assign depth = page.url | split: '/' | size | minus: offset %}
+{% if    depth <= 1 %}{% assign relative_root_path = '.' %}
+{% elsif depth == 2 %}{% assign relative_root_path = '..' %}
+{% elsif depth == 3 %}{% assign relative_root_path = '../..' %}
+{% elsif depth == 4 %}{% assign relative_root_path = '../../..' %}
+{% endif %}
index 4d5c9060eb4872847bda25e4a2f1fb0138194287..5691223f9c4047bcaacb78143c181806c04fb25b 100644 (file)
@@ -1,44 +1,71 @@
 {% comment %}
   General description of Software and Data Carpentry.
 {% endcomment %}
+
+{% include base_path.html %}
+
 <div class="row">
   <div class="col-md-2" align="center">
-    <a href="{{ site.swc_site }}"><img src="{{ page.root }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" /></a>
+    <a href="{{ site.carpentries_site }}"><img src="{{ relative_root_path }}/assets/img/cp-logo-blue.svg" alt="The Carpentries logo" /></a>
   </div>
   <div class="col-md-8">
-    Since 1998,
-    <a href="{{ site.swc_site }}">Software Carpentry</a>
-    has been teaching researchers in science, engineering, medicine, and related disciplines
-    the computing skills they need to get more done in less time and with less pain.
-    Its volunteer instructors have run hundreds of events
-    for thousands of learners in the past two and a half years.
+    <p><a href="{{ site.carpentries_site }}">The Carpentries</a> comprises
+    Software Carpentry and Data Carpentry, communities of Instructors, Trainers,
+    Maintainers, helpers, and supporters who share a mission to teach
+    foundational coding and data science skills to researchers. In January,
+    2018, The Carpentries was formed by the merger of Software Carpentry and
+    Data Carpentry.</p>
+
+    <p>While individual lessons and workshops continue to be run under each
+    lesson project, The Carpentries provide overall staffing and governance, as
+    well as support for assessment, instructor training and mentoring.
+    Memberships are joint, and the Carpentries project maintains a shared Code
+    of Conduct. The Carpentries is a fiscally sponsored project of Community
+    Initiatives, a registered 501(c)3 non-profit based in California, USA.</p>
+  </div>
+</div>
+<div class="row">
+  <div class="col-md-2" align="center">
+    <a href="{{ site.swc_site }}"><img src="{{ relative_root_path }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" /></a>
+  </div>
+  <div class="col-md-8">
+     <p>Since 1998, <a href="{{ site.swc_site }}">Software Carpentry</a> has
+    been teaching researchers across all disciplines the foundational coding
+    skills they need to get more done in less time and with less pain. Its
+    volunteer instructors have run hundreds of events for thousands of learners
+    around the world. Now that all research involves some degree of
+    computational work, whether with big data, cloud computing, or simple task
+    automation, these skills are needed more than ever.</p>
   </div>
 </div>
 <br/>
 <div class="row">
   <div class="col-md-2" align="center">
-    <a href="{{ site.dc_site }}"><img src="{{ page.root }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" /></a>
+    <a href="{{ site.dc_site }}"><img src="{{ relative_root_path }}/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.
-    Its target audience is researchers who have little to no prior computational experience,
-    and its lessons are domain specific,
-    building on learners' existing knowledge to enable them to quickly apply skills learned to their own research.
+    <p><a href="{{ site.dc_site }}">Data Carpentry</a> develops and teaches
+    workshops on the fundamental data skills needed to conduct research. Its
+    target audience is researchers who have little to no prior computational
+    experience, and its lessons are domain specific, building on learners'
+    existing knowledge to enable them to quickly apply skills learned to their
+    own research. Data Carpentry workshops take researchers through the entire
+    data life cycle.</p>
   </div>
 </div>
 <br/>
 <div class="row">
   <div class="col-md-2" align="center">
-    <a href="{{ site.lc_site }}"><img src="{{ page.root }}/assets/img/lc-icon-black.png" alt="Library Carpentry logo" /></a>
+    <a href="{{ site.lc_site }}"><img src="{{ relative_root_path }}/assets/img/lc-icon-black.png" alt="Library Carpentry logo" /></a>
   </div>
   <div class="col-md-8">
-    <a href="{{ site.lc_site }}">Library Carpentry</a> is made by librarians to help librarians
-    automate repetitive, boring, error-prone tasks;
-    create, maintain and analyse sustainable and reusable data;
-    work effectively with IT and systems colleagues;
-    better understand the use of software in research;
-    and much more.
-    Library Carpentry was the winner of the 2016
-    <a href="http://labs.bl.uk/British+Library+Labs+Awards">British Library Labs Teaching and Learning Award</a>.
+    <p><a href="{{ site.lc_site }}">Library Carpentry</a> is in discussions with
+    The Carpentries to be a Lesson Project, like Software Carpentry*
+    and Data Carpentry. Library Carpentry develops lessons and
+    teaches workshops for and with people working in library- and
+    information-related roles. Its goal is to create an on-ramp to empower this
+    community to use software and data in their own work, as well as be
+    advocates for and train others in efficient, effective and reproducible data
+    and software practices.</p>
   </div>
 </div>
index c2bc80e84105e5d6c2bef7c830e23ea01f264c02..ea368eba204cfc0dc00dedd9176104a0f89d4c3b 100644 (file)
@@ -1,27 +1,35 @@
+{% comment %}
+For some reason, the relative_root_path seems out of scope in this file, so we
+need to re-assign it here
+{% endcomment %}
+
+{% include base_path.html %}
+
 {% comment %}
   Navigation bar for an episode.
 {% endcomment %}
+
 <div class="row">
   <div class="col-xs-1">
     <h3 class="text-left">
       {% if page.previous.url %}
-      <a href="{{ page.root }}{{ page.previous.url }}"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span><span class="sr-only">previous episode</span></a>
+      <a href="{{ relative_root_path }}{{ page.previous.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>
+      <a href="{{ relative_root_path }}/"><span class="glyphicon glyphicon-menu-up" aria-hidden="true"></span><span class="sr-only">lesson home</span></a>
       {% endif %}
     </h3>
   </div>
   <div class="col-xs-10">
     {% if include.episode_navbar_title %}
-    <h3 class="maintitle"><a href="{{ page.root }}/">{{ site.title }}</a></h3>
+    <h3 class="maintitle"><a href="{{ relative_root_path }}/">{{ site.title }}</a></h3>
     {% endif %}
   </div>
   <div class="col-xs-1">
     <h3 class="text-right">
       {% if page.next.url %}
-      <a href="{{ page.root }}{{ page.next.url }}"><span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span><span class="sr-only">next episode</span></a>
+      <a href="{{ relative_root_path }}{{ page.next.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>
+      <a href="{{ relative_root_path }}/"><span class="glyphicon glyphicon-menu-up" aria-hidden="true"></span><span class="sr-only">lesson home</span></a>
       {% endif %}
     </h3>
   </div>
index 4ea6742d530460e08517cfabbd912c69f937b1d4..8a50b4d911591886ed90c11bb23a5cee5cfd7d6b 100644 (file)
@@ -1,4 +1,4 @@
-{% assign favicon_url = site.baseurl | append: '/assets/favicons/' | append: site.carpentry | prepend: site.url %}
+{% assign favicon_url = relative_root_path | append: '/assets/favicons/' | append: site.carpentry  %}
 
 {% if site.carpentry == 'swc' %}
 {% assign carpentry = 'Software Carpentry' %}
diff --git a/_includes/gh_variables.html b/_includes/gh_variables.html
new file mode 100644 (file)
index 0000000..3fdae4a
--- /dev/null
@@ -0,0 +1,45 @@
+{% comment %}
+When rendering websites locally, `site.github.url` doesn't get resolved properly
+unless a GitHub Personal Access Token is set up and available in the
+environment. This leads to warnings and errors when trying to serve the site
+locally. To work around this, we use the `jekyll.environment` variable which is
+set to `development` when rendering the site locally, and set to `production` on
+GitHub where `site.github.url` is defined.
+{% endcomment %}
+
+{% if jekyll.environment == "production" %}
+
+{% comment %}
+First, get the name of the repository
+{% endcomment %}
+{% assign repo_name = site.github.repository_name %}
+
+{% comment %}
+`site.github.public_repositories` contains comprehensive information for all public repositories for the organization. We use `where` to extract the part
+of the metadata that is relevant to the present repository.
+{% endcomment %}
+{% assign repo_info = site.github.public_repositories | where: "name", repo_name %}
+
+{% comment %}
+Now, we can extract the default branch for the repo
+{% endcomment %}
+{% assign default_branch = repo_info[0].default_branch %}
+
+{% comment %}
+Other variables requested by the template
+{% endcomment %}
+{% assign repo_url = site.github.repository_url %}
+{% assign search_domain_url = site.github.url %}
+{% assign project_title = site.github.project_title %}
+{% assign source_branch = site.github.source.branch %}
+
+{% elsif jekyll.environment == "development" %}
+
+{% assign repo_name = "" %}
+{% assign repo_url = "" %}
+{% assign default_branch = "" %}
+{% assign search_domain_url = "" %}
+{% assign project_title = "" %}
+{% assign source_branch = "" %}
+
+{% endif %}
index a2066c202809b465acc364e63211461f435bbc8f..fcc74e6ecc1644f6e70d275fdc1db01c461ebbb0 100644 (file)
@@ -1,9 +1,9 @@
 {% comment %}
-  Javascript used in lesson and workshop pages.
+  JavaScript used in lesson and workshop pages.
 {% endcomment %}
-<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 src="{{ relative_root_path }}/assets/js/jquery.min.js"></script>
+<script src="{{ relative_root_path }}/assets/js/bootstrap.min.js"></script>
+<script src="{{ relative_root_path }}/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),
index a4a53eca5f1a8ee65d8bbc00ece3fd2ba14e737a..7f8609a52e1f64dcd79c4e8730bd7324616bccf5 100644 (file)
@@ -4,7 +4,7 @@
 </p>
 <ul>
   <li>automate repetitive, boring, error-prone tasks</li>
-  <li>create, maintain and analyse sustainable and reusable data</li>
+  <li>create, maintain and analyze sustainable and reusable data</li>
   <li>work effectively with IT and systems colleagues</li>
   <li>better understand the use of software in research</li>
   <li>and much more...</li>
index 9f420c22372482afafeed21659f7d292ddc3152f..621243df9718ee4fde86134983b7b3b205b9bde9 100644 (file)
@@ -1,51 +1,54 @@
 {% comment %}
   Footer for lesson pages.
 {% endcomment %}
+
+{% include gh_variables.html %}
+
 <footer>
   <div class="row">
     <div class="col-md-6 copyright" align="left">
        {% if site.carpentry == "swc" %}
-       Copyright &copy; 2018–{{ 'now' | date: "%Y" }}
-       <a href="{{ site.carpentries_site }}">The Carpentries</a>
+       Licensed under <a href="{{ site.cc_by_human }}">CC-BY 4.0</a> 2018–{{ 'now' | date: "%Y" }}
+       by <a href="{{ site.carpentries_site }}">The Carpentries</a>
         <br>
-        Copyright &copy; 2016–2018
-       <a href="{{ site.swc_site }}">Software Carpentry Foundation</a>
+        Licensed under <a href="{{ site.cc_by_human }}">CC-BY 4.0</a> 2016–2018
+       by <a href="{{ site.swc_site }}">Software Carpentry Foundation</a>
        {% elsif site.carpentry == "dc" %}
-       Copyright &copy; 2018–{{ 'now' | date: "%Y" }}
-       <a href="{{ site.carpentries_site }}">The Carpentries</a>
+       Licensed under <a href="{{ site.cc_by_human }}">CC-BY 4.0</a> 2018–{{ 'now' | date: "%Y" }}
+       by <a href="{{ site.carpentries_site }}">The Carpentries</a>
         <br>
-        Copyright &copy; 2016–2018
-       <a href="{{ site.dc_site }}">Data Carpentry</a>
+        Licensed under <a href="{{ site.cc_by_human }}">CC-BY 4.0</a> 2016–2018
+       by <a href="{{ site.dc_site }}">Data Carpentry</a>
        {% elsif site.carpentry == "lc" %}
-       Copyright &copy; 2016–{{ 'now' | date: "%Y" }}
-       <a href="{{ site.lc_site }}">Library Carpentry</a>
+       Licensed under <a href="{{ site.cc_by_human }}">CC-BY 4.0</a> 2016–{{ 'now' | date: "%Y" }}
+       by <a href="{{ site.lc_site }}">Library Carpentry</a>
        {% elsif site.carpentry == "cp" %}
-       Copyright &copy; 2018–{{ 'now' | date: "%Y" }}
-       <a href="{{ site.carpentries_site }}">The Carpentries</a>
+       Licensed under <a href="{{ site.cc_by_human }}">CC-BY 4.0</a> 2018–{{ 'now' | date: "%Y" }}
+       by <a href="{{ site.carpentries_site }}">The Carpentries</a>
        {% endif %}
     </div>
     <div class="col-md-6 help-links" align="right">
        {% if page.source %}
        {% if page.source == "Rmd" %}
-       <a href="{{site.github.repository_url}}/edit/gh-pages/{{page.path|replace: "_episodes", "_episodes_rmd" | replace: ".md", ".Rmd"}}">Edit on GitHub</a>
+       <a href="{{repo_url}}/edit/{{ default_branch }}/{{page.path|replace: "_episodes", "_episodes_rmd" | replace: ".md", ".Rmd"}}">Edit on GitHub</a>
        {% endif %}
        {% else %}
-       <a href="{{site.github.repository_url}}/edit/gh-pages/{{page.path}}">Edit on GitHub</a>
+       <a href="{{repo_url}}/edit/{{ default_branch }}/{{page.path}}">Edit on GitHub</a>
        {% endif %}
        /
-       <a href="{{ site.github.repository_url }}/blob/gh-pages/CONTRIBUTING.md">Contributing</a>
+       <a href="{{ repo_url }}/blob/{{ source_branch }}/CONTRIBUTING.md">Contributing</a>
        /
-       <a href="{{ site.github.repository_url }}/">Source</a>
+       <a href="{{ repo_url }}/">Source</a>
        /
-       <a href="{{ site.github.repository_url }}/blob/gh-pages/CITATION">Cite</a>
+       <a href="{{ repo_url }}/blob/{{ source_branch }}/CITATION">Cite</a>
        /
        <a href="mailto:{{ site.email }}">Contact</a>
     </div>
   </div>
   <div class="row">
     <div class="col-md-12" align="center">
-      Using <a href="https://github.com/swcarpentry/styles/">The Carpentries style</a> 
-      version <a href="https://github.com/swcarpentry/styles/releases/tag/v9.5.0">9.5.0</a>.
+      Using <a href="https://github.com/carpentries/styles/">The Carpentries style</a>
+      version <a href="https://github.com/carpentries/styles/releases/tag/v9.5.3">9.5.3</a>.
     </div>
   </div>
 </footer>
diff --git a/_includes/life_cycle.html b/_includes/life_cycle.html
new file mode 100644 (file)
index 0000000..efc5b6d
--- /dev/null
@@ -0,0 +1,34 @@
+
+{% if site.life_cycle == "pre-alpha" %}
+
+<div class="panel panel-default life-cycle">
+  <div id="life-cycle" class="panel-body pre-alpha">
+    This lesson is still being designed and assembled (Pre-Alpha version)
+  </div>
+</div>
+
+
+{% elsif site.life_cycle == "alpha" %}
+
+<div class="panel panel-default life-cycle">
+  <div id="life-cycle" class="panel-body alpha">
+    This lesson is in the early stages of development (Alpha version)
+  </div>
+</div>
+
+
+{% elsif site.life_cycle == "beta" %}
+
+<div class="panel panel-default life-cycle">
+  <div id="life-cycle" class="panel-body beta">
+    This lesson is being piloted (Beta version)
+  </div>
+</div>
+
+{% elsif site.life_cycle == "stable" %}
+
+{% comment %}
+We don't do anything special for now
+{% endcomment %}
+
+{% endif %}
index be88dac871cd99a2e3512046296cab3add04cbe4..7244a1268fc5eb8b1a8d19aeb5e0ebeaacc6a3f1 100644 (file)
@@ -1,3 +1,5 @@
+{% include gh_variables.html %}
+
 [cc-by-human]: https://creativecommons.org/licenses/by/4.0/
 [cc-by-legal]: https://creativecommons.org/licenses/by/4.0/legalcode
 [ci]: http://communityin.org/
@@ -5,11 +7,12 @@
 [coc]: https://docs.carpentries.org/topic_folders/policies/code-of-conduct.html
 [concept-maps]: https://carpentries.github.io/instructor-training/05-memory/
 [contrib-covenant]: https://contributor-covenant.org/
-[contributing]: {{ site.github.repository_url }}/blob/gh-pages/CONTRIBUTING.md
+[contributing]: {{ repo_url }}/blob/{{ source_branch }}/CONTRIBUTING.md
 [cran-checkpoint]: https://cran.r-project.org/package=checkpoint
 [cran-knitr]: https://cran.r-project.org/package=knitr
 [cran-stringr]: https://cran.r-project.org/package=stringr
-[email]: mailto:lessons@software-carpentry.org
+[dc-lessons]: http://www.datacarpentry.org/lessons/
+[email]: mailto:team@carpentries.org
 [github-importer]: https://import.github.com/
 [importer]: https://github.com/new/import
 [jekyll-collection]: https://jekyllrb.com/docs/collections/
@@ -17,7 +20,8 @@
 [jekyll-windows]: http://jekyll-windows.juthilo.com/
 [jekyll]: https://jekyllrb.com/
 [jupyter]: https://jupyter.org/
-[lesson-example]: https://swcarpentry.github.io/lesson-example/
+[lc-lessons]: https://librarycarpentry.org/#portfolio
+[lesson-example]: https://carpentries.github.io/lesson-example/
 [mit-license]: https://opensource.org/licenses/mit-license.html
 [morea]: https://morea-framework.github.io/
 [numfocus]: https://numfocus.org/
@@ -31,7 +35,8 @@
 [ruby-install-guide]: https://www.ruby-lang.org/en/downloads/
 [ruby-installer]: https://rubyinstaller.org/
 [rubygems]: https://rubygems.org/pages/download/
-[styles]: https://github.com/swcarpentry/styles/
+[styles]: https://github.com/carpentries/styles/
+[swc-lessons]: https://software-carpentry.org/lessons/ 
 [swc-releases]: https://github.com/swcarpentry/swc-releases
 [workshop-repo]: {{ site.workshop_repo }}
 [yaml]: http://yaml.org/
index d007abae203592c924f78bd178f2d22538214e07..b08af4a784daf6132b28b198c95578880acc3333 100644 (file)
@@ -1,4 +1,7 @@
 {% comment %}
   Main title for lesson pages.
 {% endcomment %}
-<h1 class="maintitle"><a href="{{ page.root }}{% link index.md %}">{{ site.title }}</a>{% if page.title %}: {{ page.title }}{% endif %}</h1>
+
+{% include base_path.html %}
+
+<h1 class="maintitle"><a href="{{ relative_root_path }}{% link index.md %}">{{ site.title }}</a>{% if page.title %}: {{ page.title }}{% endif %}</h1>
index 868bce8dac32f877df39aa7a55d6337f09748b85..40939226fc1156f53efbfc6cef7a4a3a1d671dad 100644 (file)
@@ -1,6 +1,9 @@
 {% comment %}
   Lesson navigation bar.
 {% endcomment %}
+
+{% include gh_variables.html %}
+
 <nav class="navbar navbar-default">
   <div class="container-fluid">
     <div class="navbar-header">
       {% comment %} Select what logo to display. {% endcomment %}
       {% if site.carpentry == "swc" %}
       <a href="{{ site.swc_site }}" class="pull-left">
-        <img class="navbar-logo" src="{{ page.root }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" />
+        <img class="navbar-logo" src="{{ relative_root_path }}{% link /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="{{ page.root }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" />
+        <img class="navbar-logo" src="{{ relative_root_path }}{% link /assets/img/dc-icon-black.svg %}" alt="Data Carpentry logo" />
       </a>
       {% elsif site.carpentry == "lc" %}
       <a href="{{ site.lc_site }}" class="pull-left">
-        <img class="navbar-logo" src="{{ page.root }}/assets/img/lc-icon-black.svg" alt="Library Carpentry logo" />
+        <img class="navbar-logo" src="{{ relative_root_path }}{% link /assets/img/lc-icon-black.svg %}" alt="Library Carpentry logo" />
       </a>
       {% elsif site.carpentry == "cp" %}
       <a href="{{ site.carpentries_site }}" class="pull-left">
-        <img class="navbar-logo" src="{{ page.root }}/assets/img/cp-logo-blue.svg" alt="The Carpentries logo" />
+        <img class="navbar-logo" src="{{ relative_root_path }}{% link /assets/img/cp-logo-blue.svg %}" alt="The Carpentries logo" />
       </a>
       {% endif %}
 
       {% comment %} Always show link to home page. {% endcomment %}
-      <a class="navbar-brand" href="{{ page.root }}{% link index.md %}">Home</a>
+      <a class="navbar-brand" href="{{ relative_root_path }}{% link index.md %}">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="{{ page.root }}{% link CODE_OF_CONDUCT.md %}">Code of Conduct</a></li>
+        <li><a href="{{ relative_root_path }}{% link CODE_OF_CONDUCT.md %}">Code of Conduct</a></li>
 
         {% if site.kind == "lesson" %}
        {% comment %} Show setup instructions. {% endcomment %}
-        <li><a href="{{ page.root }}{% link setup.md %}">Setup</a></li>
+        <li><a href="{{ relative_root_path }}{% link setup.md %}">Setup</a></li>
 
         {% comment %} Show lesson episodes for lessons. {% endcomment %}
         <li class="dropdown">
-          <a href="{{ page.root }}/" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Episodes <span class="caret"></span></a>
+          <a href="{{ relative_root_path }}/" 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="{{ page.root }}{{ episode.url }}">{{ episode.title }}</a></li>
+            <li><a href="{{ relative_root_path }}{{ episode.url }}">{{ episode.title }}</a></li>
             {% endfor %}
            <li role="separator" class="divider"></li>
-            <li><a href="{{ page.root }}{% link aio.md %}">All in one page (Beta)</a></li>
+            <li><a href="{{ relative_root_path }}{% link aio.md %}">All in one page (Beta)</a></li>
           </ul>
         </li>
        {% endif %}
        {% comment %} Show extras for lessons or if this is the main workshop-template repo (where they contain documentation). {% endcomment %}
        {% if site.kind == "lesson" %}
         <li class="dropdown">
-          <a href="{{ page.root }}/" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Extras <span class="caret"></span></a>
+          <a href="{{ relative_root_path }}/" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Extras <span class="caret"></span></a>
           <ul class="dropdown-menu">
-            <li><a href="{{ page.root }}{% link reference.md %}">Reference</a></li>
+            <li><a href="{{ relative_root_path }}{% link reference.md %}">Reference</a></li>
             {% for extra in site.extras %}
-            <li><a href="{{ page.root }}{{ extra.url }}">{{ extra.title }}</a></li>
+            <li><a href="{{ relative_root_path }}{{ extra.url }}">{{ extra.title }}</a></li>
             {% endfor %}
           </ul>
         </li>
        {% endif %}
 
        {% comment %} Always show license. {% endcomment %}
-        <li><a href="{{ page.root }}{% link LICENSE.md %}">License</a></li>
+        <li><a href="{{ relative_root_path }}{% link LICENSE.md %}">License</a></li>
        {% if page.source %}
        {% if page.source == "Rmd" %}
-       <li><a href="{{site.github.repository_url}}/edit/gh-pages/{{page.path|replace: "_episodes", "_episodes_rmd" | replace: ".md", ".Rmd"}}">Improve this page <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a></li>
+       <li><a href="{{repo_url}}/edit/{{ default_branch }}/{{page.path|replace: "_episodes", "_episodes_rmd" | replace: ".md", ".Rmd"}}">Improve this page <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a></li>
        {% endif %}
        {% else %}
-       <li><a href="{{site.github.repository_url}}/edit/gh-pages/{{page.path}}">Improve this page <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a></li>
+       <li><a href="{{repo_url}}/edit/{{ default_branch}}/{{page.path}}">Improve this page <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a></li>
        {% endif %}
       </ul>
       <form class="navbar-form navbar-right" role="search" id="search" onsubmit="google_search(); return false;">
index 92270f835e6f799412411a2aeda03a5b26e94c2a..2bc607eca9e42c6c63cfd30af653c34c3a5647a2 100644 (file)
@@ -1,3 +1,5 @@
+{% include base_path.html %}
+
 {% comment %}
   Display syllabus in tabular form.
   Days are displayed if at least one episode has 'start = true'.
@@ -17,7 +19,7 @@
   <tr>
     {% if multiday %}<td class="col-md-1"></td>{% endif %}
     <td class="{% if multiday %}col-md-1{% else %}col-md-2{% endif %}"></td>
-    <td class="col-md-3"><a href="{{ page.root }}{% link setup.md %}">Setup</a></td>
+    <td class="col-md-3"><a href="{{ relative_root_path }}{% link setup.md %}">Setup</a></td>
     <td class="col-md-7">Download files required for the lesson</td>
   </tr>
   {% for episode in site.episodes %}
@@ -42,7 +44,7 @@
       <td class="{% if multiday %}col-md-1{% else %}col-md-2{% endif %}">{% if hours < 10 %}0{% endif %}{{ hours }}:{% if minutes < 10 %}0{% endif %}{{ minutes }}</td>
       <td class="col-md-3">
         {% assign lesson_number = lesson_number | plus: 1 %}
-       {{ lesson_number }}. <a href="{{ page.root }}{{ episode.url }}">{{ episode.title }}</a>
+       {{ lesson_number }}. <a href="{{ relative_root_path }}{{ episode.url }}">{{ episode.title }}</a>
       </td>
       <td class="col-md-7">
         {% if episode.break %}
diff --git a/_includes/workshop_calendar.html b/_includes/workshop_calendar.html
new file mode 100644 (file)
index 0000000..53a0eac
--- /dev/null
@@ -0,0 +1 @@
+<a href="//calendar.google.com/calendar/render?action=TEMPLATE&text={% if page.carpentry == "swc" %}Software{% elsif page.carpentry == "dc" %}Data{% endif %} Carpentry Workshop&dates={{ page.startdate | replace: "-", "" }}/{{ page.enddate | replace: "-", "" | plus: 0}}&trp=false&sprop&sprop=name:&sf=true&output=xml&location={{ page.address }}&details={% if page.carpentry == "swc" %}Software{% elsif page.carpentry == "dc" %}Data{% endif %} Carpentry Workshop at {{ page.venue }}">Add to your Google Calendar.</a>
index 99d6567434a839aaeb0ad1f08f701c1483098af9..34959d54a9b939ae4a44daf519689929849bbc78 100644 (file)
@@ -1,5 +1,8 @@
 ---
 ---
+{% include base_path.html %}
+{% include gh_variables.html %}
+
 <!doctype html>
 <html lang="en">
   <head>
     <meta http-equiv="last-modified" content="{{ site.time }}">
     <meta name="viewport" content="width=device-width, initial-scale=1">
     <!-- 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" />
-    <link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/syntax.css" />
+    <meta name="search-domain" value="{{ search_domain_url }}">
+    <link rel="stylesheet" type="text/css" href="{{ relative_root_path }}/assets/css/bootstrap.css" />
+    <link rel="stylesheet" type="text/css" href="{{ relative_root_path }}/assets/css/bootstrap-theme.css" />
+    <link rel="stylesheet" type="text/css" href="{{ relative_root_path }}/assets/css/lesson.css" />
+    <link rel="stylesheet" type="text/css" href="{{ relative_root_path }}/assets/css/syntax.css" />
 
     {% include favicons.html %}
 
@@ -25,6 +28,9 @@
     <title>{{ site.title }}{% if page.title %}: {{ page.title }}{% endif %}</title>
   </head>
   <body>
+
+    {% include life_cycle.html %}
+
     <div class="container">
       {% include navbar.html %}
 {{ content }}
index 7d566cd195a9ecc7bd17f1ae1ecea0ddac344580..f3f7300e9192749830862e8209326c58faf38f46 100644 (file)
@@ -2,5 +2,7 @@
 layout: base
 ---
 {% include main_title.html %}
-{{ content }}
+<article>
+  {{ content }}
+</article>
 {% include syllabus.html %}
index 3df0456613772c2122100902a8d7fd84f91693dc..656edfef9be0254fe9ebb5524b9ff65096f74668 100644 (file)
@@ -2,4 +2,6 @@
 layout: base
 ---
 {% include main_title.html %}
+<article>
 {{content}}
+</article>
index 3525da390ded29b56c2c7270038f2a690f553384..cf57cdf4963c526c7b546fe8bbf2d4b938dc1fd2 100644 (file)
@@ -1,10 +1,13 @@
 ---
 ---
+{% include base_path.html %}
+{% include gh_variables.html %}
+
 <!doctype html>
 <html lang="en">
   <head>
 
-    <meta name="slug" content="{{site.github.project_title}}" />
+    <meta name="slug" content="{{project_title}}" />
     <meta name="startdate" content="{{page.startdate}}" />
     <meta name="enddate" content="{{page.enddate}}" />
     <meta name="humandate" content="{{page.humandate}}" />
     <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="{{ 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" />
+    <link rel="stylesheet" type="text/css" href="{{ relative_root_path }}/assets/css/bootstrap.css" />
+
+    <link rel="stylesheet" type="text/css" href="{{ relative_root_path }}/assets/css/bootstrap-theme.css" />
+    <link rel="stylesheet" type="text/css" href="{{ relative_root_path }}/assets/css/lesson.css" />
 
     {% include favicons.html %}
 
index 8a7b29548dd218d86ad411a27ecee7b255737f45..6e9e81ea24fc38d6cfb41e07ca150de278e1499c 100644 (file)
@@ -29,10 +29,10 @@ $color-testimonial: #fc8dc1 !default;
 //----------------------------------------
 
 @mixin cdSetup($color) {
-  color: $color;
-  border-left: solid 5px $color;
-  margin-bottom: 0px;
-  border-radius: 4px 0 0 4px;
+    color: $color;
+    border-left: solid 5px $color;
+    margin: 15px 0;
+    border-radius: 4px 0 0 4px;
 }
 
 .error  { @include cdSetup($color-error); }
@@ -44,7 +44,7 @@ $color-testimonial: #fc8dc1 !default;
 .matlab, .language-matlab { @include cdSetup($color-source); }
 .python, .language-python { @include cdSetup($color-source); }
 .r, .language-r           { @include cdSetup($color-source); }
-.sql, .langauge-sql       { @include cdSetup($color-source); }
+.sql, .language-sql       { @include cdSetup($color-source); }
 
 .error pre,
 .output pre,
@@ -81,8 +81,11 @@ $codeblock-padding: 5px !default;
   padding-right: 0;
   border: 1px solid;
   border-color: $color;
+  border-radius: 4px;
   padding-bottom: $codeblock-padding;
 
+  margin: 15px 0;
+
   h2 {
     padding-top: $codeblock-padding;
     padding-bottom: $codeblock-padding;
@@ -126,6 +129,10 @@ $codeblock-padding: 5px !default;
 font-size: 18px;
 }
 
+blockquote p {
+    margin: 5px;
+}
+
 //----------------------------------------
 // Override Bootstrap settings.
 //----------------------------------------
@@ -137,14 +144,27 @@ code {
   background-color: #e7e7e7;
 }
 
-img {
-  max-width: 100%;
+article img {
+    display: block;
+    margin: 20px auto;
+    max-width: 100%;
+}
+
+article h2 {
+  margin: 48px 0 16px;
+  border-bottom: solid 1px #eaecef;
+  padding-bottom: 0.3em;
+  line-height: 1.25;
 }
 
+article h3 { margin: 40px 0 16px; }
+
 //----------------------------------------
 // Miscellaneous.
 //----------------------------------------
 
+.figures h2 { margin-top: 100px; }
+
 .maintitle {
   text-align: center;
 }
@@ -156,7 +176,7 @@ img {
 footer .copyright,
 footer .help-links
 {
-    font-size: 18px;
+    font-size: inherit;
     margin-top: 10px;
     margin-bottom: 10px;
     font-weight: 500;
@@ -184,6 +204,37 @@ span.fold-unfold {
 }
 
 
+//----------------------------------------
+// Life cycle box
+//----------------------------------------
+
+div.life-cycle {
+    position: -webkit-sticky; /* Safari */
+    position: sticky;
+    top: 0;
+    z-index: 100;
+    font-size: 1.2em;
+    text-align: center;
+    margin-bottom: -1px;
+    border-radius: 0;
+}
+
+.pre-alpha {
+    color: #a94442;
+    background: #f2dede;
+}
+
+.alpha {
+    color: #8a6d3b;
+    background: #fcf8e3;
+}
+
+.beta {
+    color: #31708f;
+    background: #d9edf7;
+}
+
+
 //----------------------------------------
 // keyboard key style, from StackExchange.
 //----------------------------------------
index 185da920220429f734256180b9d7baf41323d45e..333dee8c1b5508234a98cbdee40eae4532097d73 100644 (file)
@@ -26,3 +26,31 @@ function google_search() {
   var domain = $("meta[name=search-domain]").attr("value");
   window.open("https://www.google.com/search?q=" + query + "+site:" + domain);
 }
+
+// function to shrink the life cycle bar when scrolling
+$(function(){
+    $('#life-cycle').data('size','big');
+});
+
+$(window).scroll(function(){
+    if($(document).scrollTop() > 0)
+    {
+        if($('#life-cycle').data('size') == 'big')
+        {
+            $('#life-cycle').data('size','small');
+            $('#life-cycle').stop().animate({
+                padding: '5px'
+            },100);
+        }
+    }
+    else
+    {
+        if($('#life-cycle').data('size') == 'small')
+        {
+            $('#life-cycle').data('size','big');
+            $('#life-cycle').stop().animate({
+                padding: '15px'
+            },100);
+        }
+    }
+});
index ccffd90bb9869664f57ec5092b92f9555d85c94e..5a6b02a7d09fb983c33615625c043f428e2b4a4f 100644 (file)
@@ -50,19 +50,19 @@ and to meet some of our community members.
     which can be viewed at <https://swcarpentry.github.io/FIXME>.
 
 2.  If you wish to change the example lesson,
-    please work in <https://github.com/swcarpentry/lesson-example>,
+    please work in <https://github.com/carpentries/lesson-example>,
     which documents the format of our lessons
-    and can be viewed at <https://swcarpentry.github.io/lesson-example>.
+    and can be viewed at <https://carpentries.github.io/lesson-example>.
 
 3.  If you wish to change the template used for workshop websites,
-    please work in <https://github.com/swcarpentry/workshop-template>.
+    please work in <https://github.com/carpentries/workshop-template>.
     The home page of that repository explains how to set up workshop websites,
-    while the extra pages in <https://swcarpentry.github.io/workshop-template>
+    while the extra pages in <https://carpentries.github.io/workshop-template>
     provide more background on our design choices.
 
 4.  If you wish to change CSS style files, tools,
     or HTML boilerplate for lessons or workshops stored in `_includes` or `_layouts`,
-    please work in <https://github.com/swcarpentry/styles>.
+    please work in <https://github.com/carpentries/styles>.
 
 ## What to Contribute
 
@@ -95,7 +95,7 @@ The first encourages contributors to be honest about requirements;
 the second, to think hard about priorities.
 
 We are also not looking for exercises or other material that only run on one platform.
-Our workshops typically contain a mixture of Windows, Mac OS X, and Linux users;
+Our workshops typically contain a mixture of Windows, macOS, and Linux users;
 in order to be usable,
 our lessons must run equally well on all three.
 
@@ -145,4 +145,4 @@ You can also [reach us by email][email].
 [issues]: https://guides.github.com/features/issues/
 [swc-issues]: https://github.com/issues?q=user%3Aswcarpentry
 [swc-lessons]: https://software-carpentry.org/lessons/
-[swc-site]: https://software-carpentry.org/
\ No newline at end of file
+[swc-site]: https://software-carpentry.org/
index dbf5ea3e47b67b13bb0a0024538bc1653ce4f347..43a6b7225e5de62ac66451d8b5628fb9f50bf369 100644 (file)
@@ -25,4 +25,4 @@ A list of contributors to the lesson can be found in [AUTHORS](AUTHORS)
 
 To cite this lesson, please consult with [CITATION](CITATION)
 
-[lesson-example]: https://swcarpentry.github.io/lesson-example
\ No newline at end of file
+[lesson-example]: https://carpentries.github.io/lesson-example
index 974e568f7706c2640df5f84e926d506466ad26fc..3c3f4f2d8973dad9984130587de7634333e6b1e8 100644 (file)
@@ -2,14 +2,19 @@
 # Values for this lesson.
 #------------------------------------------------------------
 
-# Which carpentry is this ("swc", "dc", or "lc")?
+# Which carpentry is this ("swc", "dc", "lc", or "cp")?
+# swc: Software Carpentry
+# dc: Data Carpentry
+# lc: Library Carpentry
+# cp: Carpentries (to use for instructor traning for instance)
 carpentry: "swc"
 
 # Overall title for pages.
 title: "Lesson Title"
 
-# Email address, no mailto:
-email: "lessons@software-carpentry.org"
+# Life cycle stage of the lesson
+# possible values: "pre-alpha", "alpha", "beta", "stable"
+life_cycle: "pre-alpha"
 
 #------------------------------------------------------------
 # Generic settings (should not need to change).
@@ -20,29 +25,41 @@ kind: "lesson"
 
 # Magic to make URLs resolve both locally and on GitHub.
 # See https://help.github.com/articles/repository-metadata-on-github-pages/.
+# Please don't change it: <USERNAME>/<PROJECT> is correct.
 repository: <USERNAME>/<PROJECT>
 
+# Email address, no mailto:
+email: "team@carpentries.org"
+
 # Sites.
 amy_site: "https://amy.software-carpentry.org/workshops"
 carpentries_github: "https://github.com/carpentries"
 carpentries_pages: "https://carpentries.github.io"
 carpentries_site: "https://carpentries.org/"
 dc_site: "http://datacarpentry.org"
-example_repo: "https://github.com/swcarpentry/lesson-example"
-example_site: "https://swcarpentry.github.com/lesson-example"
-lc_site: "https://librarycarpentry.github.io/"
+example_repo: "https://github.com/carpentries/lesson-example"
+example_site: "https://carpentries.github.io/lesson-example"
+lc_site: "https://librarycarpentry.org/"
 swc_github: "https://github.com/swcarpentry"
 swc_pages: "https://swcarpentry.github.io"
 swc_site: "https://software-carpentry.org"
-template_repo: "https://github.com/swcarpentry/styles"
-training_site: "https://swcarpentry.github.io/instructor-training"
-workshop_repo: "https://github.com/swcarpentry/workshop-template"
-workshop_site: "https://swcarpentry.github.io/workshop-template"
+template_repo: "https://github.com/carpentries/styles"
+training_site: "https://carpentries.github.io/instructor-training"
+workshop_repo: "https://github.com/carpentries/workshop-template"
+workshop_site: "https://carpentries.github.io/workshop-template"
+cc_by_human: "https://creativecommons.org/licenses/by/4.0/"
 
 # 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="
+swc_pre_survey: "https://www.surveymonkey.com/r/swc_pre_workshop_v1?workshop_id="
+swc_post_survey: "https://www.surveymonkey.com/r/swc_post_workshop_v1?workshop_id="
 training_post_survey: "https://www.surveymonkey.com/r/post-instructor-training"
+dc_pre_survey: "https://www.surveymonkey.com/r/dcpreworkshopassessment?workshop_id="
+dc_post_survey: "https://www.surveymonkey.com/r/dcpostworkshopassessment?workshop_id="
+lc_pre_survey: "https://www.surveymonkey.com/r/lcpreworkshopsurvey?workshop_id="
+lc_post_survey: "https://www.surveymonkey.com/r/lcpostworkshopsurvey?workshop_id="
+instructor_pre_survey: "https://www.surveymonkey.com/r/instructor_training_pre_survey?workshop_id="
+instructor_post_survey: "https://www.surveymonkey.com/r/instructor_training_post_survey?workshop_id="
+
 
 # Start time in minutes (0 to be clock-independent, 540 to show a start at 09:00 am).
 start_time: 0
index 528cd07254705bbf154f69e363e69614d1c70f98..2e156c26da84c4e220e791201ee0fa37b5e6b5e6 100644 (file)
@@ -3,9 +3,13 @@ title: "Introduction"
 teaching: 0
 exercises: 0
 questions:
-- "Key question"
+- "Key question (FIXME)"
 objectives:
-- "First learning objective."
+- "First learning objective. (FIXME)"
 keypoints:
-- "First key point. Brief Answer to questions."
+- "First key point. Brief Answer to questions. (FIXME)"
 ---
+FIXME
+
+{% include links.md %}
+
index 3008972c01c7d401bcdc5b244f2c79734876d72b..5f07f659dcd2d78f4033e713a6f3cc71a28abffb 100644 (file)
@@ -2,3 +2,4 @@
 title: About
 ---
 {% include carpentries.html %}
+{% include links.md %}
index 524440acb26794f53da33b097967adce752f35de..bfc33c5041c10152cff6f88025aadd46efec859e 100644 (file)
@@ -2,3 +2,5 @@
 title: Discussion
 ---
 FIXME
+
+{% include links.md %}
index b807e484d61632e3b93a5f6b9a3d2120b4f46541..ee5b65082a301e023b5f363838a4e5047c27b76f 100644 (file)
@@ -1,30 +1,58 @@
 ---
 title: Figures
 ---
+
+{% include base_path.html %}
+
 <script>
   window.onload = function() {
     var lesson_episodes = [
     {% for episode in site.episodes %}
-    "{{ episode.url}}"{% unless forloop.last %},{% endunless %}
+    "{{ episode.url }}"{% unless forloop.last %},{% endunless %}
     {% endfor %}
     ];
+
     var xmlHttp = [];  /* Required since we are going to query every episode. */
     for (i=0; i < lesson_episodes.length; i++) {
+
       xmlHttp[i] = new XMLHttpRequest();
       xmlHttp[i].episode = lesson_episodes[i];  /* To enable use this later. */
       xmlHttp[i].onreadystatechange = function() {
+
         if (this.readyState == 4 && this.status == 200) {
-          var article_here = document.getElementById(this.episode);
           var parser = new DOMParser();
           var htmlDoc = parser.parseFromString(this.responseText,"text/html");
           var htmlDocArticle = htmlDoc.getElementsByTagName("article")[0];
-          article_here.appendChild(htmlDocArticle.getElementsByTagName("h1")[0]);
-          for (let image of htmlDocArticle.getElementsByTagName("img")) {
-            article_here.appendChild(image);
+
+          var article_here = document.getElementById(this.episode);
+          var images = htmlDocArticle.getElementsByTagName("img");
+
+          if (images.length > 0) {
+            var h1text = htmlDocArticle.getElementsByTagName("h1")[0].innerHTML;
+
+            var htitle = document.createElement('h2');
+            htitle.innerHTML = h1text;
+            article_here.appendChild(htitle);
+
+            var image_num = 0;
+            for (let image of images) {
+              image_num++;
+
+              var title = document.createElement('p');
+              title.innerHTML = "<strong>Figure " + image_num + ".</strong> " + image.alt;
+              article_here.appendChild(title);
+
+              article_here.appendChild(image.cloneNode(false));
+
+              if (image_num < images.length) {
+                var hr = document.createElement('hr');
+                article_here.appendChild(hr);
+              }
+            }
           }
         }
       }
-      episode_url = "{{ page.root }}" + lesson_episodes[i];
+      episode_url = "{{ relative_root_path }}" + lesson_episodes[i];
       xmlHttp[i].open("GET", episode_url);
       xmlHttp[i].send(null);
     }
@@ -34,5 +62,7 @@ title: Figures
 Create anchor for each one of the episodes.
 {% endcomment %}
 {% for episode in site.episodes %}
-<article id="{{ episode.url }}"></article>
+<article id="{{ episode.url }}" class="figures"></article>
 {% endfor %}
+
+{% include links.md %}
index da9be3781a2eb337381b38d857a9cac4f7b519e6..50f266f8467a57ee9ee518605f255cad185bb74f 100644 (file)
@@ -2,3 +2,5 @@
 title: "Instructor Notes"
 ---
 FIXME
+
+{% include links.md %}
index a418f3b45ee2c3a59950a49e5f5434cbd7dada46..1900d884d61923ff4c153693e2e6a27b341e7823 100644 (file)
@@ -1,5 +1,8 @@
 ---
 ---
+
+{% include base_path.html %}
+
 <script>
   window.onload = function() {
     var lesson_episodes = [
@@ -20,7 +23,7 @@
         article_here.innerHTML = htmlDocArticle.innerHTML;
         }
       }
-      episode_url = "{{ page.root }}" + lesson_episodes[i];
+      episode_url = "{{ relative_root_path }}" + lesson_episodes[i];
       xmlHttp[i].open("GET", episode_url);
       xmlHttp[i].send(null);
     }
index 81522f4d7b8589b71a83039fd0c1e0ffea8159ce..95ccdbdc5491c0babdbfad895d402036c51344fe 100644 (file)
@@ -13,3 +13,5 @@ FIXME: home page introduction
 >
 > FIXME
 {: .prereq}
+
+{% include links.md %}
index 8138fe9f7719d9a8dffac2a0199a492be3c08581..8c8261671b6f9b8a4cbc8570ecd1dfebcd35777a 100644 (file)
@@ -5,3 +5,5 @@ layout: reference
 ## Glossary
 
 FIXME
+
+{% include links.md %}
index b5792e643caba9e58422378e29740ab2ba52a591..b8c50321d8b07f8a76f8e925416957c3f274012e 100644 (file)
@@ -2,3 +2,6 @@
 title: Setup
 ---
 FIXME
+
+
+{% include links.md %}
index f9435842034b264d147ef9549eab7ed94b595dff..6bd4aefaeb72ba14d2765e8dfffc8fa5592d91c9 100644 (file)
@@ -20,7 +20,7 @@ knitr_fig_path <- function(prefix) {
     opts_chunk$set(fig.path = new_path)
 }
 
-## We use the rmd- prefix for the figures generated by the lssons so
+## We use the rmd- prefix for the figures generated by the lessons so
 ## they can be easily identified and deleted by `make clean-rmd`.  The
 ## working directory when the lessons are generated is the root so the
 ## figures need to be saved in fig/, but when the site is generated,
@@ -29,7 +29,9 @@ knitr_fig_path <- function(prefix) {
 
 opts_chunk$set(tidy = FALSE, results = "markup", comment = NA,
                fig.align = "center", fig.path = "fig/rmd-",
-               fig.process = fix_fig_path)
+               fig.process = fix_fig_path,
+               fig.width = 8.5, fig.height = 8.5,
+               fig.retina = 2)
 
 # The hooks below add html tags to the code chunks and their output so that they
 # are properly formatted when the site is built.
@@ -43,7 +45,7 @@ hook_in <- function(x, options) {
 hook_out <- function(x, options) {
   x <- gsub("\n$", "", x)
   stringr::str_c("\n\n~~~\n",
-                   paste0(x, collapse="\n"),
+                 paste0(x, collapse="\n"),
                  "\n~~~\n{: .output}\n\n")
 }
 
index 6c27d9c9245fc5b6d1c5aaa82af2ea4073e59b80..7f37a7b1cfd519be08f6f828745e52598102fe2e 100644 (file)
@@ -1,38 +1,45 @@
 generate_md_episodes <- function() {
 
-    library("methods")
-    
-    if (require("knitr") && packageVersion("knitr") < '1.9.19')
-        stop("knitr must be version 1.9.20 or higher")
-
-    if (!require("stringr"))
-        stop("The package stringr is required for generating the lessons.")
-
-    if (require("checkpoint") && packageVersion("checkpoint") >=  '0.4.0') {
-        required_pkgs <-
-             checkpoint:::scanForPackages(project = "_episodes_rmd",
-                                          verbose=FALSE, use.knitr = TRUE)$pkgs
-    } else {
-        stop("The checkpoint package (>= 0.4.0) is required to build the lessons.")
-    }
-
-    missing_pkgs <- required_pkgs[!(required_pkgs %in% rownames(installed.packages()))]
-
-    if (length(missing_pkgs)) {
-        message("Installing missing required packages: ",
-                paste(missing_pkgs, collapse=", "))
-        install.packages(missing_pkgs)
-    }
-
-    ## find all the Rmd files, and generate the paths for their respective outputs
-    src_rmd <- list.files(pattern = "??-*.Rmd$", path = "_episodes_rmd", full.names = TRUE)
-    dest_md <- file.path("_episodes", gsub("Rmd$", "md", basename(src_rmd)))
-    
-    ## knit the Rmd into markdown
-    mapply(function(x, y) {
-        knitr::knit(x, output = y)
-    }, src_rmd, dest_md)
-    
+  library("methods")
+  
+  if (!require("remotes", quietly = TRUE)) {
+    install.packages("remotes", repos = c(CRAN = "https://cloud.r-project.org/"))
+  }
+
+  if (!require("requirements", quietly = TRUE)) {
+    remotes::install_github("hadley/requirements")
+  }
+
+  required_pkgs <- unique(c(
+    ## Packages for episodes
+    requirements:::req_dir("_episodes_rmd"),
+    ## Pacakges for tools
+    requirements:::req_dir("bin")
+  ))
+
+  missing_pkgs <- setdiff(required_pkgs, rownames(installed.packages()))
+
+  if (length(missing_pkgs)) {
+    message("Installing missing required packages: ",
+            paste(missing_pkgs, collapse=", "))
+    install.packages(missing_pkgs)
+  }
+
+  if (require("knitr") && packageVersion("knitr") < '1.9.19')
+    stop("knitr must be version 1.9.20 or higher")
+
+  ## get the Rmd file to process from the command line, and generate the path for their respective outputs
+  args  <- commandArgs(trailingOnly = TRUE)
+  if (!identical(length(args), 2L)) {
+    stop("input and output file must be passed to the script")
+  }
+
+  src_rmd <- args[1]
+  dest_md <- args[2]
+
+  ## knit the Rmd into markdown
+  knitr::knit(src_rmd, output = dest_md)
+
     # Read the generated md files and add comments advising not to edit them
     vapply(dest_md, function(y) {
       con <- file(y)
@@ -40,7 +47,7 @@ generate_md_episodes <- function() {
       if (mdfile[1] != "---")
         stop("Input file does not have a valid header")
       mdfile <- append(mdfile, "# Please do not edit this file directly; it is auto generated.", after = 1)
-      mdfile <- append(mdfile, paste("# Instead, please edit", 
+      mdfile <- append(mdfile, paste("# Instead, please edit",
                                      basename(y), "in _episodes_rmd/"), after = 2)
       writeLines(mdfile, con)
       close(con)
index 3a2395f3cf803ffaa90369936fd253ab06994e71..194f12421a6d1fd64a7ee2b367bbcf776953da05 100755 (executable)
@@ -4,5 +4,5 @@
 # The Makefile passes in the names of files.
 
 if [ $# -ne 0 ] ; then
-    Rscript -e "source('bin/generate_md_episodes.R')"
+    Rscript -e "source('bin/generate_md_episodes.R')" "$@"
 fi
index 93a10d9b2e958560ef70a734622e93cdc2eb849e..84c28f37c5300fea1e065f1be06196b60cc4db7f 100755 (executable)
@@ -18,6 +18,9 @@ __version__ = '0.3'
 # Where to look for source Markdown files.
 SOURCE_DIRS = ['', '_episodes', '_extras']
 
+# Where to look for source Rmd files.
+SOURCE_RMD_DIRS = ['_episodes_rmd']
+
 # Required files: each entry is ('path': YAML_required).
 # FIXME: We do not yet validate whether any files have the required
 #   YAML headers, but should in the future.
@@ -99,6 +102,7 @@ BREAK_METADATA_FIELDS = {
 }
 
 # How long are lines allowed to be?
+# Please keep this in sync with .editorconfig!
 MAX_LINE_LEN = 100
 
 
@@ -108,6 +112,7 @@ def main():
     args = parse_args()
     args.reporter = Reporter()
     check_config(args.reporter, args.source_dir)
+    check_source_rmd(args.reporter, args.source_dir, args.parser)
     args.references = read_references(args.reporter, args.reference_path)
 
     docs = read_all_markdown(args.source_dir, args.parser)
@@ -171,7 +176,7 @@ def check_config(reporter, source_dir):
     reporter.check_field(config_file, 'configuration',
                          config, 'kind', 'lesson')
     reporter.check_field(config_file, 'configuration',
-                         config, 'carpentry', ('swc', 'dc', 'lc'))
+                         config, 'carpentry', ('swc', 'dc', 'lc', 'cp'))
     reporter.check_field(config_file, 'configuration', config, 'title')
     reporter.check_field(config_file, 'configuration', config, 'email')
 
@@ -184,6 +189,19 @@ def check_config(reporter, source_dir):
                    'configuration',
                    '"root" not set to "." in configuration')
 
+def check_source_rmd(reporter, source_dir, parser):
+    """Check that Rmd episode files include `source: Rmd`"""
+
+    episode_rmd_dir = [os.path.join(source_dir, d) for d in SOURCE_RMD_DIRS]
+    episode_rmd_files = [os.path.join(d, '*.Rmd') for d in episode_rmd_dir]
+    results = {}
+    for pat in episode_rmd_files:
+        for f in glob.glob(pat):
+            data = read_markdown(parser, f)
+            dy = data['metadata']
+            if dy:
+                reporter.check_field(f, 'episode_rmd',
+                                     dy, 'source', 'Rmd')
 
 def read_references(reporter, ref_path):
     """Read shared file of reference links, returning dictionary of valid references