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

Seamless Learning Workshop changes #8

Merged
merged 39 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
64148f1
Add axe-linter.yml
phrdang Jun 11, 2024
28214f7
Create jekyll.yml
phrdang Jun 11, 2024
3830720
Add jekyll-sitemap plugin and try to fix deploy error
phrdang Jun 11, 2024
d9f5473
Merge branch 'main' of github.com:phrdang/berkeley-class-site
phrdang Jun 11, 2024
403aa05
Add webrick gem
phrdang Jun 12, 2024
ea959d8
Exclude node_modules in _config.yml
phrdang Jun 13, 2024
d09f301
Add accessibility testing gems
phrdang Jun 13, 2024
1881d05
Add basic rspec test to use Axe to check home page accessibility
phrdang Jun 13, 2024
d17bc6d
Update url, baseurl in _config.yml
phrdang Jun 13, 2024
65f9565
Run axe check on all pages in sitemap
phrdang Jun 13, 2024
a37af2e
Add rspec.yml github actions workflow
phrdang Jun 13, 2024
e60185a
Use ruby/setup-ruby@v1 action
phrdang Jun 13, 2024
9e55a9c
Try to fix LoadError
phrdang Jun 13, 2024
1a16c6c
Try again to fix LoadError
phrdang Jun 13, 2024
05677fb
Try again to fix LoadError
phrdang Jun 13, 2024
9f8492d
Remove if statement preventing checking home page accessibility
phrdang Jun 13, 2024
67c2742
Add dummy md and py files to check linters
phrdang Jun 13, 2024
bec53a0
Add reviewdog.yml
phrdang Jun 13, 2024
9a33b21
Replace misspell with spellcheck, use github-pr-check as reporter
phrdang Jun 13, 2024
2110995
Remove vale spellcheck, rename axe-linter.yml workflow name
phrdang Jun 13, 2024
5bdd305
Delete dummy files
phrdang Jun 13, 2024
bcea35c
Merge pull request #3 from phrdang/test-rspec-axe
phrdang Jun 13, 2024
059587b
Add sort by name to staffers collection, add course email variable to…
phrdang Jun 14, 2024
194fbc5
Update staffer layout and styling
phrdang Jun 14, 2024
891780a
Update staff page to support head TA, tutor, and AI roles
phrdang Jun 14, 2024
302c26b
Update default staff markdown files to demonstrate different staffer …
phrdang Jun 14, 2024
9c9f763
Merge pull request #5 from phrdang/staff
phrdang Jun 14, 2024
03cc217
Rename about.md to syllabus.md
phrdang Jun 14, 2024
458375f
Rename README.md to home.md since it is used as the website homepage
phrdang Jun 14, 2024
db1069e
Add actual README.md and CONTRIBUTING.md draft
phrdang Jun 14, 2024
56c6a41
Merge pull request #6 from phrdang/syllabus-readme-contributing
phrdang Jun 14, 2024
fb7bedf
Add lab layout and sample lab 1 page
phrdang Jun 14, 2024
ec2d470
Update sidebar nav order
phrdang Jun 14, 2024
f467385
Add _hw and _projects directories
phrdang Jun 14, 2024
ad02642
Make lab a collection; add hw and projects collections; create HW 1 a…
phrdang Jun 14, 2024
25c34c8
Merge pull request #12 from phrdang/labs
phrdang Jun 14, 2024
539a54a
Use include tag to import python files
phrdang Jun 14, 2024
683e4b5
Minor tweaks
cycomachead Jun 18, 2024
9d12207
Merge branch 'main' into main
cycomachead Jun 18, 2024
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
16 changes: 16 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Contributing
phrdang marked this conversation as resolved.
Show resolved Hide resolved

TODO write docs for staff here

## Continuous Integration (GitHub Actions)

TODO Info here about workflows and links

## Testing

To run tests, run `bundle exec rspec`

## Resources

