diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 46a74fc..f25d779 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,4 +1,4 @@ -// This file was automatically generated with PreTeXt 2.17.1. +// This file was automatically generated with PreTeXt 2.24.0. // If you modify this file, PreTeXt will no longer automatically update it. // ////////////////////////////////////////////////////////////// @@ -13,15 +13,16 @@ // /////////////////////////////////////////////////////////////// { - "image": "mcr.microsoft.com/devcontainers/universal:2", - "features": {}, + "image": "pretextbook/pretext-full:1.2", // uses latest image from https://hub.docker.com/r/PreTeXtBook/pretext-full/tags + // 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. + // "image": "pretextbook/pretext:1.2", + "features": {"ghcr.io/devcontainers/features/github-cli": {}}, - // Comment or uncomment lines below if you don't or do need that feature. + // The pretext-full image above includes pretext, prefigure, and enough parts of latex and sagemath for most cases. If there are errors with sage, you can install the full sagemath package through Conda by running ./.devcontainer/installSage.sh, or uncommenting that line and rebuilding the container. "postCreateCommand": { - "install sagemath": "bash ./.devcontainer/installSage.sh", - // "install pandoc": "bash ./.devcontainer/installPandoc.sh", - "install latex": "bash ./.devcontainer/installLatex.sh", - "install pretext": "bash ./.devcontainer/installPretext.sh", + "install pandoc": "bash ./.devcontainer/installPandoc.sh", + "update requirements": "pip install -r requirements.txt", + "generate codechat": "pretext init -f codechat_config.yaml", "mark repo as safe": "git config --global --add safe.directory $(pwd)" }, @@ -68,13 +69,17 @@ "editor.quickSuggestions": { "other": "off" }, - "editor.snippetSuggestions": "top", - "xml.validation.enabled": false, + "files.autoSave": "onFocusChange", + "editor.snippetSuggestions": "bottom", + "xml.validation.enabled": true, + "redhat.telemetry.enabled": false, "CodeChat.CodeChatServer.Command": "CodeChat_Server" }, "extensions": [ "oscarlevin.pretext-tools", - "CodeChat.codechat" + "CodeChat.codechat", + "streetsidesoftware.code-spell-checker", + "alpinebuster.vscode-latex-table-editor" ] } } diff --git a/.devcontainer/installLatex.sh b/.devcontainer/installLatex.sh deleted file mode 100644 index 6f7eb92..0000000 --- a/.devcontainer/installLatex.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -# This file was automatically generated with PreTeXt 2.17.1. -# If you modify this file, PreTeXt will no longer automatically update it. - -# We use TinyTeX (https://yihui.org/tinytex/) -wget -qO- "https://yihui.org/tinytex/install-bin-unix.sh" | sh - -tlmgr install adjustbox amscdx bold-extra braket bussproofs cancel carlisle cases chessfss circuitikz colortbl enumitem extpfeil fontawesome5 fontaxes gensymb imakeidx jknapltx kastrup lambda-lists listings listingsutf8 marvosym mathalpha mathtools menukeys mhchem microtype musicography newpx newtx nicematrix pdfcol pdfpages pdflscape pgfplots phaistos physics polyglossia pstricks realscripts relsize siunitx skak skaknew smartdiagram snapshot stmaryrd tcolorbox tikzfill titlesec txfonts ulem upquote was xfrac xltxtra xpatch xstring - -tlmgr path add - -# Ensure fonts provided by TinyTeX are available, as suggested in the pretext guide -fontconfig=" - - - ~/.TinyTeX/texmf-dist/fonts - ~/.TinyTeX/texmf-local/fonts -" - -fontconfig_path="/etc/fonts/conf.d/09-texlive-fonts.conf" -if [ ! -f "$fontconfig_path" ]; then - echo "Creating fontconfig file at $fontconfig_path" - echo "$fontconfig" | sudo tee "$fontconfig_path" > /dev/null -else - echo "Fontconfig file already exists at $fontconfig_path" -fi -# Update font cache -fc-cache -f -v \ No newline at end of file diff --git a/.devcontainer/installPandoc.sh b/.devcontainer/installPandoc.sh index c87a43f..8ea81b6 100644 --- a/.devcontainer/installPandoc.sh +++ b/.devcontainer/installPandoc.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# This file was automatically generated with PreTeXt 2.17.1. +# This file was automatically generated with PreTeXt 2.24.0. # If you modify this file, PreTeXt will no longer automatically update it. wget https://github.com/jgm/pandoc/releases/download/3.6.4/pandoc-3.6.4-1-amd64.deb -O pandoc.deb diff --git a/.devcontainer/installPretext.sh b/.devcontainer/installPretext.sh deleted file mode 100644 index 07b6892..0000000 --- a/.devcontainer/installPretext.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -# This file was automatically generated with PreTeXt 2.17.1. -# If you modify this file, PreTeXt will no longer automatically update it. - -sudo apt-get update -sudo apt-get install -y --no-install-recommends \ - python3-louis \ - libcairo2-dev \ - librsvg2-bin - -pip install --upgrade pip --break-system-packages - -pip install pretext[homepage,prefigure] --only-binary {greenlet} --break-system-packages - -pip install codechat-server --break-system-packages - -playwright install-deps - -playwright install - -# Install mermaid for diagrams -npm install -g @mermaid-js/mermaid-cli - -# echo '/usr/lib/python3/dist-packages' > /usr/local/lib/python3.8/dist-packages/louis.pth - -prefig init diff --git a/.devcontainer/installSage.sh b/.devcontainer/installSage.sh deleted file mode 100644 index 7166c09..0000000 --- a/.devcontainer/installSage.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -# This file was automatically generated with PreTeXt 2.17.1. -# If you modify this file, PreTeXt will no longer automatically update it. - -# Conda should already be installed in the codespace. We need to add the conda-forge channel - -conda config --add channels conda-forge -conda config --set channel_priority strict - -# We don't want conda to open the base environment always: -conda config --set auto_activate_base false - -# Now create a conda environment for sage (called sage): -conda create --yes -n sage sage python=3.12 - -conda init - -echo 'conda activate sage' >> ~/.bashrc - -eval "$('conda' 'shell.bash' 'hook' 2> /dev/null)" -conda activate sage diff --git a/.github/workflows/pretext-cli.yml b/.github/workflows/pretext-cli.yml index 64eeec4..27dc114 100644 --- a/.github/workflows/pretext-cli.yml +++ b/.github/workflows/pretext-cli.yml @@ -1,4 +1,4 @@ -# This file was automatically generated with PreTeXt 2.17.1. +# This file was automatically generated with PreTeXt 2.24.0. # If you modify this file, PreTeXt will no longer automatically update it. # # This workflow file can be used to automatically build a project and create @@ -21,29 +21,37 @@ on: jobs: build: runs-on: ubuntu-latest + container: oscarlevin/pretext-full steps: - name: Checkout source uses: actions/checkout@v4 - - name: Install the things - run: | - bash ./.devcontainer/installSage.sh - bash ./.devcontainer/installLatex.sh - bash ./.devcontainer/installPretext.sh - git config --global --add safe.directory $(pwd) + - name: install deps + run: pip install -r requirements.txt + + - name: set up node + uses: actions/setup-node@v4 + with: + node-version: '22' + + - name: install local ptx files + run: pretext --version - name: build deploy targets run: | - eval "$('conda' 'shell.bash' 'hook' 2> /dev/null)" - conda activate sage - pretext build --deploys - + version="$(pretext --version)" + major="$(echo $version | cut -d '.' -f 1)" + minor="$(echo $version | cut -d '.' -f 2)" + if [ "$major" -ge 2 -a "$minor" -ge 5 ]; then + echo "PreTeXt version is 2.5 or greater; using new build command" + pretext build --deploys + else + echo "PreTeXt version is less than 2.5, using old build command" + pretext build + fi - name: stage deployment - run: | - eval "$('conda' 'shell.bash' 'hook' 2> /dev/null)" - conda activate sage - pretext deploy --stage-only + run: pretext deploy --stage-only - name: Bundle output/stage as artifact uses: actions/upload-artifact@v4 diff --git a/.github/workflows/pretext-deploy.yml b/.github/workflows/pretext-deploy.yml index 1a86526..8762c99 100644 --- a/.github/workflows/pretext-deploy.yml +++ b/.github/workflows/pretext-deploy.yml @@ -1,4 +1,4 @@ -# This file was automatically generated with PreTeXt 2.17.1. +# This file was automatically generated with PreTeXt 2.24.0. # If you modify this file, PreTeXt will no longer automatically update it. # @@ -28,12 +28,17 @@ permissions: jobs: build-and-deploy: runs-on: ubuntu-latest - container: oscarlevin/pretext:small + container: pretextbook/pretext-full:1.2 steps: - name: Checkout source uses: actions/checkout@v4 + - name: set up node + uses: actions/setup-node@v4 + with: + node-version: '22' + - name: add gh-cli run: | apt-get update @@ -61,4 +66,3 @@ jobs: run: git push origin gh-pages --force env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - \ No newline at end of file diff --git a/.gitignore b/.gitignore index dc41491..1506287 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -# This file was automatically generated with PreTeXt 2.17.1. +# This file was automatically generated with PreTeXt 2.24.0. # If you modify this file, PreTeXt will no longer automatically update it. # # Boilerplate list of files in a PreTeXt project for git to ignore diff --git a/requirements.txt b/requirements.txt index dd9ebea..ed67648 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -# This file was automatically generated with PreTeXt 2.17.1. -pretext == 2.17.1 +# This file was automatically generated with PreTeXt 2.24.0. +pretext == 2.24.0