diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4e2f33c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +src/KaTeX/* diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 093195d..0000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "src/KaTeX"] - path = src/KaTeX - url = https://github.com/KaTeX/KaTeX.git - shallow = true diff --git a/Makefile b/Makefile index b0de4ab..76c2828 100644 --- a/Makefile +++ b/Makefile @@ -6,10 +6,10 @@ # Build KaTeX. all: set -e - git submodule update --init --recursive - cd src/KaTeX - yarn - yarn build + curl -L -O "https://github.com/KaTeX/KaTeX/releases/download/v0.12.0/katex.zip" + unzip katex.zip + rm katex.zip + mv katex src/KaTeX # Update the `dev` branch from `master`. dev: @@ -55,7 +55,6 @@ gh-pages: # for `subtree split` later, which has to iterate through the entire history of the branch. git reset $$TAIL git add -A - git rm -r --cached src/KaTeX git commit -m "Add release branch" # Split off the `src/` directory into its own branch. RELEASE=$$(git subtree split --prefix=src) @@ -65,7 +64,6 @@ gh-pages: git checkout -b squashed git reset $$TAIL git add -A - git rm -r --cached src/KaTeX git commit -m "Add dev branch" DEV=$$(git subtree split --prefix=src) @@ -77,23 +75,6 @@ gh-pages: # Reset the GitHub Pages branch so that it contains the release source code. git reset --hard $$RELEASE - # Clone the existing version of KaTeX into the worktree. - git clone $$KATEX KaTeX - # We are assuming KaTeX has already been built. - # Remove `.git` and associated files, so KaTeX is no longer recognised as a git repository. - cd KaTeX - rm -rf .git - rm .gitignore - rm .gitmodules - # We need to be able to commit KaTeX as a plain directory, so we have to unregister it as a - # submodule. The cloned repository by default won't contain any `.gitignore`d files, but we - # actually want the `dist/`, directory, which contains various resources, e.g. fonts, so we copy - # it across ourselves. - cp -r $$KATEX/dist . - cd ../ - git add -A - git commit -m "Add KaTeX" - # Merge the development branch into the `dev/` directory. git merge -s ours --no-commit $$DEV git read-tree --prefix=dev -u $$DEV diff --git a/README.md b/README.md index 6670d5f..b3013f9 100644 --- a/README.md +++ b/README.md @@ -82,21 +82,12 @@ Currently, macros may be defined using `\newcommand`, and colours may be defined `\definecolor` (using the colour modes: `rgb`, `RGB` or `gray`). ## Building -Make sure you have [installed yarn](https://yarnpkg.com/lang/en/docs/install/) and have a version of -Make that supports `.ONESHELL` (e.g. GNU Make 3.82). +Run `make` from the command land, and then open `src/index.html` in your favourite web browser. -Clone the repository, and run -```shell -make -``` -which will build KaTeX. Then simply open `src/index.html` in your favourite web browser. - -**Note for macOS users:** the default version of Make on macOS is GNU Make 3.81, which does not -contain support for `.ONESHELL`. You may need to update Make to run the Makefile. - -**Note for Ubuntu users:** the cmdtest package that comes with Ubuntu conflicts with the yarn -installation. You may need to [uninstall cmdtest](https://github.com/varkor/quiver/issues/48) to -install yarn. +If this fails, you might be using an incompatible version of Make or Bash. In this case, you can +manually download the [latest release](https://github.com/KaTeX/KaTeX/releases) of KaTeX and place +it under `src/` as `src/KaTeX/`. Then open `src/index.html` in your favourite web browser. If KaTeX +has not been given the correct path, you will get an error telling you that KaTeX failed to load. If you have any other problems building **quiver**, [open an issue](https://github.com/varkor/quiver/issues/new) detailing the problem and I'll try to help. diff --git a/src/.gitmodules b/src/.gitmodules deleted file mode 100644 index 2240c37..0000000 --- a/src/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -# [submodule "MathJax"] -# path = MathJax -# url = https://github.com/mathjax/MathJax.git -[submodule "KaTeX"] - path = KaTeX - url = https://github.com/KaTeX/KaTeX.git \ No newline at end of file diff --git a/src/ui.js b/src/ui.js index 78c7b06..ec6fd5e 100644 --- a/src/ui.js +++ b/src/ui.js @@ -6595,7 +6595,7 @@ document.addEventListener("DOMContentLoaded", () => { // Immediately load the KaTeX library. const rendering_library = new DOM.Element("script", { type: "text/javascript", - src: "KaTeX/dist/katex.js", + src: "KaTeX/katex.min.js", }).listen("error", () => { // Handle KaTeX not loading (somewhat) gracefully. UI.display_error(`KaTeX failed to load.`) @@ -6614,14 +6614,14 @@ document.addEventListener("DOMContentLoaded", () => { // Load the style sheet needed for KaTeX. document.head.appendChild(new DOM.Element("link", { rel: "stylesheet", - href: "KaTeX/dist/katex.css", + href: "KaTeX/katex.css", }).element); // Preload various fonts to avoid flashes of unformatted text. const preload_fonts = ["Main-Regular", "Math-Italic"]; for (const font of preload_fonts) { const attributes = { rel: "preload", - href: `KaTeX/dist/fonts/KaTeX_${font}.woff2`, + href: `KaTeX/fonts/KaTeX_${font}.woff2`, as: "font" }; if (window.location.hostname !== "") {