Skip to content

Latest commit

 

History

History
144 lines (109 loc) · 3.85 KB

README.md

File metadata and controls

144 lines (109 loc) · 3.85 KB

Jurassic

Build and ship software in Jupyter notebooks using Deno

DocsGetting started

Jurassic lets you write and ship software in Jupyter notebooks using Deno. It's inspired by nbdev and is made possible by Deno Jupyter kernel.

Get started

Make sure you have Deno installed on your machine. You will also need Deno jupyter runtime.

Run the following command to bootstrap a project (feel free to change hellojurassic to something more appropriate)

deno run --reload -R -W -N --allow-run jsr:@jurassic/jurassic/init hellojurassic

Head to your newly created project directory and let's take a look around

cd hellojurassic

Your project should look something like this:

.
├── app.test.ts
├── mod.ts
├── nbs
│   └── app.ipynb
├── hellojurassic
│   └── app.ts
├── _docs
│   ├── .vitepress
│   │   └── config.mts
│   ├── public
│   │   └── logo.png
│   ├── app.md
│   ├── package.json
│   ├── index.md
│   └── get-started.md
├── docs
│   ├── public
│   │   └── logo.png
│   ├── package.json
│   ├── index.md
│   └── get-started.md
├── deno.json
├── deno.lock
├── jurassic.json
├── .gitignore
└── .github
    └── workflows
        ├── publish.yml
        └── pr.yml

Here's a quick overview of different parts of the project

Entry Description
.github/workflows/ GH actions for building, testing and documenting your project
docs Additional content and static files for documentation
hellojurassic/ Project typescript module - these files are automatically generated from notebooks
nbs Notebooks containing application code and documentation
app.test.ts Application unit tests
jurassic.json Jurassic project configuration file
mod.ts Main module entry point for your application

Head to mod.ts and let's replace export * from "./hellojurassic/app.ts"; with the following

import { app } from "./hellojurassic/app.ts";

app();

You can now run your app using

deno run ./mod.ts

Let's modify the app and rerun it:

  • open nbs/app.ipynb notebook using your preferred notebook editor
  • make sure deno kernel is selected
  • locate application code cell
//| export

export const app = () => {
  console.log("Hello, World!");
};
  • let's change this to be
//| export

export const app = () => {
  console.log("Hey!");
};
  • save your notebook and rebuild your app
deno task build
  • and rerun it using
deno run ./mod.ts

Moving beyond Hello world

There are 2 apps that are built using Jurassic that you can look at for inspiration:

  • Jurassic itself is built using Jurassic
  • bsky2md is a Hono based web app integrating with Bluesky API, it converts Bluesky threads into markdown files; you can see it in action here