Initial commit
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
// This file was automatically generated with PreTeXt 2.32.0.
|
||||
// If you modify this file, PreTeXt will no longer automatically update it.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////
|
||||
//
|
||||
// This file provides configuration options so that a PreTeXt
|
||||
// project can be edited and built using GitHub's Codespaces.
|
||||
// It is recommended to keep this in your repository even if you
|
||||
// do not use this feature, as it will allow other to explore
|
||||
// your project easily.
|
||||
// This file will be automatically generated by PreTeXt with the
|
||||
// latest updates unless you remove the first comment line above.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////
|
||||
{
|
||||
"image": "pretextbook/pretext-full:1.5", // 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.5",
|
||||
"features": {"ghcr.io/devcontainers/features/github-cli": {}},
|
||||
|
||||
// The pretext-full image above includes pretext, prefigure, and enough parts of latex and sagemath for most cases. Here we install additional dependencies.
|
||||
"postCreateCommand": {
|
||||
"install pandoc": "bash ./.devcontainer/installPandoc.sh",
|
||||
"mark repo as safe": "git config --global --add safe.directory $(pwd)"
|
||||
},
|
||||
|
||||
|
||||
// Port forwarding
|
||||
// ---------------
|
||||
// This is needed by the CodeChat Server.
|
||||
"forwardPorts": [
|
||||
// The port used for a Thrift connection between the VSCode CodeChat
|
||||
// extension and the CodeChat Server.
|
||||
27376,
|
||||
// The port used for an HTTP connection from the CodeChat Client to
|
||||
// the CodeChat Server.
|
||||
27377,
|
||||
// The port used by a websocket connection between the CodeChat
|
||||
// Server and the CodeChat Client.
|
||||
27378
|
||||
],
|
||||
// See the [docs](https://containers.dev/implementors/json_reference/#port-attributes).
|
||||
"portsAttributes": {
|
||||
"27376": {
|
||||
"label": "VSCode extension <-> CodeChat Server",
|
||||
"requireLocalPort": true
|
||||
},
|
||||
"27377": {
|
||||
"label": "CodeChat Client",
|
||||
"requireLocalPort": true
|
||||
},
|
||||
"27378": {
|
||||
"label": "CodeChat Client<->Server websocket",
|
||||
"requireLocalPort": true
|
||||
// This port needs to be public; however, there's no way to specify port visibility here. See `server.py` in the CodeChat Server for details.
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// Configure tool-specific properties.
|
||||
"customizations": {
|
||||
"codespaces": {
|
||||
"openFiles": ["README.md"]
|
||||
},
|
||||
"vscode": {
|
||||
"settings": {
|
||||
"editor.quickSuggestions": {
|
||||
"other": "off"
|
||||
},
|
||||
"files.autoSave": "afterDelay",
|
||||
"editor.snippetSuggestions": "bottom",
|
||||
"xml.validation.enabled": true,
|
||||
"redhat.telemetry.enabled": false,
|
||||
"CodeChat.CodeChatServer.Command": "CodeChat_Server"
|
||||
},
|
||||
"extensions": [
|
||||
"oscarlevin.pretext-tools",
|
||||
"CodeChat.codechat",
|
||||
"streetsidesoftware.code-spell-checker",
|
||||
"alpinebuster.vscode-latex-table-editor",
|
||||
"mathematic.vscode-pdf"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This file was automatically generated with PreTeXt 2.19.3.
|
||||
# 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 makeindex 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 tikz-cd 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="<?xml version=\"1.0\"?>
|
||||
<!DOCTYPE fontconfig SYSTEM \"fonts.dtd\">
|
||||
<fontconfig>
|
||||
<dir>~/.TinyTeX/texmf-dist/fonts</dir>
|
||||
<dir>~/.TinyTeX/texmf-local/fonts</dir>
|
||||
</fontconfig>"
|
||||
|
||||
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
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This file was automatically generated with PreTeXt 2.32.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
|
||||
|
||||
# wait for 60 second and then double check that no other script is using apt-get:
|
||||
sleep 60
|
||||
while fuser /var/lib/dpkg/lock >/dev/null 2>&1; do
|
||||
echo "Waiting for apt-get to be free..."
|
||||
sleep 15
|
||||
done
|
||||
# Install pandoc
|
||||
sudo apt-get install -y --no-install-recommends ./pandoc.deb
|
||||
|
||||
rm pandoc.deb
|
||||
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This file was automatically generated with PreTeXt 2.19.3.
|
||||
# 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] pycairo --only-binary {greenlet} --break-system-packages
|
||||
|
||||
pip install codechat-server --break-system-packages
|
||||
|
||||
playwright install-deps
|
||||
|
||||
playwright install
|
||||
|
||||
|
||||
# echo '/usr/lib/python3/dist-packages' > /usr/local/lib/python3.8/dist-packages/louis.pth
|
||||
prefig init
|
||||
|
||||
# Install mermaid for diagrams
|
||||
npm install -g @mermaid-js/mermaid-cli
|
||||
|
||||
echo "PreTeXt installation complete."
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This file was automatically generated with PreTeXt 2.32.0.
|
||||
# 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
|
||||
|
||||
source ~/.bashrc
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
# This file was automatically generated with PreTeXt 2.32.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
|
||||
# ensure this file is tracked
|
||||
!.gitignore
|
||||
|
||||
# don't track unpublished builds or stage (note: Runestone uses `published`)
|
||||
output
|
||||
published
|
||||
|
||||
# don't track assets generated from source
|
||||
generated-assets
|
||||
.cache
|
||||
|
||||
# don't track the executables.ptx file
|
||||
executables.ptx
|
||||
|
||||
# don't track node packages
|
||||
node_modules
|
||||
|
||||
# don't track error logs
|
||||
.error_schema.log
|
||||
logs
|
||||
|
||||
# don't track OS related files (windows/macos/linux)
|
||||
.DS_Store
|
||||
.DS_Store?
|
||||
._*
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
Icon
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
Thumbs.db
|
||||
Thumbs.db:encryptable
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
*.stackdump
|
||||
*.lnk
|
||||
*.cab
|
||||
*.msi
|
||||
*.msix
|
||||
*.msm
|
||||
*.msp
|
||||
[Dd]esktop.ini
|
||||
.directory
|
||||
.fuse_hidden*
|
||||
.Trash-*
|
||||
.nfs*
|
||||
|
||||
# Don't include VSCode generated files
|
||||
.vscode
|
||||
*.code-workspace
|
||||
|
||||
# Don't inlucde SublimeText files
|
||||
# Cache files for Sublime Text
|
||||
*.tmlanguage.cache
|
||||
*.tmPreferences.cache
|
||||
*.stTheme.cache
|
||||
|
||||
# Workspace files are user-specific
|
||||
*.sublime-workspace
|
||||
|
||||
# Project files should be checked into the repository, unless a significant
|
||||
# proportion of contributors will probably not be using Sublime Text
|
||||
*.sublime-project
|
||||
|
||||
# SFTP configuration file
|
||||
sftp-config.json
|
||||
sftp-config-alt*.json
|
||||
|
||||
# Package control specific files
|
||||
Package Control.last-run
|
||||
Package Control.ca-list
|
||||
Package Control.ca-bundle
|
||||
Package Control.system-ca-bundle
|
||||
Package Control.cache/
|
||||
Package Control.ca-certs/
|
||||
Package Control.merged-ca-bundle
|
||||
Package Control.user-ca-bundle
|
||||
oscrypto-ca-bundle.crt
|
||||
bh_unicode_properties.cache
|
||||
|
||||
# Sublime-github package stores a github token in this file
|
||||
# https://packagecontrol.io/packages/sublime-github
|
||||
GitHub.sublime-settings
|
||||
|
||||
# Don't track common virtual environment directories
|
||||
venv/
|
||||
|
||||
# Don't include Dropbox settings and caches
|
||||
.dropbox
|
||||
.dropbox.attr
|
||||
.dropbox.cache
|
||||
|
||||
# Don't track codechat config (will be generated automatically)
|
||||
codechat_config.yaml
|
||||
|
||||
# Don't track deprecated workflows
|
||||
.github/workflows/deploy.yml
|
||||
.github/workflows/test-build.yml
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2025 Oscar Levin
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,29 @@
|
||||
# PreTeXt Codespace
|
||||
|
||||
Use this template repository to quickly start a new [PreTeXt](https://pretextbook.org) project entirely in the cloud, using GitHub Codespaces.
|
||||
|
||||
## Instructions
|
||||
|
||||
Look for the green button at the very top right of this page. The button should say `Use this template` (if not make sure you are logged in to GitHub).
|
||||
|
||||
Click on the button and select "Create a new repository". On the next page, give your project a name, select public or private (this can be changed later), and click the "Create repository from template" button.
|
||||
|
||||
You now have a GitHub repository saved in your account. You can come back to that page any time you want to work on your project (note the URL or else find it in the list of your repositories when you log in to GitHub).
|
||||
|
||||
To start work on your project, go to the green button at the top of *your* repository's page, which will say `<> Code`.
|
||||
|
||||
1. Click on this button.
|
||||
2. Click on the tab that says "Codespaces."
|
||||
3. Click "Create codespace on main."
|
||||
|
||||
This will open a new tab with a browser version of VS Code including everything set up to start working. (When you first create a codespace for a project, it may take 5-10 minutes; when you restart a codespace it will be much faster). The first thing you should do is create a new PreTeXT project.
|
||||
|
||||
### Creating a New Project
|
||||
|
||||
1. Open the command palette by hitting `Ctrl+Shift+P` (or `F1`) and start typing "pretext new". You will see a command titled "PreTeXt: New Project".
|
||||
2. Hit `Enter` and select what sort of project you would like to create.
|
||||
3. Select the current suggested folder for the location of your project.
|
||||
|
||||
The window should reload and you will have your project there. This readme will be gone, but you will get a new one with some new hints.
|
||||
|
||||
Next time you want to work on your book, return to your newly created repository, go to the green `<> Code` button, and select the codespace you previously created. If you don't see that codespace (perhaps you deleted it to save space), you can always create a new codespace.
|
||||
Reference in New Issue
Block a user