From ecc2efa23864894301ee3991f84804f737d07a84 Mon Sep 17 00:00:00 2001
From: Erin Becker
Date: Tue, 27 Feb 2018 15:29:55 -0800
Subject: [PATCH 01/79] Remove out-of-date CoC language
---
CONDUCT.md | 35 +----------------------------------
1 file changed, 1 insertion(+), 34 deletions(-)
diff --git a/CONDUCT.md b/CONDUCT.md
index 5e4943b4..acf6fb69 100644
--- a/CONDUCT.md
+++ b/CONDUCT.md
@@ -4,42 +4,9 @@ title: "Contributor Code of Conduct"
permalink: /conduct/
---
As contributors and maintainers of this project,
-we pledge to respect all people who contribute through reporting issues,
-posting feature requests,
-updating documentation,
-submitting pull requests or patches,
-and other activities.
-
-We are committed to making participation in this project a harassment-free experience for everyone,
-regardless of level of experience,
-gender,
-gender identity and expression,
-sexual orientation,
-disability,
-personal appearance,
-body size,
-race,
-ethnicity,
-age,
-or religion.
-
-Examples of unacceptable behavior by participants include the use of sexual language or imagery,
-derogatory comments or personal attacks,
-trolling,
-public or private harassment,
-insults,
-or other unprofessional conduct.
-
-Project maintainers have the right and responsibility to remove, edit, or reject
-comments, commits, code, wiki edits, issues, and other contributions
-that are not aligned to our [Code of Conduct][coc].
-Project maintainers who do not follow the Code of Conduct may be removed from the project team.
+we pledge to follow the [Carpentry Code of Conduct][coc].
Instances of abusive, harassing, or otherwise unacceptable behavior
may be reported by following our [reporting guidelines][coc-reporting].
-
-- [Software and Data Carpentry Code of Conduct][coc]
-- [Code of Conduct Reporting Guide][coc-reporting]
-
{% include links.md %}
From e4dd6164ea3ecd478202c9d341c01b9f599d53e8 Mon Sep 17 00:00:00 2001
From: Katrin Leinweber
Date: Sat, 3 Mar 2018 13:01:39 +0100
Subject: [PATCH 02/79] Link DOIs to preferred resolver
---
_includes/lc/intro.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/_includes/lc/intro.html b/_includes/lc/intro.html
index 6794b542..a4a53eca 100644
--- a/_includes/lc/intro.html
+++ b/_includes/lc/intro.html
@@ -14,6 +14,6 @@
Library Carpentry introduces you to the fundamentals of computing
and provides you with a platform for further self-directed learning.
For more information on what we teach and why, please see our paper
- "Library Carpentry: software skills training for library professionals".
+ "Library Carpentry: software skills training for library professionals".
From ad4cd67d971e426afee178259fe52b62072db0ae Mon Sep 17 00:00:00 2001
From: Katrin Leinweber <9948149+katrinleinweber@users.noreply.github.com>
Date: Mon, 19 Mar 2018 08:11:15 +0100
Subject: [PATCH 03/79] Fix source of typo #646
---
bin/lesson_initialize.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/lesson_initialize.py b/bin/lesson_initialize.py
index acb253b5..cf9735ec 100755
--- a/bin/lesson_initialize.py
+++ b/bin/lesson_initialize.py
@@ -87,7 +87,7 @@
There are many ways to contribute,
from writing new exercises and improving existing ones
to updating or filling in the documentation
-and and submitting [bug reports][issues]
+and submitting [bug reports][issues]
about things that don't work, aren't clear, or are missing.
If you are looking for ideas, please see the 'Issues' tab for
a list of issues associated with this repository,
From cd798b9e3ca478601153882bc39fe03043ddd348 Mon Sep 17 00:00:00 2001
From: Raniere Silva
Date: Thu, 22 Mar 2018 19:13:00 +0000
Subject: [PATCH 04/79] Add swc-releases to _includes/links
Close #217
---
_includes/links.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/_includes/links.md b/_includes/links.md
index 273d63ea..a5af4246 100644
--- a/_includes/links.md
+++ b/_includes/links.md
@@ -28,6 +28,7 @@
[ruby-installer]: https://rubyinstaller.org/
[rubygems]: https://rubygems.org/pages/download/
[styles]: https://github.com/swcarpentry/styles/
+[swc-releases]: https://github.com/swcarpentry/swc-releases
[training]: https://swcarpentry.github.io/instructor-training/
[workshop-repo]: {{ site.workshop_repo }}
[yaml]: http://yaml.org/
From 91a6d2ab214b6fcc79013102e3af1061b6d7dbf0 Mon Sep 17 00:00:00 2001
From: Raniere Silva
Date: Thu, 22 Mar 2018 19:17:17 +0000
Subject: [PATCH 05/79] Update Trademark
Close #211
---
LICENSE.md | 8 ++++----
_includes/links.md | 1 +
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/LICENSE.md b/LICENSE.md
index 0e87b587..e4dde15c 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -74,10 +74,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## Trademark
"Software Carpentry" and "Data Carpentry" and their respective logos
-are registered trademarks of [NumFOCUS][numfocus].
+are registered trademarks of [Community Initiatives][CI].
[cc-by-human]: https://creativecommons.org/licenses/by/4.0/
[cc-by-legal]: https://creativecommons.org/licenses/by/4.0/legalcode
-[mit-license]: https://opensource.org/licenses/mit-license.html
-[numfocus]: https://numfocus.org/
-[osi]: https://opensource.org
+[mit-license]: http://opensource.org/licenses/mit-license.html
+[ci]: http://communityin.org/
+[osi]: http://opensource.org
diff --git a/_includes/links.md b/_includes/links.md
index a5af4246..ce8660e9 100644
--- a/_includes/links.md
+++ b/_includes/links.md
@@ -17,6 +17,7 @@
[mit-license]: https://opensource.org/licenses/mit-license.html
[morea]: https://morea-framework.github.io/
[numfocus]: https://numfocus.org/
+[ci]: http://communityin.org/
[osi]: https://opensource.org
[pandoc]: https://pandoc.org/
[paper-now]: https://github.com/PeerJ/paper-now
From ae4a6939c6622f29a15dc642e55f6602807e1c5d Mon Sep 17 00:00:00 2001
From: Raniere Silva
Date: Thu, 22 Mar 2018 19:21:39 +0000
Subject: [PATCH 06/79] Improve language on CONTRIBUTING file
As @marwahaha said
> "master repository" feels overloaded,
> since typically "master" refers to a branch name.
We are going to use "originating repository".
---
bin/lesson_initialize.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/bin/lesson_initialize.py b/bin/lesson_initialize.py
index cf9735ec..aeffdec7 100755
--- a/bin/lesson_initialize.py
+++ b/bin/lesson_initialize.py
@@ -126,22 +126,22 @@
The maintainers are community volunteers and have final say over what gets merged into the lesson.
To use the web interface for contributing to a lesson:
-1. Fork the master repository to your GitHub profile.
+1. Fork the originating repository to your GitHub profile.
2. Within your version of the forked repository, move to the `gh-pages` branch and
create a new branch for each significant change being made.
3. Navigate to the file(s) you wish to change within the new branches and make revisions as required.
4. Commit all changed files within the appropriate branches.
5. Create individual pull requests from each of your changed branches
-to the `gh-pages` branch within the master repository.
+to the `gh-pages` branch within the originating repository.
6. If you receive feedback, make changes using your issue-specific branches of the forked
repository and the pull requests will update automatically.
7. Repeat as needed until all feedback has been addressed.
-When starting work, please make sure your clone of the master `gh-pages` branch is up-to-date
+When starting work, please make sure your clone of the originating `gh-pages` branch is up-to-date
before creating your own revision-specific branch(es) from there.
Additionally, please only work from your newly-created branch(es) and *not*
-your clone of the master `gh-pages` branch.
-Lastly, published copies of all the lessons are available in the `gh-pages` branch of the master
+your clone of the originating `gh-pages` branch.
+Lastly, published copies of all the lessons are available in the `gh-pages` branch of the originating
repository for reference while revising.
## Other Resources
From d46a5784feaa2f5b0c4111eae23a020518723311 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Michonneau?=
Date: Wed, 4 Apr 2018 10:01:36 -0400
Subject: [PATCH 07/79] don't break words in code
---
assets/css/bootstrap.css | 1 +
1 file changed, 1 insertion(+)
diff --git a/assets/css/bootstrap.css b/assets/css/bootstrap.css
index 0fe7cd5b..6704f50c 100644
--- a/assets/css/bootstrap.css
+++ b/assets/css/bootstrap.css
@@ -107,6 +107,7 @@ pre,
samp {
font-family: monospace, monospace;
font-size: 1em;
+ hyphens: none;
}
button,
input,
From 1182f75f75c097822796cd4b2da876f4d7f9655f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Michonneau?=
Date: Mon, 9 Apr 2018 16:06:44 -0400
Subject: [PATCH 08/79] check hex color using lowercase
---
bin/repo_check.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/repo_check.py b/bin/repo_check.py
index fd04ce93..ba1edf5b 100755
--- a/bin/repo_check.py
+++ b/bin/repo_check.py
@@ -131,7 +131,7 @@ def check_labels(reporter, repo_url):
overlap = set(EXPECTED.keys()).intersection(set(actual.keys()))
for name in sorted(overlap):
- reporter.check(EXPECTED[name] == actual[name],
+ reporter.check(EXPECTED[name].lower() == actual[name].lower(),
None,
'Color mis-match for label {0} in {1}: expected {2}, found {3}',
name, repo_url, EXPECTED[name], actual[name])
From fd9e75ee8a62d40e6f7ebbb6882dde68cf7fc3be Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Michonneau?=
Date: Mon, 9 Apr 2018 16:07:20 -0400
Subject: [PATCH 09/79] update github labels
---
bin/repo_check.py | 29 ++++++++++++++++++++---------
1 file changed, 20 insertions(+), 9 deletions(-)
diff --git a/bin/repo_check.py b/bin/repo_check.py
index ba1edf5b..d8f379cc 100755
--- a/bin/repo_check.py
+++ b/bin/repo_check.py
@@ -35,15 +35,26 @@
# Expected labels and colors.
EXPECTED = {
- 'bug' : 'bd2c00',
- 'discussion' : 'fc8dc1',
- 'enhancement' : '9cd6dc',
- 'help-wanted' : 'f4fd9c',
- 'instructor-training' : '6e5494',
- 'newcomer-friendly' : 'eec275',
- 'question' : '808040',
- 'template-and-tools' : '2b3990',
- 'work-in-progress' : '7ae78e'
+ 'help wanted' : 'dcecc7',
+ 'status:in progress' : '9bcc65',
+ 'status:changes requested' : '679f38',
+ 'status:wait' : 'fff2df',
+ 'status:refer to cac' : 'ffdfb2',
+ 'status:need more info' : 'ee6c00',
+ 'status:blocked' : 'e55100',
+ 'status:out of scope' : 'eeeeee',
+ 'status:duplicate' : 'bdbdbd',
+ 'type:typo text' : 'f8bad0',
+ 'type:bug' : 'eb3f79',
+ 'type:formatting' : 'ac1357',
+ 'type:template and tools' : '7985cb',
+ 'type:instructor guide' : '00887a',
+ 'type:discussion' : 'b2e5fc',
+ 'type:enhancement' : '7fdeea',
+ 'type:clarification' : '00acc0',
+ 'type:teaching example' : 'ced8dc',
+ 'good first issue' : 'ffeb3a',
+ 'high priority' : 'd22e2e'
}
From e611262a108d1290ada4aed18e4fa3f888b0bf40 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Michonneau?=
Date: Wed, 11 Apr 2018 09:26:04 -0400
Subject: [PATCH 10/79] use CRAN canonical addresses for packages
---
_includes/links.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/_includes/links.md b/_includes/links.md
index ce8660e9..be3008f7 100644
--- a/_includes/links.md
+++ b/_includes/links.md
@@ -4,9 +4,9 @@
[email]: mailto:lessons@software-carpentry.org
[contrib-covenant]: https://contributor-covenant.org/
[contributing]: {{ site.github.repository_url }}/blob/gh-pages/CONTRIBUTING.md
-[cran-checkpoint]: https://cran.r-project.org/web/packages/checkpoint/index.html
-[cran-knitr]: https://cran.r-project.org/web/packages/knitr/index.html
-[cran-stringr]: https://cran.r-project.org/web/packages/stringr/index.html
+[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
[github-importer]: https://import.github.com/
[importer]: https://github.com/new/import
[jekyll-collection]: https://jekyllrb.com/docs/collections/
From 2df359cd12f55b02179407c8e1ab855e5abaea5d Mon Sep 17 00:00:00 2001
From: Jonah Duckles
Date: Fri, 13 Apr 2018 13:09:19 +1200
Subject: [PATCH 11/79] Updating to handbook as canonical source for CoC
---
_includes/links.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/_includes/links.md b/_includes/links.md
index be3008f7..7fb21413 100644
--- a/_includes/links.md
+++ b/_includes/links.md
@@ -33,6 +33,6 @@
[training]: https://swcarpentry.github.io/instructor-training/
[workshop-repo]: {{ site.workshop_repo }}
[yaml]: http://yaml.org/
-[coc]: https://software-carpentry.org/conduct/
-[coc-reporting]: https://software-carpentry.org/CoC-reporting/
+[coc]: https://docs.carpentries.org/topic_folders/policies/code-of-conduct.html
+[coc-reporting]: https://docs.carpentries.org/topic_folders/policies/code-of-conduct.html#reporting-guidelines
[lesson-example]: https://swcarpentry.github.io/lesson-example/
From e7f98a6136639ecf0eed09535f8b801dae2ff49c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Michonneau?=
Date: Tue, 17 Apr 2018 10:53:24 -0400
Subject: [PATCH 12/79] fix github meta data
---
_layouts/base.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/_layouts/base.html b/_layouts/base.html
index f1e90d1a..a188a714 100644
--- a/_layouts/base.html
+++ b/_layouts/base.html
@@ -8,7 +8,7 @@
-
+
From 26ccd8cd2d0960f7a8e86d5a97b3259e8ef611e7 Mon Sep 17 00:00:00 2001
From: Katrin Leinweber
Date: Sun, 18 Mar 2018 18:35:40 +0100
Subject: [PATCH 13/79] Secure hyperlinks
---
_includes/links.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/_includes/links.md b/_includes/links.md
index 7fb21413..965c5108 100644
--- a/_includes/links.md
+++ b/_includes/links.md
@@ -23,7 +23,7 @@
[paper-now]: https://github.com/PeerJ/paper-now
[python-gapminder]: https://swcarpentry.github.io/python-novice-gapminder/
[pyyaml]: https://pypi.python.org/pypi/PyYAML
-[r-markdown]: http://rmarkdown.rstudio.com/
+[r-markdown]: https://rmarkdown.rstudio.com/
[rstudio]: https://www.rstudio.com/
[ruby-install-guide]: https://www.ruby-lang.org/en/downloads/
[ruby-installer]: https://rubyinstaller.org/
From 3ed286691146cd05ad1bf10582fdfa5875599fa0 Mon Sep 17 00:00:00 2001
From: Katrin Leinweber
Date: Sun, 18 Mar 2018 18:38:17 +0100
Subject: [PATCH 14/79] Resort hyperlinks alphabetically
---
_includes/links.md | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/_includes/links.md b/_includes/links.md
index 965c5108..3d8dbfbd 100644
--- a/_includes/links.md
+++ b/_includes/links.md
@@ -1,12 +1,16 @@
[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/
+[coc-reporting]: https://docs.carpentries.org/topic_folders/policies/code-of-conduct.html#reporting-guidelines
+[coc]: https://docs.carpentries.org/topic_folders/policies/code-of-conduct.html
+[concept-maps]: https://carpentries.github.io/instructor-training/05-memory/
[concept-maps]: https://carpentries.github.io/instructor-training/05-memory/
-[email]: mailto:lessons@software-carpentry.org
[contrib-covenant]: https://contributor-covenant.org/
[contributing]: {{ site.github.repository_url }}/blob/gh-pages/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
+[cran-checkpoint]: https://cran.r-project.org/web/packages/checkpoint/index.html
+[cran-knitr]: https://cran.r-project.org/web/packages/knitr/index.html
+[cran-stringr]: https://cran.r-project.org/web/packages/stringr/index.html
+[email]: mailto:lessons@software-carpentry.org
[github-importer]: https://import.github.com/
[importer]: https://github.com/new/import
[jekyll-collection]: https://jekyllrb.com/docs/collections/
@@ -14,10 +18,10 @@
[jekyll-windows]: http://jekyll-windows.juthilo.com/
[jekyll]: https://jekyllrb.com/
[jupyter]: https://jupyter.org/
+[lesson-example]: https://swcarpentry.github.io/lesson-example/
[mit-license]: https://opensource.org/licenses/mit-license.html
[morea]: https://morea-framework.github.io/
[numfocus]: https://numfocus.org/
-[ci]: http://communityin.org/
[osi]: https://opensource.org
[pandoc]: https://pandoc.org/
[paper-now]: https://github.com/PeerJ/paper-now
@@ -33,6 +37,3 @@
[training]: https://swcarpentry.github.io/instructor-training/
[workshop-repo]: {{ site.workshop_repo }}
[yaml]: http://yaml.org/
-[coc]: https://docs.carpentries.org/topic_folders/policies/code-of-conduct.html
-[coc-reporting]: https://docs.carpentries.org/topic_folders/policies/code-of-conduct.html#reporting-guidelines
-[lesson-example]: https://swcarpentry.github.io/lesson-example/
From 0d0f943bbf90d0900bb7cb5521a92f31380f7d89 Mon Sep 17 00:00:00 2001
From: Katrin Leinweber
Date: Sun, 18 Mar 2018 18:38:26 +0100
Subject: [PATCH 15/79] Reflect merger
---
_includes/links.md | 1 -
1 file changed, 1 deletion(-)
diff --git a/_includes/links.md b/_includes/links.md
index 3d8dbfbd..63e9b002 100644
--- a/_includes/links.md
+++ b/_includes/links.md
@@ -34,6 +34,5 @@
[rubygems]: https://rubygems.org/pages/download/
[styles]: https://github.com/swcarpentry/styles/
[swc-releases]: https://github.com/swcarpentry/swc-releases
-[training]: https://swcarpentry.github.io/instructor-training/
[workshop-repo]: {{ site.workshop_repo }}
[yaml]: http://yaml.org/
From bf65236030110a5e17c47115061068b0260976e9 Mon Sep 17 00:00:00 2001
From: Katrin Leinweber <9948149+katrinleinweber@users.noreply.github.com>
Date: Sun, 18 Mar 2018 18:47:22 +0100
Subject: [PATCH 16/79] Convert CRAN links to preferred, canonical form
https://cran.r-project.org/doc/manuals/r-patched/R-exts.html#Specifying-URLs
---
_includes/links.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/_includes/links.md b/_includes/links.md
index 63e9b002..2fb9f74c 100644
--- a/_includes/links.md
+++ b/_includes/links.md
@@ -7,9 +7,9 @@
[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
-[cran-checkpoint]: https://cran.r-project.org/web/packages/checkpoint/index.html
-[cran-knitr]: https://cran.r-project.org/web/packages/knitr/index.html
-[cran-stringr]: https://cran.r-project.org/web/packages/stringr/index.html
+[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
[github-importer]: https://import.github.com/
[importer]: https://github.com/new/import
From 51293be6b00cfca6b1edf9d8d9613c45aaec4fb8 Mon Sep 17 00:00:00 2001
From: Maxim Belkin
Date: Thu, 19 Apr 2018 13:01:40 -0500
Subject: [PATCH 17/79] links.md: remove duplicate line
---
_includes/links.md | 1 -
1 file changed, 1 deletion(-)
diff --git a/_includes/links.md b/_includes/links.md
index 2fb9f74c..be88dac8 100644
--- a/_includes/links.md
+++ b/_includes/links.md
@@ -4,7 +4,6 @@
[coc-reporting]: https://docs.carpentries.org/topic_folders/policies/code-of-conduct.html#reporting-guidelines
[coc]: https://docs.carpentries.org/topic_folders/policies/code-of-conduct.html
[concept-maps]: https://carpentries.github.io/instructor-training/05-memory/
-[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
[cran-checkpoint]: https://cran.r-project.org/package=checkpoint
From f82fed8a8cb8d75147733eb9057a6a6c453a2007 Mon Sep 17 00:00:00 2001
From: Maxim Belkin
Date: Thu, 19 Apr 2018 16:20:58 -0500
Subject: [PATCH 18/79] bin/util.py: fix error handling for Python 2
---
bin/util.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/util.py b/bin/util.py
index 0cc8de69..f4680b43 100644
--- a/bin/util.py
+++ b/bin/util.py
@@ -160,7 +160,7 @@ def load_yaml(filename):
try:
with open(filename, 'r') as reader:
return yaml.load(reader)
- except (yaml.YAMLError, FileNotFoundError) as e:
+ except (yaml.YAMLError, IOError) as e:
print('Unable to load YAML file {0}:\n{1}'.format(filename, e), file=sys.stderr)
sys.exit(1)
From 93eb566a61595e7b00a36a934c605746167b01dc Mon Sep 17 00:00:00 2001
From: "Michael R. Crusoe"
Date: Fri, 20 Apr 2018 12:50:50 +0300
Subject: [PATCH 19/79] convert to py3.4 syntax, a few cleanups
---
bin/lesson_check.py | 91 +++++++++++++++++++---------------------
bin/lesson_initialize.py | 5 +--
bin/repo_check.py | 59 ++++++++++++++------------
bin/test_lesson_check.py | 4 +-
bin/util.py | 26 ++++++------
bin/workshop_check.py | 25 +++++------
6 files changed, 107 insertions(+), 103 deletions(-)
diff --git a/bin/lesson_check.py b/bin/lesson_check.py
index 66f6310c..a9b6c9c8 100755
--- a/bin/lesson_check.py
+++ b/bin/lesson_check.py
@@ -4,15 +4,14 @@
Check lesson files and their contents.
"""
-from __future__ import print_function
-import sys
+
import os
import glob
-import json
import re
from optparse import OptionParser
-from util import Reporter, read_markdown, load_yaml, check_unwanted_files, require, IMAGE_FILE_SUFFIX
+from util import (Reporter, read_markdown, load_yaml, check_unwanted_files,
+ require)
__version__ = '0.3'
@@ -23,8 +22,9 @@
# FIXME: We do not yet validate whether any files have the required
# YAML headers, but should in the future.
# The '%' is replaced with the source directory path for checking.
-# Episodes are handled specially, and extra files in '_extras' are also handled specially.
-# This list must include all the Markdown files listed in the 'bin/initialize' script.
+# Episodes are handled specially, and extra files in '_extras' are also handled
+# specially. This list must include all the Markdown files listed in the
+# 'bin/initialize' script.
REQUIRED_FILES = {
'%/CONDUCT.md': True,
'%/CONTRIBUTING.md': False,
@@ -101,6 +101,7 @@
# How long are lines allowed to be?
MAX_LINE_LEN = 100
+
def main():
"""Main driver."""
@@ -110,9 +111,9 @@ def main():
args.references = read_references(args.reporter, args.reference_path)
docs = read_all_markdown(args.source_dir, args.parser)
- check_fileset(args.source_dir, args.reporter, docs.keys())
+ check_fileset(args.source_dir, args.reporter, list(docs.keys()))
check_unwanted_files(args.source_dir, args.reporter)
- for filename in docs.keys():
+ for filename in list(docs.keys()):
checker = create_checker(args, filename, docs[filename])
checker.check()
@@ -160,8 +161,10 @@ def check_config(reporter, source_dir):
config_file = os.path.join(source_dir, '_config.yml')
config = load_yaml(config_file)
- reporter.check_field(config_file, 'configuration', config, 'kind', 'lesson')
- reporter.check_field(config_file, 'configuration', config, 'carpentry', ('swc', 'dc', 'lc'))
+ reporter.check_field(config_file, 'configuration',
+ config, 'kind', 'lesson')
+ reporter.check_field(config_file, 'configuration',
+ config, 'carpentry', ('swc', 'dc', 'lc'))
reporter.check_field(config_file, 'configuration', config, 'title')
reporter.check_field(config_file, 'configuration', config, 'email')
@@ -235,17 +238,17 @@ def check_fileset(source_dir, reporter, filenames_present):
if m and m.group(1):
seen.append(m.group(1))
else:
- reporter.add(None, 'Episode {0} has badly-formatted filename', filename)
+ reporter.add(
+ None, 'Episode {0} has badly-formatted filename', filename)
# Check for duplicate episode numbers.
reporter.check(len(seen) == len(set(seen)),
- None,
- 'Duplicate episode numbers {0} vs {1}',
- sorted(seen), sorted(set(seen)))
+ None,
+ 'Duplicate episode numbers {0} vs {1}',
+ sorted(seen), sorted(set(seen)))
# Check that numbers are consecutive.
- seen = [int(s) for s in seen]
- seen.sort()
+ seen = sorted([int(s) for s in seen])
clean = True
for i in range(len(seen) - 1):
clean = clean and ((seen[i+1] - seen[i]) == 1)
@@ -271,7 +274,7 @@ def __init__(self, args, filename, metadata, metadata_len, text, lines, doc):
super(CheckBase, self).__init__()
self.args = args
- self.reporter = self.args.reporter # for convenience
+ self.reporter = self.args.reporter # for convenience
self.filename = filename
self.metadata = metadata
self.metadata_len = metadata_len
@@ -281,7 +284,6 @@ def __init__(self, args, filename, metadata, metadata_len, text, lines, doc):
self.layout = None
-
def check(self):
"""Run tests."""
@@ -292,7 +294,6 @@ def check(self):
self.check_codeblock_classes()
self.check_defined_link_references()
-
def check_metadata(self):
"""Check the YAML metadata."""
@@ -301,53 +302,51 @@ def check_metadata(self):
'Missing metadata entirely')
if self.metadata and (self.layout is not None):
- self.reporter.check_field(self.filename, 'metadata', self.metadata, 'layout', self.layout)
-
+ self.reporter.check_field(
+ self.filename, 'metadata', self.metadata, 'layout', self.layout)
def check_line_lengths(self):
"""Check the raw text of the lesson body."""
if self.args.line_lengths:
- over = [i for (i, l, n) in self.lines if (n > MAX_LINE_LEN) and (not l.startswith('!'))]
+ over = [i for (i, l, n) in self.lines if (
+ n > MAX_LINE_LEN) and (not l.startswith('!'))]
self.reporter.check(not over,
self.filename,
'Line(s) are too long: {0}',
', '.join([str(i) for i in over]))
-
def check_trailing_whitespace(self):
"""Check for whitespace at the ends of lines."""
if self.args.trailing_whitespace:
- trailing = [i for (i, l, n) in self.lines if P_TRAILING_WHITESPACE.match(l)]
+ trailing = [
+ i for (i, l, n) in self.lines if P_TRAILING_WHITESPACE.match(l)]
self.reporter.check(not trailing,
self.filename,
'Line(s) end with whitespace: {0}',
', '.join([str(i) for i in trailing]))
-
def check_blockquote_classes(self):
"""Check that all blockquotes have known classes."""
- for node in self.find_all(self.doc, {'type' : 'blockquote'}):
+ for node in self.find_all(self.doc, {'type': 'blockquote'}):
cls = self.get_val(node, 'attr', 'class')
self.reporter.check(cls in KNOWN_BLOCKQUOTES,
(self.filename, self.get_loc(node)),
'Unknown or missing blockquote type {0}',
cls)
-
def check_codeblock_classes(self):
"""Check that all code blocks have known classes."""
- for node in self.find_all(self.doc, {'type' : 'codeblock'}):
+ for node in self.find_all(self.doc, {'type': 'codeblock'}):
cls = self.get_val(node, 'attr', 'class')
self.reporter.check(cls in KNOWN_CODEBLOCKS,
(self.filename, self.get_loc(node)),
'Unknown or missing code block type {0}',
cls)
-
def check_defined_link_references(self):
"""Check that defined links resolve in the file.
@@ -355,7 +354,7 @@ def check_defined_link_references(self):
"""
result = set()
- for node in self.find_all(self.doc, {'type' : 'text'}):
+ for node in self.find_all(self.doc, {'type': 'text'}):
for match in P_INTERNAL_LINK_REF.findall(node['value']):
text = match[0]
link = match[1]
@@ -366,11 +365,10 @@ def check_defined_link_references(self):
'Internally-defined links may be missing definitions: {0}',
', '.join(sorted(result)))
-
def find_all(self, node, pattern, accum=None):
"""Find all matches for a pattern."""
- assert type(pattern) == dict, 'Patterns must be dictionaries'
+ assert isinstance(pattern, dict), 'Patterns must be dictionaries'
if accum is None:
accum = []
if self.match(node, pattern):
@@ -379,7 +377,6 @@ def find_all(self, node, pattern, accum=None):
self.find_all(child, pattern, accum)
return accum
-
def match(self, node, pattern):
"""Does this node match the given pattern?"""
@@ -387,15 +384,14 @@ def match(self, node, pattern):
if key not in node:
return False
val = pattern[key]
- if type(val) == str:
+ if isinstance(val, str):
if node[key] != val:
return False
- elif type(val) == dict:
+ elif isinstance(val, dict):
if not self.match(node[key], val):
return False
return True
-
def get_val(self, node, *chain):
"""Get value one or more levels down."""
@@ -406,7 +402,6 @@ def get_val(self, node, *chain):
break
return curr
-
def get_loc(self, node):
"""Convenience method to get node's line number."""
@@ -420,8 +415,8 @@ class CheckNonJekyll(CheckBase):
"""Check a file that isn't translated by Jekyll."""
def __init__(self, args, filename, metadata, metadata_len, text, lines, doc):
- super(CheckNonJekyll, self).__init__(args, filename, metadata, metadata_len, text, lines, doc)
-
+ super(CheckNonJekyll, self).__init__(
+ args, filename, metadata, metadata_len, text, lines, doc)
def check_metadata(self):
self.reporter.check(self.metadata is None,
@@ -433,7 +428,8 @@ class CheckIndex(CheckBase):
"""Check the main index page."""
def __init__(self, args, filename, metadata, metadata_len, text, lines, doc):
- super(CheckIndex, self).__init__(args, filename, metadata, metadata_len, text, lines, doc)
+ super(CheckIndex, self).__init__(args, filename,
+ metadata, metadata_len, text, lines, doc)
self.layout = 'lesson'
def check_metadata(self):
@@ -447,8 +443,8 @@ class CheckEpisode(CheckBase):
"""Check an episode page."""
def __init__(self, args, filename, metadata, metadata_len, text, lines, doc):
- super(CheckEpisode, self).__init__(args, filename, metadata, metadata_len, text, lines, doc)
-
+ super(CheckEpisode, self).__init__(args, filename,
+ metadata, metadata_len, text, lines, doc)
def check(self):
"""Run extra tests."""
@@ -456,7 +452,6 @@ def check(self):
super(CheckEpisode, self).check()
self.check_reference_inclusion()
-
def check_metadata(self):
super(CheckEpisode, self).check_metadata()
if self.metadata:
@@ -470,19 +465,17 @@ def check_metadata(self):
else:
self.check_metadata_fields(TEACHING_METADATA_FIELDS)
-
def check_metadata_fields(self, expected):
for (name, type_) in expected:
if name not in self.metadata:
self.reporter.add(self.filename,
'Missing metadata field {0}',
name)
- elif type(self.metadata[name]) != type_:
+ elif not isinstance(self.metadata[name], type_):
self.reporter.add(self.filename,
'"{0}" has wrong type in metadata ({1} instead of {2})',
name, type(self.metadata[name]), type_)
-
def check_reference_inclusion(self):
"""Check that links file has been included."""
@@ -507,7 +500,8 @@ class CheckReference(CheckBase):
"""Check the reference page."""
def __init__(self, args, filename, metadata, metadata_len, text, lines, doc):
- super(CheckReference, self).__init__(args, filename, metadata, metadata_len, text, lines, doc)
+ super(CheckReference, self).__init__(
+ args, filename, metadata, metadata_len, text, lines, doc)
self.layout = 'reference'
@@ -515,7 +509,8 @@ class CheckGeneric(CheckBase):
"""Check a generic page."""
def __init__(self, args, filename, metadata, metadata_len, text, lines, doc):
- super(CheckGeneric, self).__init__(args, filename, metadata, metadata_len, text, lines, doc)
+ super(CheckGeneric, self).__init__(args, filename,
+ metadata, metadata_len, text, lines, doc)
self.layout = 'page'
diff --git a/bin/lesson_initialize.py b/bin/lesson_initialize.py
index aeffdec7..7b0b6151 100755
--- a/bin/lesson_initialize.py
+++ b/bin/lesson_initialize.py
@@ -3,7 +3,6 @@
"""Initialize a newly-created repository."""
-from __future__ import print_function
import sys
import os
@@ -121,7 +120,7 @@
If you choose to contribute via GitHub, you may want to look at
[How to Contribute to an Open Source Project on GitHub][how-contribute].
-To manage changes, we follow [GitHub flow][github-flow].
+To manage changes, we follow [GitHub flow][github-flow].
Each lesson has two maintainers who review issues and pull requests or encourage others to do so.
The maintainers are community volunteers and have final say over what gets merged into the lesson.
To use the web interface for contributing to a lesson:
@@ -279,7 +278,7 @@
ROOT_AIO_MD = '''\
---
-layout: page
+layout: page
root: .
---
+{% comment %}
+Create anchor for each one of the episodes.
+{% endcomment %}
+{% for episode in site.episodes %}
+
+{% endfor %}
\ No newline at end of file
diff --git a/bin/boilerplate/_extras/guide.md b/bin/boilerplate/_extras/guide.md
new file mode 100644
index 00000000..28caf722
--- /dev/null
+++ b/bin/boilerplate/_extras/guide.md
@@ -0,0 +1,5 @@
+---
+layout: page
+title: "Instructor Notes"
+---
+FIXME
\ No newline at end of file
diff --git a/bin/boilerplate/aio.md b/bin/boilerplate/aio.md
new file mode 100644
index 00000000..172b670a
--- /dev/null
+++ b/bin/boilerplate/aio.md
@@ -0,0 +1,36 @@
+---
+layout: page
+root: .
+---
+
+{% comment %}
+Create anchor for each one of the episodes.
+{% endcomment %}
+{% for episode in site.episodes %}
+
+{% endfor %}
\ No newline at end of file
diff --git a/bin/boilerplate/index.md b/bin/boilerplate/index.md
new file mode 100644
index 00000000..925b239b
--- /dev/null
+++ b/bin/boilerplate/index.md
@@ -0,0 +1,11 @@
+---
+layout: lesson
+root: .
+permalink: index.html # Is the only page that don't follow the partner /:path/index.html
+---
+FIXME: home page introduction
+
+> ## Prerequisites
+>
+> FIXME
+{: .prereq}
\ No newline at end of file
diff --git a/bin/boilerplate/reference.md b/bin/boilerplate/reference.md
new file mode 100644
index 00000000..0436d062
--- /dev/null
+++ b/bin/boilerplate/reference.md
@@ -0,0 +1,8 @@
+---
+layout: reference
+root: .
+---
+
+## Glossary
+
+FIXME
\ No newline at end of file
diff --git a/bin/boilerplate/setup.md b/bin/boilerplate/setup.md
new file mode 100644
index 00000000..ba8e8f59
--- /dev/null
+++ b/bin/boilerplate/setup.md
@@ -0,0 +1,6 @@
+---
+layout: page
+title: Setup
+root: .
+---
+FIXME
\ No newline at end of file
diff --git a/bin/lesson_initialize.py b/bin/lesson_initialize.py
index edddbca9..83f455e6 100755
--- a/bin/lesson_initialize.py
+++ b/bin/lesson_initialize.py
@@ -5,413 +5,23 @@
import sys
import os
-
-ROOT_AUTHORS = '''\
-FIXME: list authors' names and email addresses.
-'''
-
-ROOT_CITATION = '''\
-FIXME: describe how to cite this lesson.
-'''
-
-ROOT_CONTRIBUTING_MD = '''\
-# Contributing
-
-[Software Carpentry][swc-site] and [Data Carpentry][dc-site] are open source projects,
-and we welcome contributions of all kinds:
-new lessons,
-fixes to existing material,
-bug reports,
-and reviews of proposed changes are all welcome.
-
-## Contributor Agreement
-
-By contributing,
-you agree that we may redistribute your work under [our license](LICENSE.md).
-In exchange,
-we will address your issues and/or assess your change proposal as promptly as we can,
-and help you become a member of our community.
-Everyone involved in [Software Carpentry][swc-site] and [Data Carpentry][dc-site]
-agrees to abide by our [code of conduct](CONDUCT.md).
-
-## How to Contribute
-
-The easiest way to get started is to file an issue
-to tell us about a spelling mistake,
-some awkward wording,
-or a factual error.
-This is a good way to introduce yourself
-and to meet some of our community members.
-
-1. If you do not have a [GitHub][github] account,
- you can [send us comments by email][email].
- However,
- we will be able to respond more quickly if you use one of the other methods described below.
-
-2. If you have a [GitHub][github] account,
- or are willing to [create one][github-join],
- but do not know how to use Git,
- you can report problems or suggest improvements by [creating an issue][issues].
- This allows us to assign the item to someone
- and to respond to it in a threaded discussion.
-
-3. If you are comfortable with Git,
- and would like to add or change material,
- you can submit a pull request (PR).
- Instructions for doing this are [included below](#using-github).
-
-## Where to Contribute
-
-1. If you wish to change this lesson,
- please work in ,
- which can be viewed at .
-
-2. If you wish to change the example lesson,
- please work in ,
- which documents the format of our lessons
- and can be viewed at .
-
-3. If you wish to change the template used for workshop websites,
- please work in .
- The home page of that repository explains how to set up workshop websites,
- while the extra pages in
- 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 .
-
-## What to Contribute
-
-There are many ways to contribute,
-from writing new exercises and improving existing ones
-to updating or filling in the documentation
-and submitting [bug reports][issues]
-about things that don't work, aren't clear, or are missing.
-If you are looking for ideas, please see the 'Issues' tab for
-a list of issues associated with this repository,
-or you may also look at the issues for [Data Carpentry][dc-issues]
-and [Software Carpentry][swc-issues] projects.
-
-Comments on issues and reviews of pull requests are just as welcome:
-we are smarter together than we are on our own.
-Reviews from novices and newcomers are particularly valuable:
-it's easy for people who have been using these lessons for a while
-to forget how impenetrable some of this material can be,
-so fresh eyes are always welcome.
-
-## What *Not* to Contribute
-
-Our lessons already contain more material than we can cover in a typical workshop,
-so we are usually *not* looking for more concepts or tools to add to them.
-As a rule,
-if you want to introduce a new idea,
-you must (a) estimate how long it will take to teach
-and (b) explain what you would take out to make room for it.
-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;
-in order to be usable,
-our lessons must run equally well on all three.
-
-## Using GitHub
-
-If you choose to contribute via GitHub, you may want to look at
-[How to Contribute to an Open Source Project on GitHub][how-contribute].
-To manage changes, we follow [GitHub flow][github-flow].
-Each lesson has two maintainers who review issues and pull requests or encourage others to do so.
-The maintainers are community volunteers and have final say over what gets merged into the lesson.
-To use the web interface for contributing to a lesson:
-
-1. Fork the originating repository to your GitHub profile.
-2. Within your version of the forked repository, move to the `gh-pages` branch and
-create a new branch for each significant change being made.
-3. Navigate to the file(s) you wish to change within the new branches and make revisions as required.
-4. Commit all changed files within the appropriate branches.
-5. Create individual pull requests from each of your changed branches
-to the `gh-pages` branch within the originating repository.
-6. If you receive feedback, make changes using your issue-specific branches of the forked
-repository and the pull requests will update automatically.
-7. Repeat as needed until all feedback has been addressed.
-
-When starting work, please make sure your clone of the originating `gh-pages` branch is up-to-date
-before creating your own revision-specific branch(es) from there.
-Additionally, please only work from your newly-created branch(es) and *not*
-your clone of the originating `gh-pages` branch.
-Lastly, published copies of all the lessons are available in the `gh-pages` branch of the originating
-repository for reference while revising.
-
-## Other Resources
-
-General discussion of [Software Carpentry][swc-site] and [Data Carpentry][dc-site]
-happens on the [discussion mailing list][discuss-list],
-which everyone is welcome to join.
-You can also [reach us by email][email].
-
-[email]: mailto:admin@software-carpentry.org
-[dc-issues]: https://github.com/issues?q=user%3Adatacarpentry
-[dc-lessons]: http://datacarpentry.org/lessons/
-[dc-site]: http://datacarpentry.org/
-[discuss-list]: http://lists.software-carpentry.org/listinfo/discuss
-[github]: https://github.com
-[github-flow]: https://guides.github.com/introduction/flow/
-[github-join]: https://github.com/join
-[how-contribute]: https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github
-[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/
-'''
-
-ROOT_CONFIG_YML = '''\
-#------------------------------------------------------------
-# Values for this lesson.
-#------------------------------------------------------------
-
-# Which carpentry is this ("swc", "dc", or "lc")?
-carpentry: "swc"
-
-# Overall title for pages.
-title: "Lesson Title"
-
-# Contact. This *must* include the protocol: if it's an email
-# address, it must look like "mailto:lessons@software-carpentry.org",
-# or if it's a URL, "https://gitter.im/username/ProjectName".
-email: "mailto:lessons@software-carpentry.org"
-
-#------------------------------------------------------------
-# Generic settings (should not need to change).
-#------------------------------------------------------------
-
-# What kind of thing is this ("workshop" or "lesson")?
-kind: "lesson"
-
-# Magic to make URLs resolve both locally and on GitHub.
-# See https://help.github.com/articles/repository-metadata-on-github-pages/.
-repository: /
-
-# 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/"
-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"
-
-# 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
-
-# Specify that things in the episodes collection should be output.
-collections:
- episodes:
- output: true
- permalink: /:path/index.html
- extras:
- output: true
- permalink: /:path/index.html
-
-# Set the default layout for things in the episodes collection.
-defaults:
- - values:
- root: ..
- - scope:
- path: ""
- type: episodes
- values:
- layout: episode
-
-# Files and directories that are not to be copied.
-exclude:
- - Makefile
- - bin
-
-# Turn on built-in syntax highlighting.
-highlighter: rouge
-'''
-
-ROOT_INDEX_MD = '''\
----
-layout: lesson
-root: .
-permalink: index.html # Is the only page that don't follow the partner /:path/index.html
----
-FIXME: home page introduction
-
-> ## Prerequisites
->
-> FIXME
-{: .prereq}
-'''
-
-ROOT_REFERENCE_MD = '''\
----
-layout: reference
-root: .
----
-
-## Glossary
-
-FIXME
-'''
-
-ROOT_SETUP_MD = '''\
----
-layout: page
-title: Setup
-root: .
----
-FIXME
-'''
-
-ROOT_AIO_MD = '''\
----
-layout: page
-root: .
----
-
-{% comment %}
-Create anchor for each one of the episodes.
-{% endcomment %}
-{% for episode in site.episodes %}
-
-{% endfor %}
-'''
-
-EPISODES_INTRODUCTION_MD = '''\
----
-title: "Introduction"
-teaching: 0
-exercises: 0
-questions:
-- "Key question"
-objectives:
-- "First objective."
-keypoints:
-- "First key point."
----
-'''
-
-EXTRAS_ABOUT_MD = '''\
----
-layout: page
-title: About
----
-{% include carpentries.html %}
-'''
-
-EXTRAS_DISCUSS_MD = '''\
----
-layout: page
-title: Discussion
----
-FIXME
-'''
-
-EXTRAS_FIGURES_MD = '''\
----
-layout: page
-title: Figures
----
-
-{% comment %}
-Create anchor for each one of the episodes.
-{% endcomment %}
-{% for episode in site.episodes %}
-
-{% endfor %}
-'''
-
-EXTRAS_GUIDE_MD = '''\
----
-layout: page
-title: "Instructor Notes"
----
-FIXME
-'''
+import shutil
BOILERPLATE = (
- ('AUTHORS', ROOT_AUTHORS),
- ('CITATION', ROOT_CITATION),
- ('CONTRIBUTING.md', ROOT_CONTRIBUTING_MD),
- ('_config.yml', ROOT_CONFIG_YML),
- ('index.md', ROOT_INDEX_MD),
- ('reference.md', ROOT_REFERENCE_MD),
- ('setup.md', ROOT_SETUP_MD),
- ('aio.md', ROOT_AIO_MD),
- ('_episodes/01-introduction.md', EPISODES_INTRODUCTION_MD),
- ('_extras/about.md', EXTRAS_ABOUT_MD),
- ('_extras/discuss.md', EXTRAS_DISCUSS_MD),
- ('_extras/figures.md', EXTRAS_FIGURES_MD),
- ('_extras/guide.md', EXTRAS_GUIDE_MD),
+ '.travis.yml',
+ 'AUTHORS',
+ 'CITATION',
+ 'CONTRIBUTING.md',
+ '_config.yml',
+ 'index.md',
+ 'reference.md',
+ 'setup.md',
+ 'aio.md',
+ '_episodes/01-introduction.md',
+ '_extras/about.md',
+ '_extras/discuss.md',
+ '_extras/figures.md',
+ '_extras/guide.md',
)
@@ -420,7 +30,7 @@ def main():
# Check.
errors = False
- for (path, _) in BOILERPLATE:
+ for path in BOILERPLATE:
if os.path.exists(path):
print('Warning: {0} already exists.'.format(path), file=sys.stderr)
errors = True
@@ -429,9 +39,11 @@ def main():
sys.exit(1)
# Create.
- for (path, content) in BOILERPLATE:
- with open(path, 'w') as writer:
- writer.write(content)
+ for path in BOILERPLATE:
+ shutil.copyfile(
+ "bin/boilerplate/{}".format(path),
+ path
+ )
if __name__ == '__main__':
From aa98c3f40267a25eefff75dec28cdab207a22c8f Mon Sep 17 00:00:00 2001
From: Raniere Silva
Date: Fri, 18 May 2018 16:12:58 +0100
Subject: [PATCH 46/79] Fix line wrap after dash in code block
Close swcarpentry/styles#249
---
assets/css/lesson.scss | 1 +
1 file changed, 1 insertion(+)
diff --git a/assets/css/lesson.scss b/assets/css/lesson.scss
index 1789a7e0..9a1cc477 100644
--- a/assets/css/lesson.scss
+++ b/assets/css/lesson.scss
@@ -119,6 +119,7 @@ $codeblock-padding: 5px !default;
//----------------------------------------
code {
+ white-space: nowrap;
padding: 2px 5px;
color: #3d90d9;
background-color: #e7e7e7;
From 18b36ec72c1ac724d135bfd90df3e1357c1a819b Mon Sep 17 00:00:00 2001
From: Andy Boughton
Date: Fri, 18 May 2018 16:25:27 +0100
Subject: [PATCH 47/79] Add README to bin/lesson_initialize.py
This is a revamp of swcarpentry/styles#248.
Thanks to Andy Boughton.
---
bin/boilerplate/README.md | 28 ++++++++++++++++++++++++++++
bin/lesson_initialize.py | 9 +++++----
2 files changed, 33 insertions(+), 4 deletions(-)
create mode 100644 bin/boilerplate/README.md
diff --git a/bin/boilerplate/README.md b/bin/boilerplate/README.md
new file mode 100644
index 00000000..dbf5ea3e
--- /dev/null
+++ b/bin/boilerplate/README.md
@@ -0,0 +1,28 @@
+# FIXME Lesson title
+
+[](https://swc-slack-invite.herokuapp.com/)
+
+FIXME
+
+## Contributing
+
+We welcome all contributions to improve the lesson! Maintainers will do their best to help you if you have any
+questions, concerns, or experience any difficulties along the way.
+
+We'd like to ask you to familiarize yourself with our [Contribution Guide](CONTRIBUTING.md) and have a look at
+the [more detailed guidelines][lesson-example] on proper formatting, ways to render the lesson locally, and even
+how to write new episodes.
+
+## Maintainer(s)
+
+* FIXME
+
+## Authors
+
+A list of contributors to the lesson can be found in [AUTHORS](AUTHORS)
+
+## Citation
+
+To cite this lesson, please consult with [CITATION](CITATION)
+
+[lesson-example]: https://swcarpentry.github.io/lesson-example
\ No newline at end of file
diff --git a/bin/lesson_initialize.py b/bin/lesson_initialize.py
index 83f455e6..347d345d 100755
--- a/bin/lesson_initialize.py
+++ b/bin/lesson_initialize.py
@@ -12,16 +12,17 @@
'AUTHORS',
'CITATION',
'CONTRIBUTING.md',
+ 'README.md'
'_config.yml',
- 'index.md',
- 'reference.md',
- 'setup.md',
- 'aio.md',
'_episodes/01-introduction.md',
'_extras/about.md',
'_extras/discuss.md',
'_extras/figures.md',
'_extras/guide.md',
+ 'aio.md',
+ 'index.md',
+ 'reference.md',
+ 'setup.md',
)
From 20bc5791ee58668880a536a47148838bf1131d47 Mon Sep 17 00:00:00 2001
From: Raniere Silva
Date: Fri, 18 May 2018 16:29:49 +0100
Subject: [PATCH 48/79] Fix font size of h2 in call out box
Close swcarpentry/styles#244
---
assets/css/lesson.scss | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/assets/css/lesson.scss b/assets/css/lesson.scss
index 9a1cc477..8a7b2954 100644
--- a/assets/css/lesson.scss
+++ b/assets/css/lesson.scss
@@ -114,6 +114,18 @@ $codeblock-padding: 5px !default;
.solution{ @include bkSetup($color-solution, "\e105"); }
.testimonial{ @include bkSetup($color-testimonial, "\e143"); }
+.callout h3,
+.challenge h3,
+.checklist h3,
+.discussion h3,
+.keypoints h3,
+.objectives h3,
+.prereq h3,
+.solution h3,
+.testimonial h3 {
+font-size: 18px;
+}
+
//----------------------------------------
// Override Bootstrap settings.
//----------------------------------------
From ec50ea05d9743cc14fd8a9cf4262e0ca3de2ff12 Mon Sep 17 00:00:00 2001
From: Maxim Belkin
Date: Sun, 20 May 2018 08:34:42 -0500
Subject: [PATCH 49/79] lesson_check: fix create_checker function
---
bin/lesson_check.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/lesson_check.py b/bin/lesson_check.py
index 441c1a71..d179db51 100755
--- a/bin/lesson_check.py
+++ b/bin/lesson_check.py
@@ -271,7 +271,7 @@ def create_checker(args, filename, info):
for (pat, cls) in CHECKERS:
if pat.search(filename):
return cls(args, filename, **info)
-
+ return NotImplemented
class CheckBase(object):
"""Base class for checking Markdown files."""
From 2ba1381130898b81ac342819db1f872777f534cc Mon Sep 17 00:00:00 2001
From: Maxim Belkin
Date: Sun, 20 May 2018 08:38:12 -0500
Subject: [PATCH 50/79] utils.py: simplify report function
---
bin/util.py | 50 ++++++++++++++++++++++++++------------------------
1 file changed, 26 insertions(+), 24 deletions(-)
diff --git a/bin/util.py b/bin/util.py
index 890dd1ab..5bc7e9ba 100644
--- a/bin/util.py
+++ b/bin/util.py
@@ -65,36 +65,38 @@ def add(self, location, fmt, *args):
self.messages.append((location, fmt.format(*args)))
+ @staticmethod
+ def pretty(item):
+ location, message = item
+ if isinstance(location, type(None)):
+ return message
+ elif isinstance(location, str):
+ return location + ': ' + message
+ elif isinstance(location, tuple):
+ return '{0}:{1}: '.format(*location) + message
+ else:
+ assert False, 'Unknown item "{0}"'.format(item)
+
+ @staticmethod
+ def key(item):
+ location, message = item
+ if isinstance(location, type(None)):
+ return ('', -1, message)
+ elif isinstance(location, str):
+ return (location, -1, message)
+ elif isinstance(location, tuple):
+ return (location[0], location[1], message)
+ else:
+ assert False, 'Unknown item "{0}"'.format(item)
+
def report(self, stream=sys.stdout):
"""Report all messages in order."""
if not self.messages:
return
- def pretty(item):
- location, message = item
- if isinstance(location, type(None)):
- return message
- elif isinstance(location, str):
- return location + ': ' + message
- elif isinstance(location, tuple):
- return '{0}:{1}: '.format(*location) + message
- else:
- assert False, 'Unknown item "{0}"'.format(item)
-
- def key(item):
- location, message = item
- if isinstance(location, type(None)):
- return ('', -1, message)
- elif isinstance(location, str):
- return (location, -1, message)
- elif isinstance(location, tuple):
- return (location[0], location[1], message)
- else:
- assert False, 'Unknown item "{0}"'.format(item)
-
- for m in sorted(self.messages, key=key):
- print(pretty(m), file=stream)
+ for m in sorted(self.messages, key=self.key):
+ print(self.pretty(m), file=stream)
def read_markdown(parser, path):
From 485e4ba52b860650b3f466a82c6dbf7d77cb82e6 Mon Sep 17 00:00:00 2001
From: Joseph Stachelek
Date: Mon, 21 May 2018 12:49:04 -0400
Subject: [PATCH 51/79] missing comma in boilerplate generation
---
bin/lesson_initialize.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/lesson_initialize.py b/bin/lesson_initialize.py
index 347d345d..80cdebd7 100755
--- a/bin/lesson_initialize.py
+++ b/bin/lesson_initialize.py
@@ -12,7 +12,7 @@
'AUTHORS',
'CITATION',
'CONTRIBUTING.md',
- 'README.md'
+ 'README.md',
'_config.yml',
'_episodes/01-introduction.md',
'_extras/about.md',
From 1d64dbb625de8aa99fc1c05805def42fca31fe3c Mon Sep 17 00:00:00 2001
From: Maxim Belkin
Date: Tue, 22 May 2018 07:09:33 -0500
Subject: [PATCH 52/79] Remove unnecessary super call
---
bin/util.py | 2 --
1 file changed, 2 deletions(-)
diff --git a/bin/util.py b/bin/util.py
index 5bc7e9ba..a449f9fc 100644
--- a/bin/util.py
+++ b/bin/util.py
@@ -35,8 +35,6 @@ class Reporter(object):
def __init__(self):
"""Constructor."""
-
- super(Reporter, self).__init__()
self.messages = []
def check_field(self, filename, name, values, key, expected=REPORTER_NOT_SET):
From dd1fce098afe9f8209b0b53c06405d40a942c8dd Mon Sep 17 00:00:00 2001
From: Maxim Belkin
Date: Tue, 22 May 2018 07:25:02 -0500
Subject: [PATCH 53/79] util.py: make functions return NotImplemented
---
bin/util.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/bin/util.py b/bin/util.py
index 5bc7e9ba..8d958150 100644
--- a/bin/util.py
+++ b/bin/util.py
@@ -74,8 +74,9 @@ def pretty(item):
return location + ': ' + message
elif isinstance(location, tuple):
return '{0}:{1}: '.format(*location) + message
- else:
- assert False, 'Unknown item "{0}"'.format(item)
+
+ print('Unknown item "{0}"'.format(item), file=sys.stderr)
+ return NotImplemented
@staticmethod
def key(item):
@@ -86,8 +87,9 @@ def key(item):
return (location, -1, message)
elif isinstance(location, tuple):
return (location[0], location[1], message)
- else:
- assert False, 'Unknown item "{0}"'.format(item)
+
+ print('Unknown item "{0}"'.format(item), file=sys.stderr)
+ return NotImplemented
def report(self, stream=sys.stdout):
"""Report all messages in order."""
From 199a8093778d96a960242948fdd9970f40e63c68 Mon Sep 17 00:00:00 2001
From: Maxim Belkin
Date: Tue, 22 May 2018 08:23:43 -0500
Subject: [PATCH 54/79] Use Python3-style class declaration
---
bin/lesson_check.py | 2 +-
bin/util.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/bin/lesson_check.py b/bin/lesson_check.py
index d179db51..5d8b9ddc 100755
--- a/bin/lesson_check.py
+++ b/bin/lesson_check.py
@@ -273,7 +273,7 @@ def create_checker(args, filename, info):
return cls(args, filename, **info)
return NotImplemented
-class CheckBase(object):
+class CheckBase:
"""Base class for checking Markdown files."""
def __init__(self, args, filename, metadata, metadata_len, text, lines, doc):
diff --git a/bin/util.py b/bin/util.py
index 5bc7e9ba..79cc0108 100644
--- a/bin/util.py
+++ b/bin/util.py
@@ -30,7 +30,7 @@
REPORTER_NOT_SET = []
-class Reporter(object):
+class Reporter:
"""Collect and report errors."""
def __init__(self):
From 3ccc40637bc9ade8d7cbd68b5aac02bacff33774 Mon Sep 17 00:00:00 2001
From: Raniere Silva
Date: Wed, 23 May 2018 13:44:08 +0100
Subject: [PATCH 55/79] Remove root and layout from YAML for boilerplate
---
bin/boilerplate/_config.yml | 12 ++++++++++--
bin/boilerplate/_extras/about.md | 3 +--
bin/boilerplate/_extras/discuss.md | 3 +--
bin/boilerplate/_extras/figures.md | 3 +--
bin/boilerplate/_extras/guide.md | 3 +--
bin/boilerplate/aio.md | 4 +---
bin/boilerplate/index.md | 4 ++--
bin/boilerplate/reference.md | 3 +--
bin/boilerplate/setup.md | 4 +---
9 files changed, 19 insertions(+), 20 deletions(-)
diff --git a/bin/boilerplate/_config.yml b/bin/boilerplate/_config.yml
index 566baf18..82eb08e2 100644
--- a/bin/boilerplate/_config.yml
+++ b/bin/boilerplate/_config.yml
@@ -61,12 +61,20 @@ collections:
# Set the default layout for things in the episodes collection.
defaults:
- values:
- root: ..
+ root: .
+ layout: page
- scope:
path: ""
type: episodes
values:
+ root: ..
layout: episode
+ - scope:
+ path: ""
+ type: extras
+ values:
+ root: ..
+ layout: page
# Files and directories that are not to be copied.
exclude:
@@ -74,4 +82,4 @@ exclude:
- bin
# Turn on built-in syntax highlighting.
-highlighter: rouge
\ No newline at end of file
+highlighter: rouge
diff --git a/bin/boilerplate/_extras/about.md b/bin/boilerplate/_extras/about.md
index b6ad26b8..3008972c 100644
--- a/bin/boilerplate/_extras/about.md
+++ b/bin/boilerplate/_extras/about.md
@@ -1,5 +1,4 @@
---
-layout: page
title: About
---
-{% include carpentries.html %}
\ No newline at end of file
+{% include carpentries.html %}
diff --git a/bin/boilerplate/_extras/discuss.md b/bin/boilerplate/_extras/discuss.md
index 0a45a0f9..524440ac 100644
--- a/bin/boilerplate/_extras/discuss.md
+++ b/bin/boilerplate/_extras/discuss.md
@@ -1,5 +1,4 @@
---
-layout: page
title: Discussion
---
-FIXME
\ No newline at end of file
+FIXME
diff --git a/bin/boilerplate/_extras/figures.md b/bin/boilerplate/_extras/figures.md
index fd540ed5..b807e484 100644
--- a/bin/boilerplate/_extras/figures.md
+++ b/bin/boilerplate/_extras/figures.md
@@ -1,5 +1,4 @@
---
-layout: page
title: Figures
---