I am updating this readme with the update steps as I go through the first update, hoping that I don't run into any bugs that hinder the process.
Side note: The only part of the site that does not need some sort of manual updating is actually the Rules and Policy Clarifications. Because that is maintained by macfergusson in git gists, we can just get that information adhoc on load with fetch.
-
Update the cards_data.js file. Do this by running the update_cards.py python script (
pip install-ing any required packages). This step can take a while, but the script will log messages noting which page of the API that is currently being processed. I added a one second time delay between page calls to hopefully prevent overloading the API, but it seems like sometimes, you've just got to run it a couple times before it works? Not really sure, if I was a better python developer I would know how to fix it. After running the script successfully, you'll now have an updated cards_data.js file, which has some variables that once the JS is linked to in the main HTML file, the HTML script will be able to recognize the variable and access the card data from inside that generated file. -
Update the documents. The CR and CEG are all pulled directly from the nexus website. Download both files and put them in the rules_documents folder, and move the previous versions to the old folder. Delete all of the existing PNGs from the rules_documents/CR and rules_documents/CEG folders. Then, open up https://www.adobe.com/acrobat/online/pdf-to-jpg.html and convert both PDFs to PNG, and put the images in the respective folders in rules_documents (CR and CEG). If that site only lets you convert one document before signing in, then close the tab, clear cookies from the last 5 minutes, then reopen the site to upload the next document. Once the new files are all downloaded, update all of the references in index.html to the new PDFs. There are 3 spots for these updates: the meta tags in the head, the a tags to direct link to the PDF, and the objects data sources.
-
For the PDF PNG fallbacks, we need to update the PDF image files in the proper folders. Just like the cards data from step 1, the pdf_images.py script will quickly create a JavaScript file with variables that the HTML script will be able to recognize and process to put the proper images in the proper order on the page when viewing.
-
The last step is to commit all of the changes to the github repository! I try to use the convention
Data Update [date-of-update]so that we can track the most recent update to all of the information without an issue. If there are partial updates, then we can just go ahead include just the part that was updated for clarity (i.e. just the card data was updated because there was a significant block update).