Skip to content

Commit 22a821f

Browse files
authored
Merge pull request #161 from zkamvar/znk-update-styles
Update Styles
2 parents 13e0f2c + bb48666 commit 22a821f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1922
-995
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ trim_trailing_whitespace = true
99
indent_size = 2
1010
indent_style = space
1111
max_line_length = 100 # Please keep this in sync with bin/lesson_check.py!
12+
trim_trailing_whitespace = false # keep trailing spaces in markdown - 2+ spaces are translated to a hard break (<br/>)
1213

1314
[*.r]
1415
max_line_length = 80

.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"]

.github/ISSUE_TEMPLATE.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
1-
Please delete the text below before submitting your contribution.
1+
<details>
2+
<summary><strong>Instructions</strong></summary>
23

3-
---
4+
Thanks for contributing! :heart:
45

5-
Thanks for contributing! If this contribution is for instructor training, please send an email to checkout@carpentries.org with a link to this contribution so we can record your progress. You’ve completed your contribution step for instructor checkout just by submitting this contribution.
6+
If this contribution is for instructor training, please email the link to this contribution to
7+
checkout@carpentries.org so we can record your progress. You've completed your contribution
8+
step for instructor checkout by submitting this contribution!
69

7-
Please keep in mind that lesson maintainers are volunteers and it may be some time before they can respond to your contribution. Although not all contributions can be incorporated into the lesson materials, we appreciate your time and effort to improve the curriculum. If you have any questions about the lesson maintenance process or would like to volunteer your time as a contribution reviewer, please contact Kate Hertweck (k8hertweck@gmail.com).
10+
If this issue is about a specific episode within a lesson, please provide its link or filename.
811

9-
---
12+
Keep in mind that **lesson maintainers are volunteers** and it may take them some time to
13+
respond to your contribution. Although not all contributions can be incorporated into the lesson
14+
materials, we appreciate your time and effort to improve the curriculum. If you have any questions
15+
about the lesson maintenance process or would like to volunteer your time as a contribution
16+
reviewer, please contact The Carpentries Team at team@carpentries.org.
17+
18+
You may delete these instructions from your comment.
19+
20+
\- The Carpentries
21+
</details>

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1-
Please delete the text below before submitting your contribution.
1+
<details>
2+
<summary><strong>Instructions</strong></summary>
23

3-
---
4+
Thanks for contributing! :heart:
45

5-
Thanks for contributing! If this contribution is for instructor training, please send an email to checkout@carpentries.org with a link to this contribution so we can record your progress. You’ve completed your contribution step for instructor checkout just by submitting this contribution.
6+
If this contribution is for instructor training, please email the link to this contribution to
7+
checkout@carpentries.org so we can record your progress. You've completed your contribution
8+
step for instructor checkout by submitting this contribution!
69

7-
Please keep in mind that lesson maintainers are volunteers and it may be some time before they can respond to your contribution. Although not all contributions can be incorporated into the lesson materials, we appreciate your time and effort to improve the curriculum. If you have any questions about the lesson maintenance process or would like to volunteer your time as a contribution reviewer, please contact Kate Hertweck (k8hertweck@gmail.com).
10+
Keep in mind that **lesson maintainers are volunteers** and it may take them some time to
11+
respond to your contribution. Although not all contributions can be incorporated into the lesson
12+
materials, we appreciate your time and effort to improve the curriculum. If you have any questions
13+
about the lesson maintenance process or would like to volunteer your time as a contribution
14+
reviewer, please contact The Carpentries Team at team@carpentries.org.
815

9-
---
16+
You may delete these instructions from your comment.
17+
18+
\- The Carpentries
19+
</details>