- [Jekyll](https://jekyllrb.com/)
- [GitHub](https://docs.github.com/)
14 changes: 14 additions & 0 deletions .github/workflows/axe-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Run axe linter

on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: dequelabs/axe-linter-action@v1
with:
api_key: ${{ secrets.AXE_LINTER_API_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/jekyll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0
with:
ruby-version: '3.1' # Not needed with a .ruby-version file
# The Ruby version is determined by either a `.ruby-version` or a `.tool-versions` file in root of the repo.
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Setup Pages
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: reviewdog
phrdang marked this conversation as resolved.
Show resolved Hide resolved
on: [pull_request]
jobs:
pylint:
name: runner / pylint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dciborow/[email protected]
with:
github_token: ${{ secrets.github_token }}
# Change reviewdog reporter if you need [github-pr-check,github-check,github-pr-review].
reporter: github-pr-check
# Change reporter level if you need.
# GitHub Status Check won't become failure with warning.
level: warning
glob_pattern: "**/*.py"

black:
name: runner / black
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check files using the black formatter
uses: rickstaa/[email protected]
id: action_black
with:
black_args: "."
- name: Annotate diff changes using reviewdog
if: steps.action_black.outputs.is_formatted == 'true'
uses: reviewdog/action-suggester@v1
with:
tool_name: blackfmt

markdownlint:
name: runner / markdownlint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: markdownlint
uses: reviewdog/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-check
16 changes: 16 additions & 0 deletions .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Run rspec tests
phrdang marked this conversation as resolved.
Show resolved Hide resolved

on: [pull_request]
phrdang marked this conversation as resolved.
Show resolved Hide resolved

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
# The Ruby version is determined by either a `.ruby-version` or a `.tool-versions` file in root of the repo.
bundler-cache: true
- name: Run rspec tests
run: |
bundle exec rspec
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--require spec_helper
11 changes: 11 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
source 'https://rubygems.org'
gem 'github-pages', group: :jekyll_plugins
phrdang marked this conversation as resolved.
Show resolved Hide resolved
gem 'jekyll-sitemap'
gem 'webrick'

group :development, :test do
gem "rspec"
gem "selenium-webdriver"
gem "capybara"
gem "rack-jekyll"
gem "axe-core-rspec"
gem "axe-core-capybara"
end
58 changes: 30 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
---
layout: home
title: Just the Class
nav_exclude: true
permalink: /:path/
seo:
type: Course
name: Just the Class
---
# Berkeley Class Site

# Just the Class
A template for UC Berkeley class websites (with a focus on EECS/CS/DS courses).

Just the Class is a GitHub Pages template developed for the purpose of quickly deploying course websites. In addition to serving plain web pages and files, it provides a boilerplate for:
## Installation

phrdang marked this conversation as resolved.
Show resolved Hide resolved
- [announcements](announcements.md),
- a [course calendar](calendar.md),
- a [staff](staff.md) page,
- and a weekly [schedule](schedule.md).
Prerequisites:

Just the Class is a template that extends the popular [Just the Docs](https://github.com/just-the-docs/just-the-docs) theme, which provides a robust and thoroughly-tested foundation for your website. Just the Docs include features such as:
- You have everything that [Jekyll requires](https://jekyllrb.com/docs/installation/)
- You have installed [Bundler](https://bundler.io/): Run `gem install jekyll bundler`

- automatic [navigation structure](https://just-the-docs.github.io/just-the-docs/docs/navigation-structure/),
- instant, full-text [search](https://just-the-docs.github.io/just-the-docs/docs/search/) and page indexing,
- and a set of [UI components](https://just-the-docs.github.io/just-the-docs/docs/ui-components) and authoring [utilities](https://just-the-docs.github.io/just-the-docs/docs/utilities).
1. [Fork](https://github.com/berkeley-eecs/berkeley-class-site/fork) the repository.
2. Clone your fork (replace `YOUR_GITHUB_USERNAME` and `YOUR_REPO` accordingly).
```
git clone [email protected]:YOUR_GITHUB_USERNAME/YOUR_REPO.git
```
3. Install dependencies:
```
cd YOUR_REPO
bundle install
```

## Getting Started
## Usage

Getting started with Just the Class is simple.
To run the site locally, run:

1. Create a [new repository based on Just the Class](https://github.com/kevinlin1/just-the-class/generate).
1. Update `_config.yml` and `README.md` with your course information. [Be sure to update the url and baseurl](https://mademistakes.com/mastering-jekyll/site-url-baseurl/).
1. Configure a [publishing source for GitHub Pages](https://help.github.com/en/articles/configuring-a-publishing-source-for-github-pages). Your course website is now live!
1. Edit and create `.md` [Markdown files](https://guides.github.com/features/mastering-markdown/) to add more content pages.
```
bundle exec jekyll serve
```

Just the Class has been used by instructors at Stanford University ([CS 161](https://stanford-cs161.github.io/winter2021/)), UC Berkeley ([Data 100](https://ds100.org/fa21/)), UC Santa Barbara ([CSW8](https://ucsb-csw8.github.io/s22/)), Northeastern University ([CS4530/5500](https://neu-se.github.io/CS4530-CS5500-Spring-2021/)), and Carnegie Mellon University ([17-450/17-950](https://cmu-crafting-software.github.io/)). Share your course website and find more examples in the [show and tell discussion](https://github.com/kevinlin1/just-the-class/discussions/categories/show-and-tell)!
## Deployment

### Local development environment
The easiest way to deploy your site is with [GitHub Pages](https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/about-github-pages-and-jekyll).

Just the Class requires no special Jekyll plugins and can run on GitHub Pages' standard Jekyll compiler. To setup a local development environment, clone your template repository and follow the GitHub Docs on [Testing your GitHub Pages site locally with Jekyll](https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/testing-your-github-pages-site-locally-with-jekyll).
## Contributing

See [CONTRIBUTING.md](.github/CONTRIBUTING.md) for instructions on how to develop this site as part of course staff or if you're interested in contributing to this template repository.

## License

[MIT](LICENSE)
41 changes: 38 additions & 3 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ title: Just the Class
tagline: A Jekyll template for course websites
description: A modern, highly customizable, responsive Jekyll template for course websites
author: Kevin Lin
baseurl: '/just-the-class' # the subpath of your site, e.g. /blog
url: 'https://kevinl.info' # the base hostname & protocol for your site, e.g. http://example.com
exclude: ["Gemfile", "Gemfile.lock", "LICENSE"]
baseurl: '/berkeley-class-site' # the subpath of your site, e.g. /blog
phrdang marked this conversation as resolved.
Show resolved Hide resolved
url: 'https://phrdang.github.io' # the base hostname & protocol for your site, e.g. http://example.com
plugins:
- "jekyll-sitemap"
exclude: ["Gemfile", "Gemfile.lock", "vendor", "node_modules", "LICENSE"]
phrdang marked this conversation as resolved.
Show resolved Hide resolved

# Theme settings
remote_theme: just-the-docs/[email protected]
phrdang marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -37,13 +39,42 @@ footer_content:
# Collections for website data
collections:
staffers:
sort_by: name
modules:
schedules:
announcements:
labs:
output: true
permalink: /:collection/:path
hw:
output: true
permalink: /:collection/:path
projects:
output: true
permalink: /:collection/:path

# Default layouts for each collection type
defaults:
- scope:
path: ''
type: labs
values:
layout: lab
nav_exclude: true
- scope:
path: ''
type: hw
values:
layout: hw
nav_exclude: true
- scope:
path: ''
type: projects
values:
layout: project
nav_exclude: true
- scope:
path: '_staffers'
type: staffers
values:
layout: staffer
Expand Down Expand Up @@ -73,3 +104,7 @@ compress_html:
startings: []
blanklines: false
profile: false

# Course variables
phrdang marked this conversation as resolved.
Show resolved Hide resolved
course_email: [email protected]
gradescope_course_id: 693229
19 changes: 19 additions & 0 deletions _hw/hw01.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: HW 1
description: Recursion
due: "2024-06-13 11:59:59 PM PST"
gradescope_assignment_id: 3858564
submission_files:
- hw01.py
---

1. TOC
{:toc}

## Q1: Sample Question

{% include questions/sample_question.md %}

## Q2: Another Question

{% include questions/another_question.md %}
5 changes: 5 additions & 0 deletions _includes/okpy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Use Ok to test your code:

Check failure on line 1 in _includes/okpy.md

View workflow job for this annotation

GitHub Actions / runner / markdownlint

[markdownlint] reported by reviewdog 🐶 MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "Use Ok to test your code:"] Raw Output: _includes/okpy.md:1 MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "Use Ok to test your code:"]

```

Check failure on line 3 in _includes/okpy.md

View workflow job for this annotation

GitHub Actions / runner / markdownlint

[markdownlint] reported by reviewdog 🐶 MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"] Raw Output: _includes/okpy.md:3 MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
python3 ok -q {{ include.question }}
```
7 changes: 7 additions & 0 deletions _includes/questions/another_question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This is another sample question description.

Check failure on line 1 in _includes/questions/another_question.md

View workflow job for this annotation

GitHub Actions / runner / markdownlint

[markdownlint] reported by reviewdog 🐶 MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "This is another sample questio..."] Raw Output: _includes/questions/another_question.md:1 MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "This is another sample questio..."]

{% highlight python %}
{% include questions/another_question.py %}
{% endhighlight %}

{% include okpy.md question="another_question" %}
12 changes: 12 additions & 0 deletions _includes/questions/another_question.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
def another_question(a, b, c):

Check warning on line 1 in _includes/questions/another_question.py

View workflow job for this annotation

GitHub Actions / runner / pylint

[pylint] reported by reviewdog 🐶 C0114: Missing module docstring (missing-module-docstring) Raw Output: _includes/questions/another_question.py:1:0: C0114: Missing module docstring (missing-module-docstring)
"""
>>> another_question(1, 2, 3)
6
>>> another_question(0, 0, 0)
0
>>> another_question(3, 0, 0)
3
"""
# BEGIN SOLUTION
return a + b + c
# END SOLUTION
7 changes: 7 additions & 0 deletions _includes/questions/sample_question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This is a sample question description.

Check failure on line 1 in _includes/questions/sample_question.md

View workflow job for this annotation

GitHub Actions / runner / markdownlint

[markdownlint] reported by reviewdog 🐶 MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "This is a sample question desc..."] Raw Output: _includes/questions/sample_question.md:1 MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "This is a sample question desc..."]

{% highlight python %}
{% include questions/sample_question.py %}
{% endhighlight %}

{% include okpy.md question="sample_question" %}
12 changes: 12 additions & 0 deletions _includes/questions/sample_question.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
def sample_question(a, b, c):

Check warning on line 1 in _includes/questions/sample_question.py

View workflow job for this annotation

GitHub Actions / runner / pylint

[pylint] reported by reviewdog 🐶 C0114: Missing module docstring (missing-module-docstring) Raw Output: _includes/questions/sample_question.py:1:0: C0114: Missing module docstring (missing-module-docstring)
"""
>>> another_question(1, 2, 3)
6
>>> another_question(0, 0, 0)
0
>>> another_question(3, 0, 0)
3
"""
# BEGIN SOLUTION
return a + b + c
# END SOLUTION
9 changes: 9 additions & 0 deletions _includes/submission.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
When you are done, submit your file to <a href="https://www.gradescope.com/courses/{{ site.gradescope_course_id }}/assignments/{{ include.gradescope_assignment_id }}">Gradescope</a>. You only need to upload the following files:

<ul>
{% for file in include.submission_files %}
<li>{{ file }}</li>
{% endfor %}
</ul>

You may submit more than once before the deadline; only the final submission will be graded. It is your responsibility to check that the autograder on Gradescope runs as expected after you upload your submission.
20 changes: 20 additions & 0 deletions _labs/lab01.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: Lab 1
description: Control and Functions
due: "2024-06-13 11:59:59 PM PST"
gradescope_assignment_id: 3858564
submission_files:
- lab01.py
- another_file.py
---

1. TOC
{:toc}

## Q1: Sample Question

{% include questions/sample_question.md %}

## Q2: Another Question

{% include questions/another_question.md %}
14 changes: 14 additions & 0 deletions _layouts/hw.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
layout: default
---

<div class="hw">
<h1>{{ page.title }}: {{ page.description }}</h1>
<div class="due">Due at: {{ page.due }}</div>
<!-- TODO zip file button starter code (zero fill) -->

{{ content }}

<h2>Submission</h2>
{% include submission.html gradescope_assignment_id=page.gradescope_assignment_id submission_files=page.submission_files %}
</div>
14 changes: 14 additions & 0 deletions _layouts/lab.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
layout: default
---

<div class="lab">
<h1>{{ page.title }}: {{ page.description }}</h1>
<div class="due">Due at: {{ page.due }}</div>
<!-- TODO zip file button starter code (zero fill) -->

{{ content }}

<h2>Submission</h2>
{% include submission.html gradescope_assignment_id=page.gradescope_assignment_id submission_files=page.submission_files %}
</div>
14 changes: 14 additions & 0 deletions _layouts/project.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
layout: default
---

<div class="project">
<h1>{{ page.title }}: {{ page.description }}</h1>
<div class="due">Due at: {{ page.due }}</div>
<!-- TODO zip file button starter code (zero fill) -->

{{ content }}

<h2>Submission</h2>
{% include submission.html gradescope_assignment_id=page.gradescope_assignment_id submission_files=page.submission_files %}
</div>
Loading
Loading