Loading repository data…
Loading repository data…
aeturrell / repository
This repository hosts the code behind the online book, Coding for Economists.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
To read or use the book, head to the Coding for Economists website.
The rest of this readme is intended to help those who are contributing to the book, rather than readers.
These instructions are only for developers working on the book.
Contributions to Coding for Economists are welcome! If you're planning to make a pull request, lodge an issue to discuss it first but feel free to go straight to making a pull request for corrections, typos, and fixing out of date package issues.
Prerequisites:
uvuv run python -m spacy download en_core_web_sm to download the spacy model, and uv run python3 -m nltk.downloader all for the nltk models.You can see how to complete all of these steps programmatically by looking at how the Dockerfile does it.
To make changes:
uv add <packagename>)uv run quarto render --execute to render the book, and uv run python -m http.server -d _book 8000 to read it locally then head to "http://localhost:8000" to see it.uv run pre-commit run --all-filesYour pull request will then be reviewed by an admin.
There is a Dockerfile for the environment, which is the easiest way to set up a dev env. You run it by following these steps:
../app.docker cp running-container-name:app/_book/ . from your local command line (not the docker container) within the folder where you want to move all of the build files. You could transfer to a local "_book" folder. You can partially view the HTML within the docker container using a HTML preview extension but note that MathJax and internal book links won't work.To build the book locally with all the content executed use:
uv run quarto render --execute
You should not need to upload built files manually as there are GitHub Actions that auto build and auto publish when there's a new release. Sometimes it is useful to republish locally, however. Once you have successfully rendered the entire book with no errors, the publish command is
uv run quarto publish
This book uses some special fonts, such as Varta. If you install these manually, you may need to refresh your Matplotlib font cache before you can see the new fonts at work:
rm ~/.matplotlib/fontlist-v330.json
There's a GitHub Action set up to help with releases (a release is a new version of the book). These are the steps:
pyproject.tomlThis process should mean the releases and the uploaded website (on GitHub pages) should be consistent