.github/workflows/template.yml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
name: Test template
2+
on:
3+
push:
4+
branches: gh-pages
5+
pull_request:
6+
jobs:
7+
check-template:
8+
name: ${{ matrix.lesson-name }} (${{ matrix.os-name }})
9+
if: github.repository == 'carpentries/styles'
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
lesson: [swcarpentry/shell-novice, datacarpentry/r-intro-geospatial, librarycarpentry/lc-git]
15+
os: [ubuntu-20.04, macos-latest, windows-latest]
16+
include:
17+
- os: ubuntu-20.04
18+
os-name: Ubuntu
19+
- os: macos-latest
20+
os-name: macOS
21+
- os: windows-latest
22+
os-name: Windows
23+
- lesson: swcarpentry/shell-novice
24+
lesson-name: (SWC) Shell novice
25+
- lesson: datacarpentry/r-intro-geospatial
26+
lesson-name: (DC) R Intro Geospatial
27+
- lesson: librarycarpentry/lc-git
28+
lesson-name: (LC) Intro to Git
29+
defaults:
30+
run:
31+
shell: bash # forces 'Git for Windows' on Windows
32+
env:
33+
RSPM: 'https://packagemanager.rstudio.com/cran/__linux__/focal/latest'
34+
steps:
35+
- name: Set up Ruby
36+
uses: ruby/setup-ruby@v1
37+
with:
38+
ruby-version: '2.7'
39+
bundler-cache: true
40+
41+
- name: Set up Python
42+
uses: actions/setup-python@v2
43+
with:
44+
python-version: '3.x'
45+
46+
- name: Install GitHub Pages, Bundler, and kramdown gems
47+
run: |
48+
gem install github-pages bundler kramdown kramdown-parser-gfm
49+
50+
- name: Install Python modules
51+
run: |
52+
if [[ $RUNNER_OS == macOS || $RUNNER_OS == Linux ]]; then
53+
python3 -m pip install --upgrade pip setuptools wheel pyyaml==5.3.1 requests
54+
elif [[ $RUNNER_OS == Windows ]]; then
55+
python -m pip install --upgrade pip setuptools wheel pyyaml==5.3.1 requests
56+
fi
57+
58+
- name: Checkout the ${{ matrix.lesson }} lesson
59+
uses: actions/checkout@master
60+
with:
61+
repository: ${{ matrix.lesson }}
62+
path: lesson
63+
fetch-depth: 0
64+
65+
- name: Determine the proper reference to use
66+
id: styles-ref
67+
run: |
68+
if [[ -n "${{ github.event.pull_request.number }}" ]]; then
69+
echo "::set-output name=ref::refs/pull/${{ github.event.pull_request.number }}/head"
70+
else
71+
echo "::set-output name=ref::gh-pages"
72+
fi
73+
74+
- name: Sync lesson with carpentries/styles
75+
working-directory: lesson
76+
run: |
77+
git config --global user.email "team@carpentries.org"
78+
git config --global user.name "The Carpentries Bot"
79+
git remote add styles https://github.com/carpentries/styles.git
80+
git config --local remote.styles.tagOpt --no-tags
81+
git fetch styles ${{ steps.styles-ref.outputs.ref }}:styles-ref
82+
git merge -s recursive -Xtheirs --no-commit styles-ref
83+
git commit -m "Sync lesson with carpentries/styles"
84+
85+
- name: Look for R-markdown files
86+
id: check-rmd
87+
working-directory: lesson
88+
run: |
89+
echo "::set-output name=count::$(shopt -s nullglob; files=($(find . -iname '*.Rmd')); echo ${#files[@]})"
90+
91+
- name: Set up R
92+
if: steps.check-rmd.outputs.count != 0
93+
uses: r-lib/actions/setup-r@master
94+
with:
95+
r-version: 'release'
96+
97+
- name: Install needed packages
98+
if: steps.check-rmd.outputs.count != 0
99+
run: |
100+
packages = setdiff(c('remotes', 'rprojroot', 'renv', 'desc', 'rmarkdown', 'knitr'), rownames(installed.packages()))
101+
install.packages(packages, repo="https://cran.rstudio.com/")
102+
shell: Rscript {0}
103+
104+
- name: Query dependencies
105+
if: steps.check-rmd.outputs.count != 0
106+
working-directory: lesson
107+
run: |
108+
source('bin/dependencies.R')
109+
deps <- identify_dependencies()
110+
create_description(deps)
111+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
112+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
113+
shell: Rscript {0}
114+
115+
- name: Cache R packages
116+
if: runner.os != 'Windows' && steps.check-rmd.outputs.count != 0
117+
uses: actions/cache@v1
118+
with:
119+
path: ${{ env.R_LIBS_USER }}
120+
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
121+
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
122+
123+
- name: Install stringi from source
124+
if: runner.os == 'Linux' && steps.check-rmd.outputs.count != 0
125+
run: install.packages('stringi', repos='https://cloud.r-project.org')
126+
shell: Rscript {0}
127+
128+
- name: Install system dependencies for R packages
129+
if: runner.os == 'Linux' && steps.check-rmd.outputs.count != 0
130+
working-directory: lesson
131+
run: |
132+
while read -r cmd
133+
do
134+
eval sudo $cmd
135+
done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\n")')
136+
137+
- run: make site
138+
working-directory: lesson

