Skip to content

Commit 1148b6c

Browse files
committed
Merge branch gh-pages of carpentries/styles
Conflicts: aio.md
2 parents 762d1de + b5c2878 commit 1148b6c

33 files changed

Lines changed: 530 additions & 219 deletions

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: [carpentries, swcarpentry, datacarpentry, librarycarpentry]
2+
custom: ["https://carpentries.wedid.it"]

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44
.DS_Store
55
.ipynb_checkpoints
66
.sass-cache
7+
.jekyll-cache/
78
__pycache__
89
_site
910
.Rproj.user
1011
.Rhistory
1112
.RData
12-
13+
.bundle/
14+
.vendor/
15+
.docker-vendor/
16+
Gemfile.lock

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Travis CI is only used to check the lesson and is not involved in its deployment
12
dist: xenial # Ubuntu 16.04 (required for python 3.7)
23
language: python
34
python: 3.7
@@ -7,15 +8,15 @@ branches:
78
- /.*/
89
before_install:
910
- sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
10-
- echo "deb https://cran.rstudio.com/bin/linux/ubuntu trusty/" | sudo tee -a /etc/apt/sources.list
11+
- echo "deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/" | sudo tee -a /etc/apt/sources.list
1112
- sudo apt-get update -y
1213
- sudo apt-get install -y r-base
1314
- sudo Rscript -e "install.packages('knitr', repos = 'https://', dependencies = TRUE)"
1415
- sudo Rscript -e "install.packages('stringr', repos = 'https://cran.rstudio.com', dependencies = TRUE)"
1516
- sudo Rscript -e "install.packages('checkpoint', repos = 'https://cran.rstudio.com', dependencies = TRUE)"
1617
- sudo Rscript -e "install.packages('ggplot2', repos = 'https://cran.rstudio.com', dependencies = TRUE)"
1718
- rvm default
18-
- gem install json kramdown jekyll
19+
- gem install json kramdown jekyll bundler
1920
install:
2021
- pip install pyyaml
2122
script:

Gemfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# frozen_string_literal: true
2+
3+
source 'https://rubygems.org'
4+
5+
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
6+
7+
# Synchronize with https://pages.github.com/versions
8+
ruby '>=2.5.3'
9+
10+
gem 'github-pages', group: :jekyll_plugins

Makefile

Lines changed: 72 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,70 @@
1+
# Use /bin/bash instead of /bin/sh
2+
export SHELL = /bin/bash
3+
14
## ========================================
25
## Commands for both workshop and lesson websites.
36

47
# Settings
58
MAKEFILES=Makefile $(wildcard *.mk)
6-
JEKYLL=jekyll
7-
JEKYLL_VERSION=3.7.3
9+
JEKYLL_VERSION=3.8.5
10+
JEKYLL=bundle install --path .vendor/bundle && bundle update && bundle exec jekyll
811
PARSER=bin/markdown_ast.rb
912
DST=_site
1013

14+
# Check Python 3 is installed and determine if it's called via python3 or python
15+
# (https://stackoverflow.com/a/4933395)
16+
PYTHON3_EXE := $(shell which python3 2>/dev/null)
17+
ifneq (, $(PYTHON3_EXE))
18+
ifeq (,$(findstring Microsoft/WindowsApps/python3,$(subst \,/,$(PYTHON3_EXE))))
19+
PYTHON := python3
20+
endif
21+
endif
22+
23+
ifeq (,$(PYTHON))
24+
PYTHON_EXE := $(shell which python 2>/dev/null)
25+
ifneq (, $(PYTHON_EXE))
26+
PYTHON_VERSION_FULL := $(wordlist 2,4,$(subst ., ,$(shell python --version 2>&1)))
27+
PYTHON_VERSION_MAJOR := $(word 1,${PYTHON_VERSION_FULL})
28+
ifneq (3, ${PYTHON_VERSION_MAJOR})
29+
$(error "Your system does not appear to have Python 3 installed.")
30+
endif
31+
PYTHON := python
32+
else
33+
$(error "Your system does not appear to have any Python installed.")
34+
endif
35+
endif
36+
37+
1138
# Controls
1239
.PHONY : commands clean files
13-
.NOTPARALLEL:
14-
all : commands
1540

16-
## commands : show all commands.
17-
commands :
18-
@grep -h -E '^##' ${MAKEFILES} | sed -e 's/## //g'
41+
# Default target
42+
.DEFAULT_GOAL := commands
1943

