#!/bin/bash set -e echo "⚠️ WARNING: This is a temporary solution only ⚠️" echo "Downloading pre-built WebAssembly files from TikZJax (DOES NOT INCLUDE TCOLORBOX)" echo "These files will only work with our BoxJax.js transformation approach" # Create directory structure mkdir -p ../../static/js/boxjax # Download WebAssembly files from a working TikZJax installation echo "Downloading tex.wasm..." curl -L -o ../../static/js/boxjax/tex.wasm https://unpkg.com/tikzjax@latest/dist/tex.wasm echo "Downloading core.dump.gz..." curl -L -o ../../static/js/boxjax/core.dump.gz https://unpkg.com/tikzjax@latest/dist/core.dump.gz # Build the BoxJax JavaScript echo "Building BoxJax JavaScript with tcolorbox-to-TikZ transformation..." npm run build # Copy the JavaScript and CSS files echo "Copying files to the static/js/boxjax directory..." cp public/boxjax.js ../../static/js/boxjax/ cp fonts.css ../../static/js/boxjax/ echo "Done! Files have been deployed to /static/js/boxjax/" echo "" echo "IMPORTANT: These WebAssembly files DO NOT contain tcolorbox support." echo "BoxJax.js will convert tcolorbox to TikZ nodes as a temporary solution." echo "For full tcolorbox support, you need to build custom WebAssembly files."