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

Sept1 #14

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ default: server
@# tail and awk work together to extract Jekyll regeneration messages
@# When a _notebook is detected in the log, call make convert in the background
@# Note: We use the "if ($$0 ~ /_notebooks\/.*\.ipynb/) { system(\"make convert &\") }" to call make convert
@(tail -f $(LOG_FILE) | awk '/Server address: http:\/\/0.0.0.0:$(PORT)\/$(REPO_NAME)\// { serverReady=1 } \
@(tail -f $(LOG_FILE) | awk '/Server address: http:\/\/127.0.0.1:$(PORT)\/$(REPO_NAME)\// { serverReady=1 } \
serverReady && /^ *Regenerating:/ { regenerate=1 } \
regenerate { \
if (/^[[:blank:]]*$$/) { regenerate=0 } \
Expand Down Expand Up @@ -56,7 +56,7 @@ default: server
# Start the local web server
server: stop convert
@echo "Starting server..."
@@nohup bundle exec jekyll serve -H 0.0.0.0 -P $(PORT) > $(LOG_FILE) 2>&1 & \
@@nohup bundle exec jekyll serve -H 127.0.0.1 -P $(PORT) > $(LOG_FILE) 2>&1 & \
PID=$$!; \
echo "Server PID: $$PID"
@@until [ -f $(LOG_FILE) ]; do sleep 1; done
Expand Down
98 changes: 40 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,66 +18,10 @@ Deployment Cycle. In the deplopyment cycle, `sync-github-action-review`, it is

### WSL and/or Ubuntu installation requirements
- The result of these step is Ubuntu tools to run preview server. These procedures were created using [jekyllrb.com](https://jekyllrb.com/docs/installation/ubuntu/)
- Run scripts in scripts directory of teacher repo: setup_ubuntu.sh and activate.sh. Or, follow commands below.
```bash
## WSL/Ubuntu commands
# sudo apt install, installs packages for Ubuntu
echo "=== Ugrade Packages ==="
sudo apt update
sudo apt upgrade -y
#
echo "=== Install Ruby ==="
sudo apt install -y ruby-full build-essential zlib1g-dev
#
echo "=== Install Python ==="
sudo apt-get install -y python3 python3-pip python-is-python3
#
echo "=== Install Jupyter Notebook ==="
sudo apt-get install -y jupyter-notebook

# bash commands, install user requirements.
echo "=== GitHub pages build tools ==="
export GEM_HOME="$HOME/gems"
export PATH="$HOME/gems/bin:$PATH"
echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc
echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc
echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.bashrc
echo "=== Gem install starting, thinking... ==="
gem install jekyll bundler
head -30 ./teacher/scripts/activate.sh
echo "=== !!!Start a new Terminal!!! ==="
```
- Run scripts in scripts directory of student repo: setup_ubuntu.sh and activate.sh. Expected name of the repository to run these scripts is 'student'.

### MacOs installation requirements
- Ihe result of these step are MacOS tools to run preview server. These procedures were created using [jekyllrb.com](https://jekyllrb.com/docs/installation/macos/). Run scripts in scripts directory of teacher repo: setup_macos.sh and activate_macos.sh. Or, follow commands below.
```bash
# MacOS commands
# brew install, installs packages for MacOS
echo "=== Ugrade Packages ==="
brew update
brew upgrade
#
echo "=== Install Ruby ==="
brew install chruby ruby-install xz
ruby-install ruby 3.1.3
#
echo "=== Install Python ==="
brew install python
#
echo "=== Install Jupyter Notebook ==="
brew install jupyter

# bash commands, install user requirements.
export GEM_HOME="$HOME/gems"
export PATH="$HOME/gems/bin:$PATH"
echo '# Install Ruby Gems to ~/gems' >> ~/.zshrc
echo 'export GEM_HOME="$HOME/gems"' >> ~/.zshrc
echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.zshrc
echo "=== Gem install starting, thinking... ==="
gem install jekyll bundler
head -30 ./teacher/scripts/activate.sh
echo "=== !!!Start a new Terminal!!! ==="
```
- Ihe result of these step are MacOS tools to run preview server. These procedures were created using [jekyllrb.com](https://jekyllrb.com/docs/installation/macos/). Run scripts in scripts directory of student repo: setup_macos.sh and activate_macos.sh. Expected name of the repository to run these scripts is 'student'.

### Preview
- The result of these step is server running on: http://0.0.0.0:4100/teacher/. Regeneration messages will run in terminal on any save. Press the Enter or Return key in the terminal at any time to enter commands.
Expand Down Expand Up @@ -122,3 +66,41 @@ bundle install
```bash
make convert
```
### Meta Data (Front Matter)
- Meta data also known as front matter is a set of key value pairs that can provide additional information to github pages about .md and .ipynb files. This can and probably will be used in other file types (ie doc, pdf), if we added them to the system.

- In the front matter you can also define things like a title and description for the page. Additional front matter is defined to place content on "Computer Science Lab Notebook" page. The `courses:` key will place data on a specific page with the nested `week:` placing data on a specific row on the page. The `type:` key in front matter will place blog under the plans, hacks(ToDo), and tangibles column.

- In our files the front matter is defined at the top of the page or the first markdown cell.

- First open one of the .md or .ipynb files already included in either your _posts folder or your _notebooks folder.

- In the .md file you should notice something similar to this at the top of the page. To see this in your .ipynb files you will need to double click the markdown cell at the top of the file.

```yaml
---
toc: true
comments: false
layout: post
title: Daily Plan Sample
description: Example Blog!!! This shows planning and notes from hacks.
type: plans
courses: { compsci: {week: 0} }
---
```

- Front matter will always have '---' at the top and bottom to distinguish it and each key value pair will be separated by a ':'.

- Here we can modify things like the title and description.

- The type value will tells us which column this is going to appear under, supported values: `plans`, `hacks`, `tangibles`.

- The courses tells us which menu item it will be under, in this case the `compsci` menu, and the `week` tells it what row (week) it will appear under that menu.

- In our examples, hacks(ToDo) contains references to our IPYNB files; these are stored in GitHub under the `_notebooks` folder. The plans and tangibles contains references to our MD files; these are stored in GitHub under the `_posts` folder.

- Key files in Computer Science Lab Notebook
- `compsci.md` - this is the "Computer Science Lab Notebook" page and is the link `https://nighthawkcoders.github.io/student/compsci`. It contains the Title and Number of units on the page.
- `_data/compsci.yml` - this contains the supporting data that helps organize the units on the page.
- `_layouts`\schedule.html - this contains code, in the Liquid language, that generates the HTML for all the rows and columns.
- fyi, the schedule.html could work for another type of page. For instance, you could make a csa.md, _data/csa.yml, and tag files with `csa: {week: 0}` under courses.
5 changes: 3 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ description: "August 2023 to June 2024"
owner_name: Nighthawk Coders
github_username: nighthawkcoders
baseurl: "/student"
remote_theme: pages-themes/midnight@v0.2.0
# remote_theme: pages-themes/[email protected]
remote_theme: pages-themes/modernist@v0.2.0
#remote_theme: pages-themes/[email protected]
# remote_theme: pages-themes/[email protected]
# remote_theme: pages-themes/[email protected]
# remote_theme: pages-themes/[email protected]
# remote_theme: pages-themes/[email protected]
plugins:
- jekyll-remote-theme
future: true

Empty file added _data/compsci.yml
Empty file.
5 changes: 2 additions & 3 deletions _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
<nav>
<ul>
<li class="fork"><a href="{{site.baseurl}}/">Home</a></li>
<li class="fork"><a href="{{site.baseurl}}/csse">CSSE</a></li>
<li class="fork"><a href="{{site.baseurl}}/csp">CSP</a></li>
<li class="fork"><a href="{{site.baseurl}}/csa">CSA</a></li>
<li class="fork"><a href="{{site.baseurl}}/compsci">CompSci</a></li>
<li class="fork"><a href="{{site.baseurl}}/blogs">Blogs</a></li>
<li class="title"><a href="{{site.baseurl}}/help">Help</a></li>
<li class="title"><a href="{{ site.github.repository_url }}#readme">View On GitHub</a></li>
</ul>
</nav>
Expand Down
9 changes: 9 additions & 0 deletions _includes/help_list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div class="Box box-shadow-medium rounded-1 col-12">
<div class="col-8 d-table-cell p-3">
<h3>
<a class="post-link" href="{{ post.url | relative_url }}">
{{ post.title | escape }}
</a>
</h3>
</div>
</div>
55 changes: 55 additions & 0 deletions _layouts/help.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
layout: default
---

<div class="home">
{%- if page.title -%}
<h1 class="page-heading">{{ page.title }}</h1>
{%- endif -%}

{{ content | markdownify }}


{% if site.paginate %}
{% assign rawposts = paginator.posts %}
{% else %}
{% assign rawposts = site.posts %}
{% endif %}

<!-- Hide posts if front matter flag hide:true -->
{% assign posts = ''|split:'' %}
{% for post in rawposts %}
{% if post.type == "help" %}
{% assign posts = posts|push:post%}
{% endif %}
{% endfor %}

<!-- Sort posts by rank, then date -->
{% assign grouped_posts = posts | group_by: "sticky_rank" | sort: "name", "last" %}
{% assign sticky_posts = ''|split:'' %}
{% assign non_sticky_posts = '' | split:'' %}


{% for gp in grouped_posts %}
{%- if gp.name == "" -%}
{% assign non_sticky_posts = gp.items | sort: "date" | reverse %}
{%- else %}
{% assign sticky_posts = sticky_posts | concat: gp.items %}
{%- endif -%}
{% endfor %}

<!-- Assemble final sorted posts array -->
{% assign sticky_posts = sticky_posts | sort: "sticky_rank", "last" %}
{% assign posts = sticky_posts | concat: non_sticky_posts %}

{%- if posts.size > 0 -%}
<ul class="post-list">
{%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%}
{%- for post in posts -%}
<li>
{%- include help_list.html -%}
</li>
{%- endfor -%}
</ul>

{%- endif -%}
Loading