Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STY: Sync Carpentries lesson template #16

Merged
merged 87 commits into from
Jan 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
d1403e2
Merge pull request #1 from swcarpentry/gh-pages
ErinBecker Jan 30, 2018
c4b156f
translate CONDUCT.md
ErinBecker Feb 5, 2018
21c21ee
translate LICENSE.md
ErinBecker Feb 5, 2018
5726351
translate files
ErinBecker Feb 5, 2018
b7ba4cf
translate files
ErinBecker Feb 5, 2018
d5c0e67
translate files
ErinBecker Feb 5, 2018
0e7cafe
translate files
ErinBecker Feb 5, 2018
ad5b5b7
translate files
ErinBecker Feb 5, 2018
3b82499
translate files
ErinBecker Feb 5, 2018
feceb36
don't translate organization names
ErinBecker Feb 13, 2018
d09f7c1
Update CONDUCT.md
orchid00 Feb 20, 2018
85864b8
updated license
orchid00 Feb 20, 2018
a2b5962
Merge pull request #3 from orchid00/patch-2
ErinBecker Feb 20, 2018
6e6f4f3
Merge pull request #2 from orchid00/patch-1
ErinBecker Feb 20, 2018
418d8e0
[fix #1] bring in latest changes
fmichonneau Feb 23, 2018
84943b9
Merge pull request #2 from fmichonneau/latest-style
fmichonneau Feb 23, 2018
b2090c6
fix link referrence
fmichonneau Mar 13, 2018
f2e82c2
r reproducible
Mar 24, 2018
1d97bf2
r reproducible
Mar 24, 2018
28a7a10
r reproducible
Mar 24, 2018
4ff89a1
Merge pull request #5 from raynamharris/gh-pages
fmichonneau Mar 25, 2018
29bafe0
translate overview and teaching
Apr 4, 2018
a2f3222
change finish for Final
orchid00 Apr 11, 2018
cde1b63
Update schedule.html
PaoPrieto Apr 12, 2018
bcc8763
translate 'finish' to 'final
raynamharris Apr 13, 2018
1bc9da5
translate 'cite' to 'cita'
raynamharris Apr 13, 2018
d597cc2
Merge pull request #9 from raynamharris/patch-1
fmichonneau Apr 13, 2018
e48f14b
Merge pull request #10 from raynamharris/patch-2
fmichonneau Apr 13, 2018
1282bdf
Merge pull request #8 from PaoPrieto/patch-1
fmichonneau Apr 13, 2018
b708d2e
Merge pull request #7 from orchid00/patch-1
fmichonneau Apr 13, 2018
569f761
Merge pull request #6 from raynamharris/gh-pages
fmichonneau Apr 13, 2018
711dc0b
merge styles v9.5.2
fmichonneau Jun 19, 2018
555226b
Merge pull request #12 from carpentries/update-styles-v9.5.2
fmichonneau Jun 20, 2018
6745809
Update navbar.html
raynamharris Jul 6, 2018
9b3d46a
mejore -> mejora
raynamharris Nov 15, 2018
a7566a9
Merge pull request #13 from raynamharris/patch-3
rgaiacs Dec 3, 2018
bcb686d
GitHub Actions: check lesson template (#489)
maxim-belkin Aug 14, 2020
61db2b1
fix: tighten definitions of highlighter (#496)
henryiii Aug 19, 2020
33c71b1
add three more common languages (#497)
henryiii Aug 19, 2020
41d0e9a
remove unused code highlight classes (#498)
fmichonneau Aug 20, 2020
c1e8856
Sync styles first (#494)
fmichonneau Aug 22, 2020
99ecdf4
GitHub Actions: website (#488)
maxim-belkin Aug 25, 2020
6639d4b
GitHub Actions: better workflow and job names (#500)
maxim-belkin Aug 25, 2020
a8eee52
GitHub Action: website.yml: don't run in forks (#501)
maxim-belkin Sep 2, 2020
b11ce7f
GH Website action: rename + don't use lesson directory (#504)
maxim-belkin Sep 21, 2020
482c223
lesson.scss: styling for DIVs for embedding Youtube videos (#503)
maxim-belkin Sep 21, 2020
f53be37
update link to discuss mailing list (#507)
tobyhodges Oct 8, 2020
53e9913
add default repository to install_required_packages() (#509)
zkamvar Oct 19, 2020
2c6b97e
Merge branch 'gh-pages' of github.com:carpentries/styles into gh-pages
fmichonneau Oct 20, 2020
11db6b0
add warning blockquote
fmichonneau Oct 7, 2020
f5940d9
Revert "Merge branch 'gh-pages' of github.com:carpentries/styles into…
fmichonneau Oct 20, 2020
efa2cc9
add warning code block
fmichonneau Oct 20, 2020
207d649
update expected reference filename (#508)
tobyhodges Oct 21, 2020
5b906e7
lesson.scss: no borders around unrecognized code (#510)
maxim-belkin Oct 22, 2020
462be1e
bump ruby version (as specified in github-pages v209)
fmichonneau Oct 28, 2020
941da2b
drop patch version, fix at v1
fmichonneau Oct 28, 2020
c97dc12
removing contractions from CONTRIBUTING (#512)
ChristinaLK Nov 2, 2020
209797f
_config.yml: mention Carpentries Incubator
maxim-belkin Nov 5, 2020
c4b6e23
Matlab -> MATLAB
tobyhodges Nov 9, 2020
ca16e0b
set CRAN url if default is "@CRAN@"
zkamvar Dec 2, 2020
32ab0d1
Fix Ruby style
maxim-belkin Nov 24, 2020
fdb264a
accept any base filename for Rmd episodes
tobyhodges Dec 8, 2020
ce79a4b
run R-based lessons in forks
zkamvar Dec 7, 2020
423bf57
add control structure
zkamvar Dec 7, 2020
d8f93f0
404 page for better learner experience
maxim-belkin Nov 24, 2020
2b523bc
lesson.scss: wildcard selectors for code blocks
maxim-belkin Nov 20, 2020
90c60ff
Merge remote-tracking branch 'upstream/gh-pages' into gh-pages
josephmje Dec 14, 2020
3efe669
Ignore .jekyll-metatada
klieret Dec 17, 2020
da99378
Speed up builds of R-based lessons
zkamvar Dec 17, 2020
a60a74a
No need for User Agent string
zkamvar Dec 17, 2020
7fd7d18
permissive checks for pre-alpha lessons
zkamvar Dec 18, 2020
9e641fd
bin/lesson_check.py: allow 'language-*' code blocks (#532)
tobyhodges Dec 21, 2020
acdbd1c
bin/lesson_check.py: allow 'caution' blockquote
maxim-belkin Dec 22, 2020
16e571e
Merge pull request #537 from maxim-belkin/caution-blockquote
zkamvar Dec 22, 2020
3d5f6b5
avoid ansi color characters from being printed
zkamvar Jan 6, 2021
627d1a1
deploy from "website" action
fmichonneau Dec 18, 2020
afb88e2
deploy R-based lessons without using another action
fmichonneau Dec 18, 2020
08e26e6
also delete _site
fmichonneau Dec 18, 2020
70e3484
include @zkamvar suggestions
fmichonneau Jan 6, 2021
951140e
pin ubuntu version to 20.04 (#540)
fmichonneau Jan 8, 2021
2cd3c9c
GitHub Actions: cache required R packages (#534)
fmichonneau Jan 8, 2021
c92e47c
add missing parenthesis
fmichonneau Jan 8, 2021
bfd8c00
Add incubator option for carpentry field. (#542)
tkphd Jan 11, 2021
99cffbd
Merge remote-tracking branch 'upstream/gh-pages' into gh-pages
josephmje Jan 14, 2021
740773a
.editorconfig: don't trim trailing spaces in markdown
unode Jan 27, 2021
5bc7724
lesson.scss: HTML block
maxim-belkin Jan 27, 2021
2d21e10
Merge remote-tracking branch 'styles/gh-pages' into sty/sync_styles
josephmje Jan 28, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ trim_trailing_whitespace = true
indent_size = 2
indent_style = space
max_line_length = 100 # Please keep this in sync with bin/lesson_check.py!
trim_trailing_whitespace = false # keep trailing spaces in markdown - 2+ spaces are translated to a hard break (<br/>)

[*.r]
max_line_length = 80
Expand Down
136 changes: 136 additions & 0 deletions .github/workflows/template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: Test template
on:
push:
branches: gh-pages
pull_request:
jobs:
check-template:
name: ${{ matrix.lesson-name }} (${{ matrix.os-name }})
if: github.repository == 'carpentries/styles'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
lesson: [swcarpentry/shell-novice, datacarpentry/r-intro-geospatial, librarycarpentry/lc-git]
os: [ubuntu-20.04, macos-latest, windows-latest]
include:
- os: ubuntu-20.04
os-name: Ubuntu
- os: macos-latest
os-name: macOS
- os: windows-latest
os-name: Windows
- lesson: swcarpentry/shell-novice
lesson-name: (SWC) Shell novice
- lesson: datacarpentry/r-intro-geospatial
lesson-name: (DC) R Intro Geospatial
- lesson: librarycarpentry/lc-git
lesson-name: (LC) Intro to Git
defaults:
run:
shell: bash # forces 'Git for Windows' on Windows
env:
RSPM: 'https://packagemanager.rstudio.com/cran/__linux__/focal/latest'
steps:
- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: '2.7'

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install GitHub Pages, Bundler, and kramdown gems
run: |
gem install github-pages bundler kramdown

- name: Install Python modules
run: |
if [[ $RUNNER_OS == macOS || $RUNNER_OS == Linux ]]; then
python3 -m pip install --upgrade pip setuptools wheel pyyaml==5.3.1 requests
elif [[ $RUNNER_OS == Windows ]]; then
python -m pip install --upgrade pip setuptools wheel pyyaml==5.3.1 requests
fi

- name: Checkout the ${{ matrix.lesson }} lesson
uses: actions/checkout@master
with:
repository: ${{ matrix.lesson }}
path: lesson
fetch-depth: 0

- name: Determine the proper reference to use
id: styles-ref
run: |
if [[ -n "${{ github.event.pull_request.number }}" ]]; then
echo "::set-output name=ref::refs/pull/${{ github.event.pull_request.number }}/head"
else
echo "::set-output name=ref::gh-pages"
fi

- name: Sync lesson with carpentries/styles
working-directory: lesson
run: |
git config --global user.email "[email protected]"
git config --global user.name "The Carpentries Bot"
git remote add styles https://github.com/carpentries/styles.git
git config --local remote.styles.tagOpt --no-tags
git fetch styles ${{ steps.styles-ref.outputs.ref }}:styles-ref
git merge -s recursive -Xtheirs --no-commit styles-ref
git commit -m "Sync lesson with carpentries/styles"

- name: Look for R-markdown files
id: check-rmd
working-directory: lesson
run: |
echo "::set-output name=count::$(shopt -s nullglob; files=($(find . -iname '*.Rmd')); echo ${#files[@]})"

- name: Set up R
if: steps.check-rmd.outputs.count != 0
uses: r-lib/actions/setup-r@master
with:
r-version: 'release'

- name: Install needed packages
if: steps.check-rmd.outputs.count != 0
run: |
install.packages(setdiff(c('remotes', 'rprojroot', 'renv', 'desc', 'rmarkdown', 'knitr'), rownames(installed.packages())))
shell: Rscript {0}

- name: Query dependencies
if: steps.check-rmd.outputs.count != 0
working-directory: lesson
run: |
source('bin/dependencies.R')
deps <- identify_dependencies()
create_description(deps)
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows' && steps.check-rmd.outputs.count != 0
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install stringi from source
if: runner.os == 'Linux' && steps.check-rmd.outputs.count != 0
run: install.packages('stringi', repos='https://cloud.r-project.org')
shell: Rscript {0}

- name: Install system dependencies for R packages
if: runner.os == 'Linux' && steps.check-rmd.outputs.count != 0
working-directory: lesson
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\n")')

- run: make site
working-directory: lesson
114 changes: 114 additions & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Website
on:
push:
branches:
- gh-pages
- main
pull_request: []
jobs:
build-website:
if: ${{ !endsWith(github.repository, '/styles') }}
runs-on: ubuntu-20.04
env:
RSPM: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
defaults:
run:
shell: bash
steps:
- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: '2.7'

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install GitHub Pages, Bundler, and kramdown gems
run: |
gem install github-pages bundler kramdown

- name: Install Python modules
run: |
python3 -m pip install --upgrade pip setuptools wheel pyyaml==5.3.1 requests

- name: Checkout the lesson
uses: actions/checkout@master
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Look for R-markdown files
id: check-rmd
run: |
echo "::set-output name=count::$(shopt -s nullglob; files=($(find . -iname '*.Rmd')); echo ${#files[@]})"

- name: Set up R
if: steps.check-rmd.outputs.count != 0
uses: r-lib/actions/setup-r@master
with:
r-version: 'release'

- name: Cache R packages
if: steps.check-rmd.outputs.count != 0
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install needed packages
if: steps.check-rmd.outputs.count != 0
run: |
install.packages(setdiff(c('remotes', 'rprojroot', 'renv', 'desc', 'rmarkdown', 'knitr'), rownames(installed.packages())))
shell: Rscript {0}

- name: Query dependencies
if: steps.check-rmd.outputs.count != 0
run: |
source('bin/dependencies.R')
deps <- identify_dependencies()
create_description(deps)
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}


- name: Install system dependencies for R packages
if: steps.check-rmd.outputs.count != 0
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\n")')

- name: Render the markdown and confirm that the site can be built
run: make site

- name: Checkout github pages
if: ${{ github.event_name == 'push' && steps.check-rmd.outputs.count != 0 && github.ref != 'refs/heads/gh-pages'}}
uses: actions/checkout@master
with:
ref: gh-pages
path: gh-pages

- name: Commit and Push
if: ${{ github.event_name == 'push' && steps.check-rmd.outputs.count != 0 && github.ref != 'refs/heads/gh-pages'}}
run: |
# copy everything into gh-pages site
cp -r `ls -A | grep -v 'gh-pages' | grep -v '.git' | grep -v '.bundle/' | grep -v '_site'` gh-pages
# move into gh-pages, add, commit, and push
cd gh-pages
# setup git
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git add -A .
git commit --allow-empty -m "[Github Actions] render website (via ${{ github.sha }}"
git push origin gh-pages
# return
cd ..

- run: make lesson-check-all
if: always()
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.ipynb_checkpoints
.sass-cache
.jekyll-cache/
.jekyll-metadata
__pycache__
_site
.Rproj.user
Expand Down
25 changes: 25 additions & 0 deletions 404.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
layout: base
root: .
permalink: 404.html
title: "Page not found"
---

# Oops! We can't find that page.
{: style="text-align: center;"}

> ## Our apologies!
>
> We can't seem to find the page you're looking for.
> Try going back to the <a href="javascript:history.back()">previous page</a> or
> navigate to any other page using the navigation bar above
> {%- if site.kind == "lesson" -%} or the schedule below {%- endif -%}.
> If you got here by clicking on a link in the
> {%- if site.kind == "lesson" -%} lesson {%- else -%} workshop {%- endif -%},
> please report this link to the
> {%- if site.kind == "lesson" -%} lesson developers {%- else -%} workshop organizers {%- endif -%}.
{: .caution}

{% if site.kind == "lesson" %}
{% include syllabus.html %}
{% endif%}
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

source 'https://rubygems.org'

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }

# Synchronize with https://pages.github.com/versions
ruby '>=2.5.8'
ruby '>=2.7.1'

gem 'github-pages', group: :jekyll_plugins
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ workshop-check :
## III. Commands specific to lesson websites
## =================================================

.PHONY : lesson-check lesson-md lesson-files lesson-fixme
.PHONY : lesson-check lesson-md lesson-files lesson-fixme install-rmd-deps

# RMarkdown files
RMD_SRC = $(wildcard _episodes_rmd/??-*.Rmd)
RMD_SRC = $(wildcard _episodes_rmd/*.Rmd)
RMD_DST = $(patsubst _episodes_rmd/%.Rmd,_episodes/%.md,$(RMD_SRC))

# Lesson source files in the order they appear in the navigation menu.
Expand All @@ -118,14 +118,19 @@ HTML_DST = \
${DST}/conduct/index.html \
${DST}/setup/index.html \
$(patsubst _episodes/%.md,${DST}/%/index.html,$(sort $(wildcard _episodes/*.md))) \
${DST}/reference/index.html \
${DST}/reference.html \
$(patsubst _extras/%.md,${DST}/%/index.html,$(sort $(wildcard _extras/*.md))) \
${DST}/license/index.html

## * install-rmd-deps : Install R packages dependencies to build the RMarkdown lesson
install-rmd-deps:
@${SHELL} bin/install_r_deps.sh

## * lesson-md : convert Rmarkdown files to markdown
lesson-md : ${RMD_DST}

_episodes/%.md: _episodes_rmd/%.Rmd
_episodes/%.md: _episodes_rmd/%.Rmd install-rmd-deps
@mkdir -p _episodes
@bin/knit_lessons.sh $< $@

# * lesson-check : validate lesson Markdown
Expand Down
6 changes: 3 additions & 3 deletions bin/boilerplate/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ 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.
about things that do not work, aren not 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],
Expand All @@ -79,7 +79,7 @@ or you may also look at the issues for [Data Carpentry][dc-issues],
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
it is 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.

Expand Down Expand Up @@ -137,7 +137,7 @@ You can also [reach us by email][email].
[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
[discuss-list]: https://carpentries.topicbox.com/groups/discuss
[github]: https://github.com
[github-flow]: https://guides.github.com/introduction/flow/
[github-join]: https://github.com/join
Expand Down
1 change: 1 addition & 0 deletions bin/boilerplate/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# dc: Data Carpentry
# lc: Library Carpentry
# cp: Carpentries (to use for instructor traning for instance)
# incubator: Carpentries Incubator
carpentry: "swc"

# Overall title for pages.
Expand Down
Loading