- A Visual Studio Code extension for running Pyret
- Improvements to offline Pyret via pyret-npm and the VScode extension
- New ways to import modules
- New ways to work with files, URLs, and images
- A new library for embedding Pyret in web pages
- Documentation and naming convention clean up
- Various bug fixes across libraries
There should be no backwards incompatibilities in this release for existing code.
The extension is a fully capable web extension, meaning it can run on
github.dev. This means it provides another path to editing and running Pyret code (for free) without leaving the browser, with just a Github account.
# Improvements to Offline Pyret
The command-line version of Pyret, which most folks use through the npm package (
https://www.npmjs.com/package/pyret-npm), has seen a few improvements:
The image library is now fully functional from the command line. It uses the node-canvas npm package to do this. From the command line—and from the VScode mode!—you can use image-file to read images from a local path, and save-file to save (and later view) images.
We've added and documented a few new libraries including
csv,
filesystem, and
fetch for getting more work done from the command line.
# New Ways to Import Code and Data
We've added the ability to import modules from URLs with
url(...) and
url-file(...) imports. This allows for development of student-facing starter code and libraries for
code.pyret.org without relying on Google Drive. We've also added functions to create tables from CSV data loaded from
files or from URLs; previously this kind of data import really only worked well from Google Sheets. Now arbitrary CSV files can be loaded into tables from the filesystem or the web (or arbitrary text data with
fetch).
# A New Embedding Library
You can now embed the
code.pyret.org editor directly into other web pages with
pyret-embed. Indeed, this is what is used to create the VScode extension! The embedding library is suitable for showing interactive examples in online tutorials, creating interactive lessons, presenting student code to TAs in a web-based autograder, and more. We're curious what you build with it!
# Documentation Updates
We've significantly updated and improved documentation of many core libraries. In addition, we've used the embedding library to make most of the examples in the docs runnable. For example, click the (Try it!) button in the
numbers documentation.