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

Pull latest carpentries style formatting #4

Merged
merged 74 commits into from
Aug 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
e06f686
bin/boilerplate/README.md: fix typo
josephmje Nov 8, 2019
a966a68
Use Jekyll to generate the 'all-in-one' page (carpentries/styles#438)
fmichonneau Nov 8, 2019
8ee9c20
manual_episode_order.html: fix typo in a comment
maxim-belkin Nov 11, 2019
134f806
Enable 'Sponsor' button on GitHub repos
maxim-belkin Nov 13, 2019
af588eb
remove Jekyll command markers from comment block
fmichonneau Dec 2, 2019
0cc96db
Forced re-encoding of text to UTF-8, to avoid issues on Windows
JoaoRodrigues Dec 3, 2019
8566047
Refactored paths to make use of OS agnostic methods
JoaoRodrigues Dec 3, 2019
d88b22a
Modified shebang to use python, not python3.
JoaoRodrigues Dec 3, 2019
21a979b
Reverted change of permissiveness on lesson_check
JoaoRodrigues Dec 3, 2019
901c574
Cleaned leftover debug code and old implementations.
JoaoRodrigues Dec 4, 2019
82dd7fb
Added PYTHON variable to define executable to run python scripts
JoaoRodrigues Dec 4, 2019
c9add9b
Reverted variable names
JoaoRodrigues Dec 4, 2019
a2d1a1f
Removed shebang lines from Python scripts to avoid cross-OS problems
JoaoRodrigues Dec 4, 2019
cd41c7b
Fixes encoding problem on Windows systems, with minimal changes to ex…
JoaoRodrigues Dec 5, 2019
db22e7b
Silenced output of PYTHON calls
JoaoRodrigues Dec 5, 2019
4381bcb
Makefile: detect Python 3
maxim-belkin Dec 5, 2019
ff5f567
util.py: remove empty line
maxim-belkin Dec 5, 2019
a61b7f6
Undo optimizations to read_all_markdown
maxim-belkin Dec 5, 2019
bab0fca
Remove executable bits from Python scripts
maxim-belkin Dec 5, 2019
bce2366
lesson_initialize: windows compatibility
maxim-belkin Dec 5, 2019
1a0adfd
lesson_check.py: Windows-compatible regular expression pattern
maxim-belkin Dec 5, 2019
ec294aa
repo_check.py: enforce utf-8 encoding
maxim-belkin Dec 5, 2019
caf3b88
clarify comment on python check block
brownsarahm Dec 6, 2019
d454d59
Makefile: Windows does not like single quotes
maxim-belkin Dec 6, 2019
41605eb
test_lesson_check.py: skip unnecessary steps
maxim-belkin Dec 6, 2019
651af34
Makefile: suppress error message on Windows
maxim-belkin Dec 6, 2019
8eb0425
fix typo in lesson_initialize.py
maxim-belkin Dec 6, 2019
ecb1611
Makefile: suppress another error message on Windows
maxim-belkin Dec 6, 2019
e6622b8
Makefile: handle MS Store's Python 3
maxim-belkin Dec 9, 2019
a732a2b
Makefile: fix syntax in conditional
maxim-belkin Dec 9, 2019
f1cb887
Makefile: fix two more syntax errors in conditionals
maxim-belkin Dec 9, 2019
48dd391
fix urls in _config.yml
fmichonneau Dec 11, 2019
8803fe5
Merge pull request carpentries/styles#446
maxim-belkin Dec 12, 2019
a56f2a0
use bundler to render lessons
fmichonneau Sep 12, 2019
0b6797e
install gems locally
fmichonneau Dec 11, 2019
116d5b9
refactor use of docker
fmichonneau Dec 11, 2019
fade440
add @maxim-belkin suggestions
fmichonneau Dec 13, 2019
aaab128
add .bundle to .gitignore
fmichonneau Dec 13, 2019
38c1c0c
Makefile: Specify shell. Don't include commands.mk
maxim-belkin Dec 13, 2019
a435fcd
Makefile: use Python to execute repo_check.py
maxim-belkin Dec 13, 2019
e986d1a
Makefile: improve commands target and commands categories (#450)
maxim-belkin Dec 13, 2019
a0c0681
Update R install in .travis.yml (#430)
agitter Dec 16, 2019
b5c2878
specify YAML loader
fmichonneau Dec 18, 2019
2f07ce1
add warning hook + CSS class for Rmd-based lessons (#455)
fmichonneau Feb 10, 2020
aaf5d76
Update PyPI link
katrinleinweber Feb 12, 2020
b8fa0cd
_includes/links.md: Update PyYAML link (#457)
maxim-belkin Feb 12, 2020
bc5c9ba
Use carpentries/lesson-docker for docker-serve make rule (#461)
zkamvar May 28, 2020
4f78e17
Use renv (#462)
zkamvar May 29, 2020
0deede1
Improve issue template (#463)
maxim-belkin Jun 15, 2020
6f30043
lesson.scss: style tab panels on setup pages (#464)
maxim-belkin Jun 19, 2020
974ee95
Improve pull request template (#465)
maxim-belkin Jun 22, 2020
3847b97
OS stripe color (#468)
maxim-belkin Jun 29, 2020
a52f6c2
bump ruby version
fmichonneau Jun 29, 2020
5d4aaa2
Upgrade jQuery to 3.5.1 (#469)
maxim-belkin Jun 30, 2020
3001ab5
assets/js/lesson.js: use .length instead of .size()
maxim-belkin Jul 6, 2020
5fe9eec
License is not a copyright. License info ID (#472)
maxim-belkin Jul 6, 2020
ecaef44
fix AMY's URL
fmichonneau Jul 10, 2020
4f4de3a
Deprecated use of --path when installing bundle (#473)
Jul 10, 2020
2e9d38f
add warning blockquote style, carpentries/styles#49 (#475)
jsta Jul 24, 2020
ff2fbb8
Make links in code tags distinguishable (#478)
unode Jul 25, 2020
3dbfd9a
_config.yml: link to Lesson Life Cycle chapter of CDH
tobyhodges Jul 28, 2020
b11b6d1
repo_check.py: allow URLs not ending with .git (#482)
maxim-belkin Aug 5, 2020
115a735
Makefile: fix comment in front of `lesson-check` (#481)
maxim-belkin Aug 5, 2020
a331232
repo_check.py: match https repositories (#483)
maxim-belkin Aug 5, 2020
b12821e
Makefile: don't use /bin/bash shell (#484)
maxim-belkin Aug 7, 2020
790278e
[fix carpentries/styles#477] rewrite travis script
fmichonneau Aug 7, 2020
d3aa582
add vendor folder to gitignore and _config.yml
fmichonneau Aug 7, 2020
6861f75
OS stripe: adjust line height (#490)
maxim-belkin Aug 11, 2020
95221b1
Makefile: fix 'lesson-fixme' target for Windows (#486)
maxim-belkin Aug 11, 2020
52597a5
Fix Python scripts for Windows: UTF-8 encoding (#485)
maxim-belkin Aug 11, 2020
70213c3
only display Episodes drop-down if we have episodes to show (#491)
fmichonneau Aug 11, 2020
32e788b
fix variable name
fmichonneau Aug 13, 2020
e862ff5
fix conflicts
josephmje Aug 13, 2020
45154f9
ignore vscode and data folder
josephmje Aug 13, 2020
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
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: [carpentries, swcarpentry, datacarpentry, librarycarpentry]
custom: ["https://carpentries.wedid.it"]
20 changes: 15 additions & 5 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
Please delete this line and the text below before submitting your contribution.
<details>
<summary><strong>Instructions</strong></summary>

---
Thanks for contributing! :heart:

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.
If this contribution is for instructor training, please email the link to this contribution to
checkout@carpentries.org so we can record your progress. You've completed your contribution
step for instructor checkout by submitting this contribution!

If this issue is about a specific episode within a lesson, please provide its link or filename.

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 The Carpentries Team at team@carpentries.org.
Keep in mind that **lesson maintainers are volunteers** and it may take them some time to
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 The Carpentries Team at team@carpentries.org.

---
You may delete these instructions from your comment.

\- The Carpentries
</details>
20 changes: 15 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
Please delete this line and the text below before submitting your contribution.
<details>
<summary><strong>Instructions</strong></summary>

---
Thanks for contributing! :heart:

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.
If this contribution is for instructor training, please email the link to this contribution to
checkout@carpentries.org so we can record your progress. You've completed your contribution
step for instructor checkout by submitting this contribution!

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 The Carpentries Team at team@carpentries.org.
Keep in mind that **lesson maintainers are volunteers** and it may take them some time to
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 The Carpentries Team at team@carpentries.org.

---
You may delete these instructions from your comment.

\- The Carpentries
</details>
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,11 @@ _site
.Rproj.user
.Rhistory
.RData
.bundle/
.vendor/
vendor/
.docker-vendor/
Gemfile.lock
.*history
.vscode/
data/
data/
10 changes: 10 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

source 'https://rubygems.org'

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

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

gem 'github-pages', group: :jekyll_plugins
108 changes: 72 additions & 36 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,67 @@

# Settings
MAKEFILES=Makefile $(wildcard *.mk)
JEKYLL=jekyll
JEKYLL_VERSION=3.8.5
JEKYLL=bundle config --local set path .vendor/bundle && bundle install && bundle update && bundle exec jekyll
PARSER=bin/markdown_ast.rb
DST=_site

# Check Python 3 is installed and determine if it's called via python3 or python
# (https://stackoverflow.com/a/4933395)
PYTHON3_EXE := $(shell which python3 2>/dev/null)
ifneq (, $(PYTHON3_EXE))
ifeq (,$(findstring Microsoft/WindowsApps/python3,$(subst \,/,$(PYTHON3_EXE))))
PYTHON := python3
endif
endif

ifeq (,$(PYTHON))
PYTHON_EXE := $(shell which python 2>/dev/null)
ifneq (, $(PYTHON_EXE))
PYTHON_VERSION_FULL := $(wordlist 2,4,$(subst ., ,$(shell python --version 2>&1)))
PYTHON_VERSION_MAJOR := $(word 1,${PYTHON_VERSION_FULL})
ifneq (3, ${PYTHON_VERSION_MAJOR})
$(error "Your system does not appear to have Python 3 installed.")
endif
PYTHON := python
else
$(error "Your system does not appear to have any Python installed.")
endif
endif


# Controls
.PHONY : commands clean files
.NOTPARALLEL:
all : commands

## commands : show all commands.
commands :
@grep -h -E '^##' ${MAKEFILES} | sed -e 's/## //g'
# Default target
.DEFAULT_GOAL := commands

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

## serve : run a local server.
## * serve : render website and run a local server
serve : lesson-md
${JEKYLL} serve

## site : build files but do not run a server.
## * site : build website but do not run a server
site : lesson-md
${JEKYLL} build

# repo-check : check repository settings.
## * docker-serve : use Docker to serve the site
docker-serve :
docker pull carpentries/lesson-docker:latest
docker run --rm -it \
-v $${PWD}:/home/rstudio \
-p 4000:4000 \
-p 8787:8787 \
-e USERID=$$(id -u) \
-e GROUPID=$$(id -g) \
carpentries/lesson-docker:latest

## * repo-check : check repository settings
repo-check :
@bin/repo_check.py -s .
@${PYTHON} bin/repo_check.py -s .

## clean : clean up junk files.
## * clean : clean up junk files
clean :
@rm -rf ${DST}
@rm -rf .sass-cache
Expand All @@ -42,22 +72,26 @@ clean :
@find . -name '*~' -exec rm {} \;
@find . -name '*.pyc' -exec rm {} \;

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

## ----------------------------------------
## Commands specific to workshop websites.

##
## II. Commands specific to workshop websites
## =================================================

.PHONY : workshop-check

## workshop-check : check workshop homepage.
## * workshop-check : check workshop homepage
workshop-check :
@bin/workshop_check.py .
@${PYTHON} bin/workshop_check.py .

## ----------------------------------------
## Commands specific to lesson websites.

##
## III. Commands specific to lesson websites
## =================================================

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

Expand Down Expand Up @@ -85,37 +119,39 @@ HTML_DST = \
$(patsubst _extras/%.md,${DST}/%/index.html,$(sort $(wildcard _extras/*.md))) \
${DST}/license/index.html

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

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

## lesson-check : validate lesson Markdown.
## * lesson-check : validate lesson Markdown
lesson-check : lesson-fixme
@bin/lesson_check.py -s . -p ${PARSER} -r _includes/links.md
@${PYTHON} bin/lesson_check.py -s . -p ${PARSER} -r _includes/links.md

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

## unittest : run unit tests on checking tools.
## * unittest : run unit tests on checking tools
unittest :
@bin/test_lesson_check.py
@${PYTHON} bin/test_lesson_check.py

## lesson-files : show expected names of generated files for debugging.
## * lesson-files : show expected names of generated files for debugging
lesson-files :
@echo 'RMD_SRC:' ${RMD_SRC}
@echo 'RMD_DST:' ${RMD_DST}
@echo 'MARKDOWN_SRC:' ${MARKDOWN_SRC}
@echo 'HTML_DST:' ${HTML_DST}

## lesson-fixme : show FIXME markers embedded in source files.
## * lesson-fixme : show FIXME markers embedded in source files
lesson-fixme :
@fgrep -i -n FIXME ${MARKDOWN_SRC} || true
@grep --fixed-strings --word-regexp --line-number --no-messages FIXME ${MARKDOWN_SRC} || true

#-------------------------------------------------------------------------------
# Include extra commands if available.
#-------------------------------------------------------------------------------
##
## IV. Auxililary (plumbing) commands
## =================================================

-include commands.mk
## * commands : show all commands.
commands :
@sed -n -e '/^##/s|^##[[:space:]]*||p' $(MAKEFILE_LIST)
53 changes: 14 additions & 39 deletions _includes/aio-script.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,20 @@ open an issue: https://github.com/carpentries/styles/issues/new

{% include manual_episode_order.html %}

<script>
window.onload = function() {
var lesson_episodes = [
{% for lesson_episode in lesson_episodes %}
{% if site.episode_order %}
{% assign episode = site.episodes | where: "slug", lesson_episode | first %}
{% else %}
{% assign episode = lesson_episode %}
{% endif %}
"{{ episode.url}}"{% unless forloop.last %},{% endunless %}
{% endfor %}
];
var xmlHttp = []; /* Required since we are going to query every episode. */
for (i=0; i < lesson_episodes.length; i++) {
xmlHttp[i] = new XMLHttpRequest();
xmlHttp[i].episode = lesson_episodes[i]; /* To enable use this later. */
xmlHttp[i].onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var article_here = document.getElementById(this.episode);
var parser = new DOMParser();
var htmlDoc = parser.parseFromString(this.responseText,"text/html");
var htmlDocArticle = htmlDoc.getElementsByTagName("article")[0];
article_here.innerHTML = htmlDocArticle.innerHTML;
}
}
var episode_url = "{{ relative_root_path }}" + lesson_episodes[i];
xmlHttp[i].open("GET", episode_url);
xmlHttp[i].send(null);
}
}
</script>
{% for lesson_episode in lesson_episodes %}

{% comment %} Create an anchor for every episode. {% endcomment %}
{% if site.episode_order %}
{% assign e = site.episodes | where: "slug", lesson_episode | first %}
{% else %}
{% assign e = lesson_episode %}
{% endif %}

{% for lesson_episode in lesson_episodes %}
{% if site.episode_order %}
{% assign episode = site.episodes | where: "slug", lesson_episode | first %}
{% else %}
{% assign episode = lesson_episode %}
{% endif %}
<article id="{{ episode.url }}"></article>
<h1 id="{{ e.title | slugify }}" class="maintitle">{{ e.title }}</h1>

{% include episode_overview.html teaching_time=e.teaching exercise_time=e.exercises episode_questions=e.questions episode_objectives=e.objectives %}

{{ e.content }}

{% include episode_keypoints.html episode_keypoints=e.keypoints %}
<hr />
{% endfor %}
9 changes: 8 additions & 1 deletion _includes/episode_keypoints.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
{% comment %}
Display key points for an episode.
{% endcomment %}

{% if page.keypoints == nil %}
{% assign episode_keypoints = include.episode_keypoints %}
{% else %}
{% assign episode_keypoints = page.keypoints %}
{% endif %}

<blockquote class="keypoints">
<h2>Key Points</h2>
<ul>
{% for keypoint in page.keypoints %}
{% for keypoint in episode_keypoints %}
<li>{{ keypoint|markdownify }}</li>
{% endfor %}
</ul>
Expand Down
Loading