20-
## docker-serve : use docker to build the site
21-
docker-serve :
22-
docker run --rm -it -v ${PWD}:/srv/jekyll -p 127.0.0.1:4000:4000 jekyll/jekyll:${JEKYLL_VERSION} make serve
44+
## I. Commands for both workshop and lesson websites
45+
## =================================================
2346

24-
## serve : run a local server.
47+
## * serve : render website and run a local server
2548
serve : lesson-md
2649
${JEKYLL} serve
2750

28-
## site : build files but do not run a server.
51+
## * site : build website but do not run a server
2952
site : lesson-md
3053
${JEKYLL} build
3154

32-
# repo-check : check repository settings.
55+
## * docker-serve : use Docker to serve the site
56+
docker-serve :
57+
docker run --rm -it --volume ${PWD}:/srv/jekyll \
58+
--volume=${PWD}/.docker-vendor/bundle:/usr/local/bundle \
59+
-p 127.0.0.1:4000:4000 \
60+
jekyll/jekyll:${JEKYLL_VERSION} \
61+
bin/run-make-docker-serve.sh
62+
63+
## * repo-check : check repository settings
3364
repo-check :
34-
@bin/repo_check.py -s .
65+
@${PYTHON} bin/repo_check.py -s .
3566

36-
## clean : clean up junk files.
67+
## * clean : clean up junk files
3768
clean :
3869
@rm -rf ${DST}
3970
@rm -rf .sass-cache
@@ -42,22 +73,26 @@ clean :
4273
@find . -name '*~' -exec rm {} \;
4374
@find . -name '*.pyc' -exec rm {} \;
4475

45-
## clean-rmd : clean intermediate R files (that need to be committed to the repo).
76+
## * clean-rmd : clean intermediate R files (that need to be committed to the repo)
4677
clean-rmd :
4778
@rm -rf ${RMD_DST}
4879
@rm -rf fig/rmd-*
4980

50-
## ----------------------------------------
51-
## Commands specific to workshop websites.
81+
82+
##
83+
## II. Commands specific to workshop websites
84+
## =================================================
5285

5386
.PHONY : workshop-check
5487

55-
## workshop-check : check workshop homepage.
88+
## * workshop-check : check workshop homepage
5689
workshop-check :
57-
@bin/workshop_check.py .
90+
@${PYTHON} bin/workshop_check.py .
5891

59-
## ----------------------------------------
60-
## Commands specific to lesson websites.
92+
93+
##
94+
## III. Commands specific to lesson websites
95+
## =================================================
6196

6297
.PHONY : lesson-check lesson-md lesson-files lesson-fixme
6398

