forked from NEUBIAS/training-resources
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b617e91
commit 8870468
Showing
215 changed files
with
12,664 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
.sass-cache* | ||
Gemfile.lock | ||
_site* | ||
.travis.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,24 @@ | ||
image: ruby:2.5 | ||
|
||
variables: | ||
JEKYLL_ENV: production | ||
LC_ALL: C.UTF-8 | ||
|
||
before_script: | ||
- bundle install | ||
|
||
test: | ||
stage: test | ||
script: | ||
- bundle exec jekyll build -d test | ||
artifacts: | ||
paths: | ||
- test | ||
- apt-get -y update | ||
- apt-get install -y python3 | ||
- apt-get install -y python3-pip | ||
- gem install json kramdown jekyll | ||
- pip3 install pyyaml | ||
|
||
pages: | ||
stage: deploy | ||
script: | ||
- bundle exec jekyll build -d public | ||
- make --always-make site | ||
artifacts: | ||
paths: | ||
- public | ||
only: | ||
- master | ||
- carpentries-style | ||
- theme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
FIXME: list authors' names and email addresses. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
FIXME: describe how to cite this lesson. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
layout: page | ||
title: "Contributor Code of Conduct" | ||
--- | ||
As contributors and maintainers of this project, | ||
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]. | ||
|
||
{% include links.md %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
## ======================================== | ||
## Commands for both workshop and lesson websites. | ||
|
||
# Settings | ||
MAKEFILES=Makefile $(wildcard *.mk) | ||
JEKYLL=jekyll | ||
JEKYLL_VERSION=3.8.5 | ||
PARSER=bin/markdown_ast.rb | ||
DST=public | ||
|
||
# Controls | ||
.PHONY : commands clean files | ||
.NOTPARALLEL: | ||
all : commands | ||
|
||
## commands : show all commands. | ||
commands : | ||
@grep -h -E '^##' ${MAKEFILES} | sed -e 's/## //g' | ||
|
||
## 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 | ||
|
||
## serve : run a local server. | ||
serve : lesson-md | ||
${JEKYLL} serve | ||
|
||
## site : build files but do not run a server. | ||
site : lesson-md | ||
${JEKYLL} build -d ${DST} | ||
|
||
# repo-check : check repository settings. | ||
repo-check : | ||
@bin/repo_check.py -s . | ||
|
||
## clean : clean up junk files. | ||
clean : | ||
@rm -rf ${DST} | ||
@rm -rf .sass-cache | ||
@rm -rf bin/__pycache__ | ||
@find . -name .DS_Store -exec rm {} \; | ||
@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 : | ||
@rm -rf ${RMD_DST} | ||
@rm -rf fig/rmd-* | ||
|
||
## ---------------------------------------- | ||
## Commands specific to workshop websites. | ||
|
||
.PHONY : workshop-check | ||
|
||
## workshop-check : check workshop homepage. | ||
workshop-check : | ||
@bin/workshop_check.py . | ||
|
||
## ---------------------------------------- | ||
## Commands specific to lesson websites. | ||
|
||
.PHONY : lesson-check lesson-md lesson-files lesson-fixme | ||
|
||
# RMarkdown files | ||
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. | ||
MARKDOWN_SRC = \ | ||
index.md \ | ||
CODE_OF_CONDUCT.md \ | ||
setup.md \ | ||
$(sort $(wildcard _episodes/*.md)) \ | ||
reference.md \ | ||
$(sort $(wildcard _extras/*.md)) \ | ||
LICENSE.md | ||
|
||
# Generated lesson files in the order they appear in the navigation menu. | ||
HTML_DST = \ | ||
${DST}/index.html \ | ||
${DST}/conduct/index.html \ | ||
${DST}/setup/index.html \ | ||
$(patsubst _episodes/%.md,${DST}/%/index.html,$(sort $(wildcard _episodes/*.md))) \ | ||
${DST}/reference/index.html \ | ||
$(patsubst _extras/%.md,${DST}/%/index.html,$(sort $(wildcard _extras/*.md))) \ | ||
${DST}/license/index.html | ||
|
||
## 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 : lesson-fixme | ||
@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 : | ||
@bin/lesson_check.py -s . -p ${PARSER} -r _includes/links.md -l -w --permissive | ||
|
||
## unittest : run unit tests on checking tools. | ||
unittest : | ||
@bin/test_lesson_check.py | ||
|
||
## 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 : | ||
@fgrep -i -n FIXME ${MARKDOWN_SRC} || true | ||
|
||
#------------------------------------------------------------------------------- | ||
# Include extra commands if available. | ||
#------------------------------------------------------------------------------- | ||
|
||
-include commands.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: About | ||
--- | ||
{% include carpentries.html %} | ||
{% include links.md %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
title: Discussion | ||
--- | ||
FIXME | ||
|
||
{% include links.md %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--- | ||
title: Figures | ||
--- | ||
|
||
{% include base_path.html %} | ||
|
||
<script> | ||
window.onload = function() { | ||
var lesson_episodes = [ | ||
{% for episode in site.episodes %} | ||
"{{ 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 parser = new DOMParser(); | ||
var htmlDoc = parser.parseFromString(this.responseText,"text/html"); | ||
var htmlDocArticle = htmlDoc.getElementsByTagName("article")[0]; | ||
|
||
var article_here = document.getElementById(this.episode); | ||
var images = htmlDocArticle.getElementsByTagName("img"); | ||
|
||
if (images.length > 0) { | ||
var h1text = htmlDocArticle.getElementsByTagName("h1")[0].innerHTML; | ||
|
||
var htitle = document.createElement('h2'); | ||
htitle.innerHTML = h1text; | ||
article_here.appendChild(htitle); | ||
|
||
var image_num = 0; | ||
for (let image of images) { | ||
image_num++; | ||
|
||
var title = document.createElement('p'); | ||
title.innerHTML = "<strong>Figure " + image_num + ".</strong> " + image.alt; | ||
article_here.appendChild(title); | ||
|
||
article_here.appendChild(image.cloneNode(false)); | ||
|
||
if (image_num < images.length) { | ||
var hr = document.createElement('hr'); | ||
article_here.appendChild(hr); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
episode_url = "{{ relative_root_path }}" + lesson_episodes[i]; | ||
xmlHttp[i].open("GET", episode_url); | ||
xmlHttp[i].send(null); | ||
} | ||
} | ||
</script> | ||
{% comment %} | ||
Create anchor for each one of the episodes. | ||
{% endcomment %} | ||
{% for episode in site.episodes %} | ||
<article id="{{ episode.url }}" class="figures"></article> | ||
{% endfor %} | ||
|
||
{% include links.md %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
title: "Instructor Notes" | ||
--- | ||
FIXME | ||
|
||
{% include links.md %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{% comment %} | ||
As a maintainer, you don't need to edit this file. | ||
If you notice that something doesn't work, please | ||
open an issue: https://github.com/carpentries/styles/issues/new | ||
{% endcomment %} | ||
|
||
<script> | ||
window.onload = function() { | ||
var lesson_episodes = [ | ||
{% for episode in site.episodes %} | ||
"{{ 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> | ||
{% comment %} | ||
Create an anchor for every episode. | ||
{% endcomment %} | ||
{% for episode in site.episodes %} | ||
<article id="{{ episode.url }}"></article> | ||
{% endfor %} |
Oops, something went wrong.