Skip to content

Commit b8441a9

Browse files
authored
Merge pull request #1 from Living-with-machines/dev
add census chapter and newspaper metadata notebook
2 parents 29f6910 + 3f75830 commit b8441a9

File tree

22 files changed

+5032
-0
lines changed

22 files changed

+5032
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Start from the Python 3.9
2+
FROM python:3.10-bullseye
3+
4+
# avoid warnings by switching to noninteractive - may turn off later
5+
ENV DEBIAN_FRONTEND=noninteractive
6+
7+
# install python
8+
RUN apt-get update && apt-get install -y \
9+
python3.10 \
10+
python3-pip \
11+
&& rm -rf /var/lib/apt/lists/*
12+
13+
# install GDAL
14+
15+
RUN apt-get update && apt-get install -y \
16+
libgdal-dev
17+
18+
# install pandoc, pandoc-citeproc, and dependencies for quarto
19+
RUN apt-get update && apt-get install -y --no-install-recommends \
20+
pandoc \
21+
pandoc-citeproc \
22+
curl \
23+
gdebi-core \
24+
&& rm -rf /var/lib/apt/lists/*
25+
26+
# Download and install Quarto and clean up in the same layer
27+
RUN curl -LO https://quarto.org/download/latest/quarto-linux-amd64.deb \
28+
&& dpkg --add-architecture amd64 \
29+
&& gdebi --non-interactive quarto-linux-amd64.deb \
30+
&& rm -f quarto-linux-amd64.deb
31+
32+
# set correct deno
33+
RUN curl -LO https://deno.land/install.sh && \
34+
chmod u+x install.sh && \
35+
sh install.sh -y && \
36+
rm -f install.sh
37+
38+
ENV QUARTO_DENO=/root/.deno/bin/deno
39+
40+
# install dart-sass
41+
42+
RUN curl -LO https://github.com/sass/dart-sass/releases/download/1.83.4/dart-sass-1.83.4-linux-arm64.tar.gz && \
43+
tar -xvzf dart-sass-1.83.4-linux-arm64.tar.gz && \
44+
mv dart-sass /usr/local/bin/sass && \
45+
rm -f dart-sass-1.83.4-linux-arm64.tar.gz
46+
47+
ENV QUARTO_DART_SASS=/usr/local/bin/sass/sass
48+
49+
50+
# set correct paths
51+
52+
ENV QUARTO_PANDOC=/opt/quarto/bin/tools/x86_64/pandoc
53+
ENV QUARTO_ESBUILD=/opt/quarto/bin/tools/x86_64/esbuild
54+
55+
# export QUARTO_DENO_DOM=$DENO_DOM_PLUGIN ?
56+
# export QUARTO_SHARE_PATH=$PREFIX/share/quarto ?
57+
58+
# use pip to install needed packages
59+
RUN pip install --upgrade pip
60+
RUN pip install jupyter nbclient nbformat matplotlib pandas plotly
61+
62+
# install lwm specific requirements (i.e. MapReader) -- ==TODO==
63+
# RUN pip install --no-cache-dir \
64+
# mapreader@git+https://github.com/Living-with-machines/MapReader.git@main
65+
66+
WORKDIR /workspace
67+
68+
EXPOSE 8888
69+
70+
CMD ["bash"]

.devcontainer/devcontainer.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
// name - define project name
3+
"name": "Python and Quarto Development Container",
4+
// build - wrapper for the docker build command. Builds the container whenn dev container is launched.
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
"context": "."
8+
},
9+
// Customizations including VSCode settings and extensions
10+
"customizations": {
11+
"vscode": {
12+
"settings": {
13+
"python.defaultInterpreterPath": "/usr/local/bin/python"
14+
}
15+
}
16+
},
17+
// Extensions to be installed in the dev container
18+
"extensions": [
19+
"ms-python.python",
20+
"quarto.quarto",
21+
"ms-toolsai.jupyter",
22+
"ms-toolsai.jupyter-renderers",
23+
"ms-toolsai.jupyter-keymap",
24+
"redhat.vscode-yaml",
25+
"ms-azuretools.vscode-docker"
26+
],
27+
"forwardPorts": [8888],
28+
// User to be used inside the container
29+
"remoteUser": "root",
30+
31+
// command to run on terminal after env launches
32+
"postCreateCommand": "echo 'Container Ready!'"
33+
}

.github/workflows/publish.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
on:
2+
workflow_dispatch:
3+
push:
4+
branches:
5+
- main
6+
7+
name: Quarto Publish
8+
9+
jobs:
10+
build-deploy:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
steps:
15+
- name: Check out repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Quarto
19+
uses: quarto-dev/quarto-actions/setup@v2
20+
21+
- name: Install Python and Dependencies
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.10'
25+
cache: 'pip'
26+
27+
- run: pip install jupyter
28+
29+
# - run: pip install -r requirements.txt
30+
31+
# - name: Render and Publish
32+
# uses: quarto-dev/quarto-actions/publish@v2
33+
# with:
34+
# target: gh-pages
35+
# env:
36+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.vscode/
2+
.venv/
3+
cache/
4+
book/.quarto
5+
_site
6+
docs

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Living with Machines GitHub Pages landing page
2+
3+
This repository contains the source code for the Living with Machines GitHub Pages landing page. The landing page is built using [Quarto](https://quarto.org/), an open-source scientific and technical publishing system built on top of [Pandoc](https://pandoc.org/).
4+
5+
The landing page is published at [https://living-with-machines.github.io/](https://living-with-machines.github.io/).
6+
7+
## Development
8+
9+
To build the landing page locally, you will need to install Quarto. You can do this by following the instructions in the [Quarto documentation](https://quarto.org/docs/getting-started/installation.html).
10+
11+
Once you have Quarto installed, you can build the landing page by running the following command in the root of the repository:
12+
13+
```bash
14+
quarto preview
15+
```
16+
17+
### Open as a VS Code project
18+
19+
This repository includes a `.devcontainer` directory that allows you to open the repository as a [Visual Studio Code Remote - Containers](https://code.visualstudio.com/docs/remote/containers) project. This will automatically set up a development environment with Quarto installed.
20+
21+
To open the repository as a VS Code project, follow these steps:
22+
23+
1. Install [Docker](https://www.docker.com/get-started) on your machine.
24+
25+
2. Install the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension for Visual Studio Code.
26+
27+
3. Open the repository in Visual Studio Code. (You can do this by running `code .` in the root of the repository or by cloning the repository using the "Clone Repository in Container Volume" command in the Command Palette (Ctrl+Shift+P)).
28+
29+
4. VS Code should display an alert at the bottom right of the window saying "Folder contains a dev container configuration file. Reopen folder to develop in a container". Click "Reopen in Container". If you don't see this alert, you can open the Command Palette (Ctrl+Shift+P) and run the "Dev Containers: Rebuild and Reopen in Container" command.
30+
31+
![Reopen in Container](_how-to/dev-container.png)
32+
33+
5. VS Code will now open a new window in a containerized development environment. You can now build the landing page by running the following command in VS Code's built-in terminal:
34+
35+
```bash
36+
quarto preview book
37+
```

_how-to/dev-container.png

70.3 KB
Loading

book/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.quarto/

book/_assets/images/logo.svg

Lines changed: 2 additions & 0 deletions
Loading
431 KB
Loading

book/_brand.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
color:
2+
palette:
3+
dark-grey: "#081F2C"
4+
light-grey: "#EEEBE5"
5+
orange: "#FE4F02"
6+
dark-blue: "#091E2C"
7+
light-blue: "#D5E0E3"
8+
background: light-grey
9+
foreground: dark-grey
10+
primary: black
11+
secondary: light-grey
12+
tertiary: orange
13+
14+
logo:
15+
large: "_assets/images/logo.svg"
16+
17+
typography:
18+
fonts:
19+
- family: Nunito
20+
source: google
21+
- family: Space Mono
22+
source: google
23+
base: Nunito
24+
headings: Nunito
25+
link:
26+
decoration: underline
27+
monospace: Space Mono
28+
monospace-inline:
29+
color: "#222222"
30+
background-color: "#ddeaf1" # or use a named color from `color`
31+
monospace-block:
32+
background-color: "#eef4f8"
33+
34+
defaults:
35+
bootstrap:
36+
rules: |
37+
.sidebar-link[role='navigation'] {
38+
39+
}
40+
.sidebar-item-section {
41+
42+
}

0 commit comments

Comments
 (0)