@@ -85,37 +120,39 @@ HTML_DST = \
85120
$(patsubst _extras/%.md,${DST}/%/index.html,$(sort $(wildcard _extras/*.md))) \
86121
${DST}/license/index.html
87122

88-
## lesson-md : convert Rmarkdown files to markdown
123+
## * lesson-md : convert Rmarkdown files to markdown
89124
lesson-md : ${RMD_DST}
90125

91126
_episodes/%.md: _episodes_rmd/%.Rmd
92127
@bin/knit_lessons.sh $< $@
93128

94-
## lesson-check : validate lesson Markdown.
129+
# * lesson-check : validate lesson Markdown
95130
lesson-check : lesson-fixme
96-
@bin/lesson_check.py -s . -p ${PARSER} -r _includes/links.md
131+
@${PYTHON} bin/lesson_check.py -s . -p ${PARSER} -r _includes/links.md
97132

98-
## lesson-check-all : validate lesson Markdown, checking line lengths and trailing whitespace.
133+
## * lesson-check-all : validate lesson Markdown, checking line lengths and trailing whitespace
99134
lesson-check-all :
100-
@bin/lesson_check.py -s . -p ${PARSER} -r _includes/links.md -l -w --permissive
135+
@${PYTHON} bin/lesson_check.py -s . -p ${PARSER} -r _includes/links.md -l -w --permissive
101136

102-
## unittest : run unit tests on checking tools.
137+
## * unittest : run unit tests on checking tools
103138
unittest :
104-
@bin/test_lesson_check.py
139+
@${PYTHON} bin/test_lesson_check.py
105140

106-
## lesson-files : show expected names of generated files for debugging.
141+
## * lesson-files : show expected names of generated files for debugging
107142
lesson-files :
108143
@echo 'RMD_SRC:' ${RMD_SRC}
109144
@echo 'RMD_DST:' ${RMD_DST}
110145
@echo 'MARKDOWN_SRC:' ${MARKDOWN_SRC}
111146
@echo 'HTML_DST:' ${HTML_DST}
112147

113-
## lesson-fixme : show FIXME markers embedded in source files.
148+
## * lesson-fixme : show FIXME markers embedded in source files
114149
lesson-fixme :
115150
@fgrep -i -n FIXME ${MARKDOWN_SRC} || true
116151

117-
#-------------------------------------------------------------------------------
118-
# Include extra commands if available.
119-
#-------------------------------------------------------------------------------
152+
##
153+
## IV. Auxililary (plumbing) commands
154+
## =================================================
120155

121-
-include commands.mk
156+
## * commands : show all commands.
157+
commands :
158+
@sed -n -e '/^##/s|^##[[:space:]]*||p' $(MAKEFILE_LIST)

README.md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,41 @@
11
[![Create a Slack Account with us](https://img.shields.io/badge/Create_Slack_Account-The_Carpentries-071159.svg)](https://swc-slack-invite.herokuapp.com/)
22
[![Slack Status](https://img.shields.io/badge/Slack_Channel-dc--ecology--py-E01563.svg)](https://swcarpentry.slack.com/messages/C9X44HCDS)
33

4-
54
## Data Carpentry Python Lessons with Ecological Data
65

76
This repository contains the Data Carpentry Python material based on ecological
87
data. Please see our [contribution guidelines](CONTRIBUTING.md) for information
98
on how to contribute updates, bug fixes, or other corrections.
109

11-
### Maintainers
10+
## Contributing
11+
12+
We welcome all contributions to improve the lesson! Maintainers will do their best to help you if you have any
13+
questions, concerns, or experience any difficulties along the way.
14+
15+
We'd like to ask you to familiarize yourself with our [Contribution Guide](CONTRIBUTING.md) and have a look at
16+
the [more detailed guidelines][lesson-example] on proper formatting, ways to render the lesson locally, and even
17+
how to write new episodes.
18+
19+
Please see the current list of [issues][FIXME] for ideas for contributing to this
20+
repository. For making your contribution, we use the GitHub flow, which is
21+
nicely explained in the chapter [Contributing to a Project](http://git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project) in Pro Git
22+
by Scott Chacon.
23+
Look for the tag ![good_first_issue](https://img.shields.io/badge/-good%20first%20issue-gold.svg). This indicates that the maintainers will welcome a pull request fixing this issue.
24+
25+
26+
## Maintainer(s)
27+
28+
Current maintainers of this lesson are
29+
30+
* [Maxim Belkin](maxim-belkin)
31+
32+
## Authors
33+
34+
A list of contributors to the lesson can be found in [AUTHORS](AUTHORS)
35+
36+
## Citation
37+
38+
To cite this lesson, please consult with [CITATION](CITATION)
1239

13-
- Maxim Belkin ([@maxim-belkin](https://github.com/maxim-belkin))
40+
[lesson-example]: https://carpentries.github.io/lesson-example
41+
[maxim-belkin]: https://github.com/maxim-belkin

_config.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ carpentry: "dc"
1212
# Overall title for pages.
1313
title: "Data Analysis and Visualization in Python for Ecologists"
1414

15+
# Life cycle stage of the lesson
16+
# possible values: "pre-alpha", "alpha", "beta", "stable"
17+
life_cycle: "stable"
18+
1519
#------------------------------------------------------------
1620
# Generic settings (should not need to change).
1721
#------------------------------------------------------------
@@ -28,26 +32,29 @@ repository: <USERNAME>/<PROJECT>
2832
2933

3034
# Sites.
31-
amy_site: "https://amy.software-carpentry.org/workshops"
35+
amy_site: "https://amy.carpentries.org/workshops"
3236
carpentries_github: "https://github.com/carpentries"
3337
carpentries_pages: "https://carpentries.github.io"
3438
carpentries_site: "https://carpentries.org/"
35-
dc_site: "http://datacarpentry.org"
39+
dc_site: "https://datacarpentry.org"
3640
example_repo: "https://github.com/carpentries/lesson-example"
3741
example_site: "https://carpentries.github.io/lesson-example"
38-
lc_site: "https://librarycarpentry.github.io/"
42+
lc_site: "https://librarycarpentry.org/"
3943
swc_github: "https://github.com/swcarpentry"
4044
swc_pages: "https://swcarpentry.github.io"
4145
swc_site: "https://software-carpentry.org"
4246
template_repo: "https://github.com/carpentries/styles"
4347
training_site: "https://carpentries.github.io/instructor-training"
4448
workshop_repo: "https://github.com/carpentries/workshop-template"
4549
workshop_site: "https://carpentries.github.io/workshop-template"
50+
cc_by_human: "https://creativecommons.org/licenses/by/4.0/"
4651

4752
# Surveys.
48-
pre_survey: "https://www.surveymonkey.com/r/swc_pre_workshop_v1?workshop_id="
49-
post_survey: "https://www.surveymonkey.com/r/swc_post_workshop_v1?workshop_id="
50-
training_post_survey: "https://www.surveymonkey.com/r/post-instructor-training"
53+
pre_survey: "https://carpentries.typeform.com/to/wi32rS?slug="
54+
post_survey: "https://carpentries.typeform.com/to/UgVdRQ?slug="
55+
instructor_pre_survey: "https://www.surveymonkey.com/r/instructor_training_pre_survey?workshop_id="
56+
instructor_post_survey: "https://www.surveymonkey.com/r/instructor_training_post_survey?workshop_id="
57+
5158

5259
# Start time in minutes (0 to be clock-independent, 540 to show a start at 09:00 am)
5360
start_time: 0
@@ -84,6 +91,8 @@ exclude:
8491
- Makefile
8592
- bin/
8693
- .Rproj.user/
94+
- .vendor/
95+
- .docker-vendor/
8796

8897
# Turn on built-in syntax highlighting.
8998
highlighter: rouge

_extras/figures.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@ title: Figures
33
---
44

55
{% include base_path.html %}
6+
{% include manual_episode_order.html %}
67

78
<script>
89
window.onload = function() {
910
var lesson_episodes = [
10-
{% for episode in site.episodes %}
11+
{% for lesson_episode in lesson_episodes %}
12+
{% if site.episode_order %}
13+
{% assign episode = site.episodes | where: "slug", lesson_episode | first %}
14+
{% else %}
15+
{% assign episode = lesson_episode %}
16+
{% endif %}
1117
"{{ episode.url }}"{% unless forloop.last %},{% endunless %}
1218
{% endfor %}
1319
];
@@ -58,10 +64,15 @@ title: Figures
5864
}
5965
}
6066
</script>
61-
{% comment %}
62-
Create anchor for each one of the episodes.
63-
{% endcomment %}
64-
{% for episode in site.episodes %}
67+
68+
{% comment %} Create anchor for each one of the episodes. {% endcomment %}
69+
70+
{% for lesson_episode in lesson_episodes %}
71+
{% if site.episode_order %}
72+
{% assign episode = site.episodes | where: "slug", lesson_episode | first %}
73+
{% else %}
74+
{% assign episode = lesson_episode %}
75+
{% endif %}
6576
<article id="{{ episode.url }}" class="figures"></article>
6677
{% endfor %}
6778

_includes/aio-script.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{% comment %}
2+
As a maintainer, you don't need to edit this file.
3+
If you notice that something doesn't work, please
4+
open an issue: https://github.com/carpentries/styles/issues/new
5+
{% endcomment %}
6+
7+
{% include manual_episode_order.html %}
8+
9+
{% for lesson_episode in lesson_episodes %}
10+
11+
{% if site.episode_order %}
12+
{% assign e = site.episodes | where: "slug", lesson_episode | first %}
13+
{% else %}
14+
{% assign e = lesson_episode %}
15+
{% endif %}
16+
17+
<h1 id="{{ e.title | slugify }}" class="maintitle">{{ e.title }}</h1>
18+
19+
{% include episode_overview.html teaching_time=e.teaching exercise_time=e.exercises episode_questions=e.questions episode_objectives=e.objectives %}
20+
21+
{{ e.content }}
22+
23+
{% include episode_keypoints.html episode_keypoints=e.keypoints %}
24+
<hr />
25+
{% endfor %}

0 commit comments

Comments
 (0)