.github/workflows/website.yml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: Website
2+
on:
3+
push:
4+
branches:
5+
- gh-pages
6+
- main
7+
pull_request: []
8+
jobs:
9+
build-website:
10+
if: ${{ !endsWith(github.repository, '/styles') }}
11+
runs-on: ubuntu-20.04
12+
env:
13+
RSPM: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"
14+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
15+
defaults:
16+
run:
17+
shell: bash
18+
steps:
19+
- name: Set up Ruby
20+
uses: ruby/setup-ruby@v1
21+
with:
22+
ruby-version: '2.7'
23+
bundler-cache: true
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v2
27+
with:
28+
python-version: '3.x'
29+
30+
- name: Install GitHub Pages, Bundler, and kramdown gems
31+
run: |
32+
gem install github-pages bundler kramdown kramdown-parser-gfm
33+
34+
- name: Install Python modules
35+
run: |
36+
python3 -m pip install --upgrade pip setuptools wheel pyyaml==5.3.1 requests
37+
38+
- name: Checkout the lesson
39+
uses: actions/checkout@master
40+
with:
41+
fetch-depth: 0
42+
ref: ${{ github.event.pull_request.head.sha }}
43+
44+
- name: Look for R-markdown files
45+
id: check-rmd
46+
run: |
47+
echo "::set-output name=count::$(shopt -s nullglob; files=($(find . -iname '*.Rmd')); echo ${#files[@]})"
48+
49+
- name: Set up R
50+
if: steps.check-rmd.outputs.count != 0
51+
uses: r-lib/actions/setup-r@master
52+
with:
53+
r-version: 'release'
54+
55+
- name: Cache R packages
56+
if: steps.check-rmd.outputs.count != 0
57+
uses: actions/cache@v1
58+
with:
59+
path: ${{ env.R_LIBS_USER }}
60+
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
61+
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
62+
63+
- name: Install needed packages
64+
if: steps.check-rmd.outputs.count != 0
65+
run: |
66+
packages = setdiff(c('remotes', 'rprojroot', 'renv', 'desc', 'rmarkdown', 'knitr'), rownames(installed.packages()))
67+
install.packages(packages, repo="https://cran.rstudio.com/")
68+
shell: Rscript {0}
69+
70+
- name: Query dependencies
71+
if: steps.check-rmd.outputs.count != 0
72+
run: |
73+
source('bin/dependencies.R')
74+
deps <- identify_dependencies()
75+
create_description(deps)
76+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
77+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
78+
shell: Rscript {0}
79+
80+
81+
- name: Install system dependencies for R packages
82+
if: steps.check-rmd.outputs.count != 0
83+
run: |
84+
while read -r cmd
85+
do
86+
eval sudo $cmd
87+
done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\n")')
88+
89+
- name: Render the markdown and confirm that the site can be built
90+
run: make site
91+
92+
- name: Checkout github pages
93+
if: ${{ github.event_name == 'push' && steps.check-rmd.outputs.count != 0 && github.ref != 'refs/heads/gh-pages'}}
94+
uses: actions/checkout@master
95+
with:
96+
ref: gh-pages
97+
path: gh-pages
98+
99+
- name: Commit and Push
100+
if: ${{ github.event_name == 'push' && steps.check-rmd.outputs.count != 0 && github.ref != 'refs/heads/gh-pages'}}
101+
run: |
102+
# clean up gh-pages
103+
cd gh-pages
104+
git rm -rf . # remove all previous files
105+
git restore --staged . # remove things from the stage
106+
cd ..
107+
# copy everything into gh-pages site
108+
cp -r `ls -A | grep -v 'gh-pages' | grep -v '.git' | grep -v '.bundle/' | grep -v '_site'` gh-pages
109+
# move into gh-pages, add, commit, and push
110+
cd gh-pages
111+
# setup git
112+
git config --local user.email "actions@github.com"
113+
git config --local user.name "GitHub Actions"
114+
git add -A .
115+
git commit --allow-empty -m "[Github Actions] render website (via ${{ github.sha }})"
116+
git push origin gh-pages
117+
# return
118+
cd ..
119+
120+
- run: make lesson-check-all
121+
if: always()

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,16 @@
33
.DS_Store
44
.ipynb_checkpoints
55
.sass-cache
6+
.jekyll-cache/
7+
.jekyll-metadata
68
__pycache__
79
_site
810
.Rproj.user
911
.Rhistory
1012
.RData
11-
13+
.bundle/
14+
.vendor/
15+
vendor/
16+
.docker-vendor/
17+
Gemfile.lock
18+
.*history

404.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
layout: base
3+
root: .
4+
permalink: 404.html
5+
title: "Page not found"
6+
---
7+
8+
# Oops! We can't find that page.
9+
{: style="text-align: center;"}
10+
11+
> ## Our apologies!
12+
>
13+
> We can't seem to find the page you're looking for.
14+
> Try going back to the <a href="javascript:history.back()">previous page</a> or
15+
> navigate to any other page using the navigation bar above
16+
> {%- if site.kind == "lesson" -%} or the schedule below {%- endif -%}.
17+
> If you got here by clicking on a link in the
18+
> {%- if site.kind == "lesson" -%} lesson {%- else -%} workshop {%- endif -%},
19+
> please report this link to the
20+
> {%- if site.kind == "lesson" -%} lesson developers {%- else -%} workshop organizers {%- endif -%}.
21+
{: .caution}
22+
23+
{% if site.kind == "lesson" %}
24+
{% include syllabus.html %}
25+
{% endif%}

Gemfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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.7.1'
9+
10+
gem 'github-pages', group: :jekyll_plugins
11+
12+
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.0.0')
13+
gem 'webrick', '>= 1.6.1'
14+
end

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ root: .
55
---
66
## Instructional Material
77

8-
All Software Carpentry and Data Carpentry instructional material is
8+
All Software Carpentry, Data Carpentry, and Library Carpentry instructional material is
99
made available under the [Creative Commons Attribution
1010
license][cc-by-human]. The following is a human-readable summary of
1111
(and not a substitute for) the [full legal text of the CC BY 4.0

0 commit comments

Comments
 (0)