Skip to content

Commit 80a6113

Browse files
braughtgoscarlevin
andauthored
Update devcontainer, pretext and deprecated elements (#65)
**Pull Request Description** - Updates the devcontainer and pretext versions. This became necessary to do a full build with templates. - Updates matching problems to use `<cardsort>` instead of `<matches>` which has been deprecated. - Updated a Parson's problem that applied `order` to the `block` (deprecated) so that it was applied to the `premise`. Closes #115 --- **Licensing Certification** GitKit is a [Free Cultural Work](https://freedomdefined.org/Definition) and all accepted contributions are licensed as described in the LICENSE.md file. This requires that the contributor holds the rights to do so. By submitting this pull request **I certify that I satisfy the terms of the [Developer Certificate of Origin](https://developercertificate.org/)** for its contents. --------- Co-authored-by: Oscar Levin <oscar.levin@gmail.com>
1 parent 3700d04 commit 80a6113

16 files changed

Lines changed: 507 additions & 206 deletions
Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,29 @@
1-
// <!-- Managed automatically by PreTeXt authoring tools -->
2-
// (delete the above line to manage this file manually)
1+
// This file was automatically generated with PreTeXt 2.34.0.
2+
// If you modify this file, PreTeXt will no longer automatically update it.
3+
//
34
//////////////////////////////////////////////////////////////
45
//
5-
// This file provides configuration options so that a PreTeXt
6+
// This file provides configuration options so that a PreTeXt
67
// project can be edited and built using GitHub's Codespaces.
78
// It is recommended to keep this in your repository even if you
8-
// do not use this feature, as it will allow other to explore
9-
// your project easily.
10-
// This file will be automatically generated by PreTeXt with the
9+
// do not use this feature, as it will allow other to explore
10+
// your project easily.
11+
// This file will be automatically generated by PreTeXt with the
1112
// latest updates unless you remove the first comment line above.
1213
//
1314
///////////////////////////////////////////////////////////////
1415
{
15-
"name": "PreTeXt-Codespaces",
16-
17-
// This Docker image includes some LaTeX support, but is still not to large. Note that if you keep your codespace running, it will use up your GitHub free storage quota. Additional options are listed below.
18-
"image": "oscarlevin/pretext:small",
19-
// If you need to generate more complicated assets (such as sageplots) or use additional fonts when building to PDF, comment out the above line and uncomment the following line.
20-
// "image": "oscarlevin/pretext:full",
21-
// If you only intend to build for web and don't have any latex-image generated assets, you can use a smaller image:
22-
// "image": "oscarlevin/pretext:lite",
16+
// "image": "pretextbook/pretext-full:1.6", // uses latest image from https://hub.docker.com/r/PreTeXtBook/pretext-full/tags
17+
// If you don't need sagemath, you can use a smaller base image. Comment out the line above and uncomment the line below to use a smaller image.
18+
"image": "pretextbook/pretext:1.6",
19+
"features": {"ghcr.io/devcontainers/features/github-cli": {}},
2320

24-
// Add gh cli as a feature (to support codechat)
25-
"features": {
26-
"ghcr.io/devcontainers/features/github-cli:1": {}
27-
},
21+
// The pretext-full image above includes pretext, prefigure, and enough parts of latex and sagemath for most cases. Here we install additional dependencies.
22+
"postCreateCommand": {
23+
"install pandoc": "bash ./.devcontainer/installPandoc.sh",
24+
"mark repo as safe": "git config --global --add safe.directory $(pwd)"
25+
},
2826

29-
// Respect the project's designated dependencies
30-
"postCreateCommand": "pip install -r requirements.txt",
3127

3228
// Port forwarding
3329
// ---------------
@@ -60,28 +56,31 @@
6056
}
6157
},
6258

59+
6360
// Configure tool-specific properties.
6461
"customizations": {
6562
"codespaces": {
66-
"openFiles": ["source/main.ptx"]
63+
"openFiles": ["README.md"]
6764
},
6865
"vscode": {
6966
"settings": {
7067
"editor.quickSuggestions": {
7168
"other": "off"
7269
},
73-
"editor.snippetSuggestions": "top",
74-
"xml.validation.enabled": false,
70+
"editor.suggest.showProperties": false,
71+
"editor.snippetSuggestions": "bottom",
72+
"files.autoSave": "afterDelay",
73+
"xml.validation.enabled": true,
74+
"redhat.telemetry.enabled": false,
7575
"CodeChat.CodeChatServer.Command": "CodeChat_Server"
7676
},
7777
"extensions": [
78-
"ms-vscode.live-server",
7978
"oscarlevin.pretext-tools",
80-
"CodeChat.codechat"
79+
"CodeChat.codechat",
80+
"streetsidesoftware.code-spell-checker",
81+
"alpinebuster.vscode-latex-table-editor",
82+
"mathematic.vscode-pdf"
8183
]
8284
}
8385
}
84-
85-
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
86-
// "remoteUser": "root"
8786
}

.devcontainer/installPandoc.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
3+
# This file was automatically generated with PreTeXt 2.34.0.
4+
# If you modify this file, PreTeXt will no longer automatically update it.
5+
6+
wget https://github.com/jgm/pandoc/releases/download/3.8.3/pandoc-3.8.3-1-amd64.deb -O pandoc.deb
7+
8+
# wait for 60 second and then double check that no other script is using apt-get:
9+
sleep 60
10+
while fuser /var/lib/dpkg/lock >/dev/null 2>&1; do
11+
echo "Waiting for apt-get to be free..."
12+
sleep 15
13+
done
14+
# Install pandoc
15+
apt-get install -y --no-install-recommends ./pandoc.deb
16+
17+
rm pandoc.deb

