Hosting locally

Windows :( (the very stupid way)

Getting the code

To run Cooking locally, we first need to get the source code. You can do this in one of two ways: Either download it directly, or clone the repository. Note that if you choose to download, you will have to do so again if any major updates drop. But I don't really have plans for more updates so it's probably better to do this.

I'm going to assume that if you're gonna clone the repository you're familiar with how to do that. If not, then I suggest following the Github guide. So instead, I'll show you how to download the source code as a zip file.

Firstly, go to the Github repository.

repopage

Now, click the code button and press Download ZIP. This should download a ZIP file which I assume you should be able to extract.

downloadzip1
downloadzip2

Yippee!! Now you should have a zip file of the source code. Now, you should use an file extracting tool (e.g. WinRAR) to extract it somewhere. Please note where you've extracted it to as this will be used in the later steps!

Installing Cygwin

Now, this is the hard part. Windows is kinda sucky in that it doesn't have a Unix-like environment. So we need to get one, and the way we do this is via Cygwin

So, let's navigate to the Cygwin page.

cygwin

Now, download the setup executable and run it.

cygwin2

This is fr the part where things can go wrong, so please read this very carefully!

Follow the instructions of the installer. Use the defaults for all the options. However, STOP when its finished downloading the minimal setup for Cygwin. You should see something similar to this. Please make sure you haven't skipped past this page! If you have, abort the installation and start again.

cygwinpackages

Awesome! If you see something similar to this page, you're on track! Now, click the Pending button (next to View) and change it to Full. Then, in the search bar, type in texlive.

I know I said all this is really important, but this part is really really important fr (trust). We are now going to select the following packages.

texlive, texlive-collection-binextra, texlive-collection-latex, texlive-collection-latexextra

Each of these packages are essential for the program to work. Make sure to select them all, and ensure you've chosen the same version for each of the packages. As far as I'm concerned, the version starting with '2024' works.

Now you can click the Next button at the bottom right.

Let the Cygwin installer cook for a bit. You should be all good now! Hopefully, you have a Cygwin terminal which has all the necessary texlive packages. It should also have python installed by default. If not, re-run the setup installer, and add the python and python-pip packages.

Pip dependencies

Cooking is essentially a Flask app, so we need to install Flask in our Cygwin environment.

Open up the Cygwin terminal(NOT the default Windows terminal), and cd (change directory) into the file directory of the repository. For example, If I extracted the repository to Downloads/Cooking-main (also, extracting can also add extra folders, so make sure you're in the right one! We want the one where app.py is inside it.), and my username is edwar, then I would execute the following command in Cygwin:

cd /cygdrive/c/Users/edwar/Downloads/Cooking-main/

If you can't find your user, then in the Cygwin terminal, run the following command and note the output.

ls /cygdrive/c/Users/

If you've done this correctly, then you should be in the repository directory in the Cygwin terminal. Yippee!

Now, we're going to install the pip dependencies. If it says that pip isn't a command, then you need to re-run the setup installer as mentioned above. Else, please run the following command:

pip install -r requirements.txt

Running locally

Now for the moment of truth!!!! In the same Cygwin terminal(or after cd'ing to the same directory), run this command:

flask run

If all has gone well, it should look something like this (photo taken in Linux):

flaskrun

Open that link (http://127.0.0.1:5000) and tada! It's cooking.toomwn.xyz, but running on your computer! This should make it much more faster than the one online, since it's using your (presumably) good computer's resources, as opposed to the horrendous CPU and RAM I've given it. Enjoy cooking up some spicy pdfs!

Windows (the intellectual method (might be bigger file size but oh well))

For this method (the intellectual, smarter method), we are going to use the prepared Docker image that is automatically built by the Github repository. But to actually use this image, we are going to install Docker Desktop!

First, search up 'Docker desktop download' or something like that and navigate to the download page for Docker Desktop. Just FYI, all the images I'm gonna use have been taken on a Linux environment, because I really can't be bothered to pull up my virtual machine.
dockerdesktopdownload

Note that you should download the Docker Desktop version that is compatible with your Windows computer's infrastructure! Generally, this is gonna be x86-64. Unless you're a bit crazy.

Next, follow the instructions to install Docker Desktop. Use the recommended settings.

You can skip making an account, because it's not actually that necessary. Just skip all the survey things and you should be looking at something similar to this:

dockerimagepage

Ok, poggies! Now, press Ctrl+K to access the search. Then, type in edditheeed/cooking. You should see something like this.

dockerlookup

We are going to pull the image from edditheeed/cooking. Make sure it's the latest one! (It will say 'latest') If you want to get the latest version, you will have to pull the latest image.

pulldockerimage

If you're successful, you should see something like this.

successfulpullingfrnocap

If you're reached this stage then tada! You now can run cooking.toomwn.xyz on your computer! Press the Run button and configure the optional settings.

runcontainer
example

After running the container, you should see something like this. Press the 2nd link from the top (which should be http://localhost:{ the 4 numbers you typed}), eg. http://localhost:6969.

opencontainerlink

Lo and behold, if all has gone well, you should be looking at your very own cooking.toomwn.xyz, hosted on your computer!

cookinglocally

Now, you can use cooking.toomwn.xyz any time you want! Even if you don't have internet! Just open Docker Desktop, navigate to the Containers section, and restart the container. Then, return back to the same link as before. Enjoy!

reopen1
reopen2
reopen3
reopen4
reopen5

This concludes my TED-talk on how run cooking.toomwn.xyz locally with Windows.

Note that the exact same process will work for Mac and Linux, you just need to obviously not install the Windows version of Docker Desktop. Containers truly are a magical thing.

Mac/Linux

Use your brain (see the bolded note above lol)

Concludy

I highly suggest you guys run cooking.toomwn.xyz on your own computer, especially if you plan to convert many files. Not only is it a lot faster, but also it saves me money :)

Also, sorry Bento :( I tried my best to reduce the size of the things needed to be installed. But unfortunately, it turns out you have to use Cygwin to run a few of the necessary texlive programs. :((((((

Return home