Skip to content

Commit

Permalink
Sync with carpentries upstream repo
Browse files Browse the repository at this point in the history
  • Loading branch information
milanmlft authored Sep 4, 2023
2 parents 4530696 + c5a14a5 commit cf13fd6
Show file tree
Hide file tree
Showing 29 changed files with 1,515 additions and 423 deletions.
28 changes: 28 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
root = true

[*]
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true

[*.{qmd,Rmd,md}]
indent_size = 2
indent_style = space
max_line_length = 80 # 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
indent_size = 2
indent_style = space

[*.{py,js}]
indent_size = 4
indent_style = space
max_line_length = 80

[*.sh]
end_of_line = lf

[Makefile]
indent_style = tab
7 changes: 2 additions & 5 deletions .github/workflows/compile-css.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
on:
pull_request:
push:
paths:
- .github/workflows/compile-css.yaml
- source/**
- source/**/**
- postinstall.sh
- squash-a-script.sh
- squash-sass.sh
Expand All @@ -20,14 +22,9 @@ jobs:
- name: Clean
run: rm -rf inst/pkgdown/assets/assets/
- uses: actions/setup-node@v2
with:
node-version: '14'
- run: npm install
- run: npm install -g uglify-js
- name: Comple js
run: bash squash-a-script.sh
- name: Install sass
run: npm install -g sass
- name: Compile sass
run: bash squash-sass.sh
- name: Commit
Expand Down
10 changes: 9 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
Package: varnish
Title: Front-end for The Carpentries Lesson Template
Version: 0.2.14
Version: 0.3.0
Authors@R: c(
person(given = "Zhian N.",
family = "Kamvar",
role = c("aut", "cre"),
email = "[email protected]",
comment = c(ORCID = "0000-0003-1458-7108")),
person(given = "Ben",
family = "Companjen",
role = c("ctb"),
comment = c(ORCID = "0000-0002-7023-9047")),
person(given = "Toby",
family = "Hodges",
role = c("ctb"),
email = "[email protected]"),
person(given = "François",
family = "Michonneau",
role = c("ctb"),
Expand Down
45 changes: 45 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
# varnish 0.3.0

* Lesson overview pages are now supported (reported: @zkamvar,
https://github.com/carpentries/workbench/issues/65; implemented: @zkamvar,
#87). These overview pages do not have a sidebar and have extra navigation
back to home and the setup page in the menu bar.
- new 'overview' template is implemented to always contain links back to the
home page.
* The `spoiler` dropdown item has been implemented to allow authors to create
stand-alone accordions that will hide optinal content from users without using
a `solution` class (implemented: @tobyhodges, #92)

## MISC

* The build process for css/js bundles is now self-contained in the node
dev dependencies. Running `npm install` will install everything needed to
re-compile the js and css.
* The README has been updated with instructions to build locally
* An `.editorconfig` file has been added to ensure the JS content is indented
properly

# varnish 0.2.18

* Non-math elements on the same line will no longer be treated as math
(reported: @marklcrowe, #88; fixed: @zkamvar, #90)
* Bold italic text will now render correctly
(reported: @marklcrowe, #89; fixed: @zkamvar, #91)

# varnish 0.2.17

* The margin below the schedule table in instructor view is now 25px instead of
225px (reported: @bencomp, #81; fixed: @bencomp, #82).

# varnish 0.2.16

* font weight for anything in definition terms is now inherited.

# varnish 0.2.15

- The Carpentries Lab logo has been updated (reported: @tobyhodges, #59; fixed:
@tobyhodges, #76)
- The size for large logos are now capped at 64px so contributors do not need
to force their logos to a particular size when exporting SVG (fixed: @zkamvar,
#76)

# varnish 0.2.14

* Workbench Beta Phase `Edit on GitHub` links no longer redirect people to the
Expand Down
32 changes: 28 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,36 @@ copy the styling and templates to your lesson website.

## CSS and JavaScript

The CSS and JavaScript used for the lessons are minified. Their sources live in
the [`source/`](source/) folder with directives to include their dependencies
(bootstrap, jquery, feather).
The CSS and JavaScript used for the lessons are minified using SASS and
uglifyjs. Their sources live in the [`source/`](source/) folder with directives
to include their dependencies (bootstrap, jquery, feather).

The minified versions are built via GitHub actions any time one of the source
files is changed.

Instructions to build locally forthcoming.
To build this locally, you need to make sure to have a working version of
`node` and `npm`, which can be installed [via the node version manager, nvm](https://github.com/nvm-sh/nvm#intro).

### Install dependencies

Once you have `nvm` installed, you can install the node packages locally (they
will install in the _`node_modules/`_ directory and will be ignored by git)
with the following command:

```sh
nvm install 16 # make sure we are using node version 16
npm install # install the packages defined in package.json
```

### Minify CSS and JS

Once you have the dependencies installed, you can run the following scripts to
minify the CSS and JS:

```sh
bash squash-sass.sh # use the sass node module to compile CSS
bash squash-a-script.sh # use the uglifyjs node module to compile JS
```

## HTML Templates

Expand All @@ -43,6 +65,8 @@ We have customized the following templates:
- [content-syllabus] is the landing page for the lessons
- [content-extra] is used for pages that are not chapters and do not need
positional navigation
- [content-overview] is like content-extra, but is meant for the home page of
an overview lesson
- [head] contains the metadata and script loading
- [navbar] is a bit of misnomer, but it contains the sidebar navigation
- [header] contains metadata and favicons
Expand Down
161 changes: 91 additions & 70 deletions inst/pkgdown/assets/assets/images/lab-logo-sm.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit cf13fd6

Please sign in to comment.