.github/workflows/pretext-cli.yml

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
1-
# <!-- Managed automatically by PreTeXt authoring tools -->
2-
# (delete the above line to manage this file manually)
3-
1+
# This file was automatically generated with PreTeXt 2.34.0.
2+
# If you modify this file, PreTeXt will no longer automatically update it.
3+
#
4+
# This workflow file can be used to automatically build a project and create
5+
# an artifact for deployment. It can also be used to deploy the project to
6+
# GitHub Pages or Cloudflare Pages.
7+
#
8+
# The workflow is triggered on pull requests or can be run manually. You can uncomment
9+
# the `push` event to have it run on pushes to the main branch as well.
410
name: PreTeXt-CLI Actions
511
on:
612
# Runs on pull requests
713
pull_request:
814
branches: ["*"]
9-
# Runs on pushes to main
10-
push:
11-
branches: ["main"]
15+
## Runs on pushes to main
16+
#push:
17+
# branches: ["main"]
1218
# Runs on demand
1319
workflow_dispatch:
1420

1521
jobs:
1622
build:
1723
runs-on: ubuntu-latest
18-
container: oscarlevin/pretext:full
24+
container: oscarlevin/pretext-full
1925

2026
steps:
2127
- name: Checkout source
@@ -24,8 +30,26 @@ jobs:
2430
- name: install deps
2531
run: pip install -r requirements.txt
2632

33+
- name: set up node
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: '22'
37+
38+
- name: install local ptx files
39+
run: pretext --version
40+
2741
- name: build deploy targets
28-
run: pretext build --deploys
42+
run: |
43+
version="$(pretext --version)"
44+
major="$(echo $version | cut -d '.' -f 1)"
45+
minor="$(echo $version | cut -d '.' -f 2)"
46+
if [ "$major" -ge 2 -a "$minor" -ge 5 ]; then
47+
echo "PreTeXt version is 2.5 or greater; using new build command"
48+
pretext build --deploys
49+
else
50+
echo "PreTeXt version is less than 2.5, using old build command"
51+
pretext build
52+
fi
2953
- name: stage deployment
3054
run: pretext deploy --stage-only
3155

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# This file was automatically generated with PreTeXt 2.34.0.
2+
# If you modify this file, PreTeXt will no longer automatically update it.
3+
#
4+
5+
name: Build and Deploy
6+
on:
7+
# Currently, this workflow only runs when manually selected (the `workflow_dispatch` event).
8+
# If you would like it to run on other events, uncomment some of the lines below.
9+
10+
# # Runs on pull requests
11+
# pull_request:
12+
# branches: ["*"]
13+
14+
# # Runs on pushes to main
15+
# push:
16+
# branches: ["main"]
17+
18+
# # Runs every day at 00:00 UTC
19+
# schedule:
20+
# - cron: '0 0 * * *'
21+
22+
# Runs on demand
23+
workflow_dispatch:
24+
25+
permissions:
26+
contents: write
27+
28+
jobs:
29+
build-and-deploy:
30+
runs-on: ubuntu-latest
31+
container: oscarlevin/pretext-full
32+
33+
steps:
34+
- name: Checkout source
35+
uses: actions/checkout@v4
36+
37+
- name: set up node
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: '22'
41+
42+
- name: add gh-cli
43+
run: |
44+
apt-get update
45+
apt-get install gh jq -y
46+
47+
- name: setup git config
48+
run: |
49+
git config --global --add safe.directory $(pwd)
50+
git config user.name "${{ github.actor }} via GitHub Actions"
51+
git config user.email "${{ github.actor }}@github_actions.no_reply"
52+
53+
- name: install deps
54+
run: pip install -r requirements.txt --break-system-packages
55+
56+
- name: install local ptx files
57+
run: pretext --version
58+
59+
- name: build deploy targets
60+
run: pretext build --deploys
61+
62+
- name: run deploy
63+
run: pretext deploy --no-push
64+
65+
- name: push gh-pages branch
66+
run: git push origin gh-pages --force
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# <!-- Managed automatically by PreTeXt authoring tools -->
2-
# (delete the above line to manage this file manually)
3-
1+
# This file was automatically generated with PreTeXt 2.34.0.
2+
# If you modify this file, PreTeXt will no longer automatically update it.
3+
#
44
# Boilerplate list of files in a PreTeXt project for git to ignore
55
# ensure this file is tracked
66
!.gitignore
@@ -11,6 +11,7 @@ published
1111

1212
# don't track assets generated from source
1313
generated-assets
14+
.cache
1415

1516
# don't track the executables.ptx file
1617
executables.ptx
@@ -90,6 +91,8 @@ bh_unicode_properties.cache
9091
# https://packagecontrol.io/packages/sublime-github
9192
GitHub.sublime-settings
9293

94+
# Don't track common virtual environment directories
95+
venv/
9396

9497
# Don't include Dropbox settings and caches
9598
.dropbox

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# <!-- Managed automatically by PreTeXt authoring tools -->
2-
pretext == 2.5.2
1+
# This file was automatically generated with PreTeXt 2.34.0.
2+
pretext == 2.34.0

0 commit comments

Comments
 (0)