Commit efeb6cfd authored by Carpentries Bot's avatar Carpentries Bot
Browse files

[actions] Sync lesson with carpentries/styles

parents 9b28fa41 b31b4896
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -127,13 +127,14 @@ jobs:
        id: check-rmd
        working-directory: lesson
        run: |
          echo "::set-output name=count::$(shopt -s nullglob; files=($(find . -iname '*.Rmd')); echo ${#files[@]})"
          echo "count=$(shopt -s nullglob; files=($(find . -iname '*.Rmd')); echo ${#files[@]})" >> $GITHUB_OUTPUT

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

      - name: Install needed packages
        if: steps.check-rmd.outputs.count != 0
+4 −3
Original line number Diff line number Diff line
@@ -44,13 +44,14 @@ jobs:
      - name: Look for R-markdown files
        id: check-rmd
        run: |
          echo "::set-output name=count::$(shopt -s nullglob; files=($(find . -iname '*.Rmd')); echo ${#files[@]})"
          echo "count=$(shopt -s nullglob; files=($(find . -iname '*.Rmd')); echo ${#files[@]})" >> $GITHUB_OUTPUT

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

      - name: Restore R Cache
        if: steps.check-rmd.outputs.count != 0
+22 −0
Original line number Diff line number Diff line
{% assign date = include.need_transition_date %}

{% if date == "true" %}
{% unless site.transition_date_prebeta %}
<div class="alert alert-danger">
  you need to specify the variable <code>transition_date_prebeta</code>
  in <code>_config.yml</code>.
</div>
{% endunless %}
{% unless site.transition_date_beta %}
<div class="alert alert-danger">
  you need to specify the variable <code>transition_date_beta</code>
  in <code>_config.yml</code>.
</div>
{% endunless %}
{% unless site.transition_date_prerelease %}
<div class="alert alert-danger">
  you need to specify the variable <code>transition_date_prerelease</code>
  in <code>_config.yml</code>.
</div>
{% endunless %}
{% endif %}
+7 −7
Original line number Diff line number Diff line
@@ -28,10 +28,10 @@
	{% endif %}
    </div>
    <div class="col-md-6 help-links" align="right">
	{% if page.source %}
	{% if page.source == "Rmd" %}
    {% if site.life_cycle == 'transition-step-2' %}
    <a href="{{repo_url}}">Edit on GitHub</a>
    {% elsif page.source == "Rmd" %}
    <a href="{{repo_url}}/edit/{{ default_branch }}/{{page.path|replace: "_episodes", "_episodes_rmd" | replace: ".md", ".Rmd"}}" data-checker-ignore>Edit on GitHub</a>
	{% endif %}
    {% else %}
    <a href="{{repo_url}}/edit/{{ default_branch }}/{{page.path}}" data-checker-ignore>Edit on GitHub</a>
    {% endif %}
+49 −2
Original line number Diff line number Diff line
@@ -28,7 +28,55 @@
{% elsif site.life_cycle == "stable" %}

{% comment %}
We do not do anything special unless this is a Carpentries Lab lesson
We do not do anything special for lessons in stable
{% endcomment %}


{% comment %}
Below we cover the 2 phases of lesson transition towards the Carpentries Workbench:
Variables needed:
  - transition_date_prebeta: the date of the prebeta stage
  - transition_date_beta: the date of the beta stage
  - transition_date_prerelease: the date of the prerelease stage

- transition-step-1: We notify that there is a snapshot of the lesson available for testing, and that it will supersede this version.
- transition-step-2 We indicate that this version of the lesson is a snapshot and a new version of the lesson is avaiable and will supersede this version at a given date.
{% endcomment %}

{% elsif site.life_cycle == "transition-step-1" %}
{% include check_transition_variables.html need_transition_date = 'true' %}

<div class="alert alert-warning life-cycle">
  A snapshot of this lesson from {{ site.transition_date_prebeta }} is being tested on
  <a href='https://carpentries.github.io/workbench'>The Carpentries Workbench</a>:
  <a href="https://preview.carpentries.org/{{ repo_name }}">https://preview.carpentries.org/{{ repo_name }}</a>.
  <br>
  <b>The Workbench version of this lesson will become default on {{ site.transition_date_prerelease }}</b>.
  <button type="button" style="border: true; position: absolute; top: 10px; right: 27px; color: #383838;" class="close" data-dismiss="alert" aria-label="Close">
    <span aria-hidden="true" style='font-size:34pt'>&times;</span>
  </button>
</div>

{% elsif site.life_cycle == "transition-step-2" %}
{% include check_transition_variables.html need_transition_date = 'true' %}

<div class="alert alert-danger alert-dismissible life-cycle" role="alert">
  This lesson is a <b>snapshot from {{ site.transition_date_beta }}</b>.
  A newer version is being tested on <a href='https://carpentries.github.io/workbench'>The Carpentries Workbench</a>:
  <a href="https://preview.carpentries.org/{{ repo_name }}">https://preview.carpentries.org/{{ repo_name }}</a>.
  <br>
  <b>The Workbench version of this lesson will become default on {{ site.transition_date_prerelease }}</b>.
  <button type="button" style="border: true; position: absolute; top: 10px; right: 27px; color: #383838;" class="close" data-dismiss="alert" aria-label="Close">
    <span aria-hidden="true" style='font-size:34pt'>&times;</span>
  </button>
</div>

{% endif %}



{% comment %}
For Carpentries Lab lessons we add a banner about the review status
{% endcomment %}

{% if site.carpentry == "lab" %}
@@ -43,4 +91,3 @@ We do not do anything special unless this is a Carpentries Lab lesson
  </div>
</div>
{% endif %}
{% endif %}
Loading