From: Sarah Brown Date: Mon, 24 Sep 2018 16:12:33 +0000 (-0400) Subject: Merge branch 'gh-pages' into gh-pages X-Git-Url: https://git.arvados.org/rnaseq-cwl-training.git/commitdiff_plain/48b6ab3ebcbc56eee36ffe1c7c00e6028746fcc5?hp=23596e7060e032da4a846b69099b55001d99fb98 Merge branch 'gh-pages' into gh-pages --- diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..1d7d564 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,25 @@ +root = true + +[*] +charset = utf-8 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +indent_size = 2 +indent_style = space +max_line_length = 100 # Please keep this in sync with bin/lesson_check.py! + +[*.r] +max_line_length = 80 + +[*.py] +indent_size = 4 +indent_style = space +max_line_length = 79 + +[*.sh] +end_of_line = lf + +[Makefile] +indent_style = tab diff --git a/.gitignore b/.gitignore index 8b84b8e..128437d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,6 @@ __pycache__ _site .Rproj.user +.Rhistory +.RData + diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index acf6fb6..c3b9669 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,7 +1,6 @@ --- layout: page title: "Contributor Code of Conduct" -permalink: /conduct/ --- As contributors and maintainers of this project, we pledge to follow the [Carpentry Code of Conduct][coc]. diff --git a/Makefile b/Makefile index 74f655d..ac587b8 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ # Settings MAKEFILES=Makefile $(wildcard *.mk) JEKYLL=jekyll +JEKYLL_VERSION=3.7.3 PARSER=bin/markdown_ast.rb DST=_site @@ -16,6 +17,10 @@ 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 @@ -38,7 +43,7 @@ clean : @find . -name '*.pyc' -exec rm {} \; ## clean-rmd : clean intermediate R files (that need to be committed to the repo). -clear-rmd : +clean-rmd : @rm -rf ${RMD_DST} @rm -rf fig/rmd-* @@ -83,9 +88,8 @@ HTML_DST = \ ## lesson-md : convert Rmarkdown files to markdown lesson-md : ${RMD_DST} -# Use of .NOTPARALLEL makes rule execute only once -${RMD_DST} : ${RMD_SRC} - @bin/knit_lessons.sh ${RMD_SRC} +_episodes/%.md: _episodes_rmd/%.Rmd + @bin/knit_lessons.sh $< $@ ## lesson-check : validate lesson Markdown. lesson-check : lesson-fixme diff --git a/_includes/all_keypoints.html b/_includes/all_keypoints.html index 8563df3..e4fd289 100644 --- a/_includes/all_keypoints.html +++ b/_includes/all_keypoints.html @@ -1,13 +1,16 @@ {% comment %} Display key points of all episodes for reference. {% endcomment %} + +{% include base_path.html %} +

Key Points

{% for episode in site.episodes %} {% unless episode.break %}
- {{ episode.title }} + {{ episode.title }}
    diff --git a/_includes/base_path.html b/_includes/base_path.html new file mode 100644 index 0000000..7efb357 --- /dev/null +++ b/_includes/base_path.html @@ -0,0 +1,27 @@ +{% comment %} +This is adapted from: https://ricostacruz.com/til/relative-paths-in-jekyll + +`page.url` gives the URL of the current page with a leading /: + +- when the URL ends with the extension (e.g., /foo/bar.html) then we can get + the depth by counting the number of / and remove - 1 +- when the URL ends with a / (e.g. /foo/bar/) then the number / gives the depth + directly +{% endcomment %} + +{% assign relative_root_path = '' %} + +{% assign last_char = page.url | slice: -1 %} + +{% if last_char == "/"} +{% assign offset = 0 %} +{% else %} +{% assign offset = 1 %} +{% endif %} + +{% assign depth = page.url | split: '/' | size | minus: offset %} +{% if depth <= 1 %}{% assign relative_root_path = '.' %} +{% elsif depth == 2 %}{% assign relative_root_path = '..' %} +{% elsif depth == 3 %}{% assign relative_root_path = '../..' %} +{% elsif depth == 4 %}{% assign relative_root_path = '../../..' %} +{% endif %} diff --git a/_includes/carpentries.html b/_includes/carpentries.html index 4d5c906..5691223 100644 --- a/_includes/carpentries.html +++ b/_includes/carpentries.html @@ -1,44 +1,71 @@ {% comment %} General description of Software and Data Carpentry. {% endcomment %} + +{% include base_path.html %} +
    - Software Carpentry logo + The Carpentries logo
    - Since 1998, - Software Carpentry - has been teaching researchers in science, engineering, medicine, and related disciplines - the computing skills they need to get more done in less time and with less pain. - Its volunteer instructors have run hundreds of events - for thousands of learners in the past two and a half years. +

    The Carpentries comprises + Software Carpentry and Data Carpentry, communities of Instructors, Trainers, + Maintainers, helpers, and supporters who share a mission to teach + foundational coding and data science skills to researchers. In January, + 2018, The Carpentries was formed by the merger of Software Carpentry and + Data Carpentry.

    + +

    While individual lessons and workshops continue to be run under each + lesson project, The Carpentries provide overall staffing and governance, as + well as support for assessment, instructor training and mentoring. + Memberships are joint, and the Carpentries project maintains a shared Code + of Conduct. The Carpentries is a fiscally sponsored project of Community + Initiatives, a registered 501(c)3 non-profit based in California, USA.

    +
    +
    +
    +
    + Software Carpentry logo +
    +
    +

    Since 1998, Software Carpentry has + been teaching researchers across all disciplines the foundational coding + skills they need to get more done in less time and with less pain. Its + volunteer instructors have run hundreds of events for thousands of learners + around the world. Now that all research involves some degree of + computational work, whether with big data, cloud computing, or simple task + automation, these skills are needed more than ever.


    - Data Carpentry logo + Data Carpentry logo
    - Data Carpentry develops and teaches workshops on the fundamental data skills needed to conduct research. - Its target audience is researchers who have little to no prior computational experience, - and its lessons are domain specific, - building on learners' existing knowledge to enable them to quickly apply skills learned to their own research. +

    Data Carpentry develops and teaches + workshops on the fundamental data skills needed to conduct research. Its + target audience is researchers who have little to no prior computational + experience, and its lessons are domain specific, building on learners' + existing knowledge to enable them to quickly apply skills learned to their + own research. Data Carpentry workshops take researchers through the entire + data life cycle.


    - Library Carpentry logo + Library Carpentry logo
    - Library Carpentry is made by librarians to help librarians - automate repetitive, boring, error-prone tasks; - create, maintain and analyse sustainable and reusable data; - work effectively with IT and systems colleagues; - better understand the use of software in research; - and much more. - Library Carpentry was the winner of the 2016 - British Library Labs Teaching and Learning Award. +

    Library Carpentry is in discussions with + The Carpentries to be a Lesson Project, like Software Carpentry* + and Data Carpentry. Library Carpentry develops lessons and + teaches workshops for and with people working in library- and + information-related roles. Its goal is to create an on-ramp to empower this + community to use software and data in their own work, as well as be + advocates for and train others in efficient, effective and reproducible data + and software practices.

    diff --git a/_includes/episode_navbar.html b/_includes/episode_navbar.html index c2bc80e..ea368eb 100644 --- a/_includes/episode_navbar.html +++ b/_includes/episode_navbar.html @@ -1,27 +1,35 @@ +{% comment %} +For some reason, the relative_root_path seems out of scope in this file, so we +need to re-assign it here +{% endcomment %} + +{% include base_path.html %} + {% comment %} Navigation bar for an episode. {% endcomment %} +

    {% if page.previous.url %} - previous episode + previous episode {% else %} - lesson home + lesson home {% endif %}

    {% if include.episode_navbar_title %} -

    {{ site.title }}

    +

    {{ site.title }}

    {% endif %}

    {% if page.next.url %} - next episode + next episode {% else %} - lesson home + lesson home {% endif %}

    diff --git a/_includes/favicons.html b/_includes/favicons.html index 4ea6742..8a50b4d 100644 --- a/_includes/favicons.html +++ b/_includes/favicons.html @@ -1,4 +1,4 @@ -{% assign favicon_url = site.baseurl | append: '/assets/favicons/' | append: site.carpentry | prepend: site.url %} +{% assign favicon_url = relative_root_path | append: '/assets/favicons/' | append: site.carpentry %} {% if site.carpentry == 'swc' %} {% assign carpentry = 'Software Carpentry' %} diff --git a/_includes/gh_variables.html b/_includes/gh_variables.html new file mode 100644 index 0000000..3fdae4a --- /dev/null +++ b/_includes/gh_variables.html @@ -0,0 +1,45 @@ +{% comment %} +When rendering websites locally, `site.github.url` doesn't get resolved properly +unless a GitHub Personal Access Token is set up and available in the +environment. This leads to warnings and errors when trying to serve the site +locally. To work around this, we use the `jekyll.environment` variable which is +set to `development` when rendering the site locally, and set to `production` on +GitHub where `site.github.url` is defined. +{% endcomment %} + +{% if jekyll.environment == "production" %} + +{% comment %} +First, get the name of the repository +{% endcomment %} +{% assign repo_name = site.github.repository_name %} + +{% comment %} +`site.github.public_repositories` contains comprehensive information for all public repositories for the organization. We use `where` to extract the part +of the metadata that is relevant to the present repository. +{% endcomment %} +{% assign repo_info = site.github.public_repositories | where: "name", repo_name %} + +{% comment %} +Now, we can extract the default branch for the repo +{% endcomment %} +{% assign default_branch = repo_info[0].default_branch %} + +{% comment %} +Other variables requested by the template +{% endcomment %} +{% assign repo_url = site.github.repository_url %} +{% assign search_domain_url = site.github.url %} +{% assign project_title = site.github.project_title %} +{% assign source_branch = site.github.source.branch %} + +{% elsif jekyll.environment == "development" %} + +{% assign repo_name = "" %} +{% assign repo_url = "" %} +{% assign default_branch = "" %} +{% assign search_domain_url = "" %} +{% assign project_title = "" %} +{% assign source_branch = "" %} + +{% endif %} diff --git a/_includes/javascript.html b/_includes/javascript.html index a2066c2..fcc74e6 100644 --- a/_includes/javascript.html +++ b/_includes/javascript.html @@ -1,9 +1,9 @@ {% comment %} - Javascript used in lesson and workshop pages. + JavaScript used in lesson and workshop pages. {% endcomment %} - - - + + +