audrey.feldroy.com

The experimental Jupyter notebooks of Audrey M. Roy Greenfeld. This website and all its notebooks are open-source at github.com/audreyfeldroy/arg-blog-fasthtml

This Site Is Now Powered by This Notebook, Part 2

Sat, Jan 25, 2025

Here I clean up the code, back-integrate the manual fixes I've since made, and reduce the steps it takes to export.

Creating In-Notebook Images for Social Media With PIL/Pillow

Fri, Jan 24, 2025

Here I use the Python Imaging Library to create and display an image in-notebook, so that it's rendered as part of the blog post on audrey.feldroy.com.

Troubleshooting MonsterUI on This Site

Thu, Jan 23, 2025

My first MonsterUI notebook wasn't rendering correctly. I started to debug it in this notebook, but ended up just using this as a test notebook for the next one.

This Site Is Now Powered by This Notebook

Thu, Jan 23, 2025

Here in this Jupyter notebook I rewrite audrey.feldroy.com and use nb_export to export it as my new main.py for arg-blog-fasthtml.

MonsterUI Buttons and Links

Wed, Jan 22, 2025

Iterating through the ButtonT enum to show all MonsterUI button types visually.

Customizing FastHTML Headers From Notebook Contents

Wed, Jan 22, 2025

Can we customize a FastHTML app to set different headers when rendering notebooks with nb2fasthtml, based on what the notebook actually needs for its headers?

SVG Animations in FastHTML

Tue, Jan 21, 2025

Exploring how to make basic SVG animations work with FastHTML.

Dark and Light Mode in FastHTML

Mon, Jan 20, 2025

How to make a website check the user's preferred mode and set the background appropriately.

Genanki and fastcore

Sun, Jan 19, 2025

Working with Anki flashcard decks in Python, with genanki to work with the decks and fastcore for ease of use.

Alarm Sounds App

Sat, Jan 18, 2025

Demo of adding sounds to a FastHTML app with Tone.js. Sounds make web apps come alive and feel interactive.

Alarm Clock Sounds

Fri, Jan 17, 2025

FastHTML MonsterUI example app that uses Tone.js to make different alarm clock sounds.

Cosine Similarity Breakdown in LaTeX

Thu, Jan 16, 2025

A mathematical breakdown of cosine similarity, with copy-pastable LaTeX.

Constructing SQLite Tables for Notebooks and Search

Tue, Jan 14, 2025

SQLite full text search setup via APSW for all the notebooks on this website, inspired by the [APSW FTS5 Tour]((https://rogerbinns.github.io/apsw/example-fts.html)).

SQLite FTS5 Tokenizers: `unicode61` and `ascii`

Mon, Jan 13, 2025

The SQLite FTS5 (full-text search) extension includes the built-in tokenizers unicode61, ascii, porter, and trigram, implemented in [fts5_tokenize.c](https://github.com/sqlite/sqlite/blob/master/ext/fts5/fts5_tokenize.c). [APSW](https://github.com/rogerbinns/apsw) provides a Python API to use those. Here we explore the default tokenizer `unicode61` and built-in tokenizer `ascii` in detail.

A Better Notebook Index Page

Sun, Jan 12, 2025

I've made good progress on creating a notebook every day. Now I have so many notebooks that my index page needs an overhaul, including: * Dates with datetime * Cards with execnb to grab notebook titles * The cache decorator to make that fast * Subtle CSS tweaks to increase information density

NBClassic Keyboard Shortcuts: Command and Dual-Mode

Sat, Jan 11, 2025

I'm taking inventory of all the Command Mode and dual-mode nbclassic keyboard shortcuts on macOS, with my random musings about each. This is part of my deliberate practice to master all of the useful ones, and will serve as a reference for myself later.

Understanding FastHTML Routes, Requests, and Redirects

Fri, Jan 10, 2025

In this tutorial we'll look at the simplest routes and route handlers you can create with FastHTML. We'll define the handlers as little functions, and then call them as we would any other Python function. After that, we'll make simple GET requests to a simple index route/handler, a parameterized one, and a parameterized one with a redirect.

Reading and Writing Jupyter Notebooks With Python

Thu, Jan 9, 2025

from execnb.nbio import new_nb, mk_cell, read_nb, write_nb from execnb.shell import exec_nb from pathlib import Path

HTML Title Tag in FastHTML

Wed, Jan 8, 2025

I get so lazy about title tags. The point of today's notebook is to make me less lazy, so I actually fix the title of this site. Oh, and to explore `Title` and `Titled` in FastHTML.

Verifying a Bluesky Domain Handle on a FastHTML Site

Tue, Jan 7, 2025

I just changed my Bluesky to [@audrey.feldroy.com](https://bsky.app/profile/audrey.feldroy.com). To verify my domain ownership, I added this route handler to my FastHTML website:

Understanding FastHTML Headers

Mon, Jan 6, 2025

FastHTML provides default headers for every page, which are also fully customizable. This notebook explores how this works.

Using SSH Agent to Save Passphrase Typing

Sun, Jan 5, 2025

In my terminal (Ghostty) when I run shell scripts that update multiple repos, I get asked my SSH key passphrase over and over. It gets annoying with 20+ repos. To get around this, I use OpenSSH's authentication agent, `ssh-agent`.

Showing Claude Artifacts in Jupyter Notebooks

Sat, Jan 4, 2025

from fastcore.all import * from fasthtml.common import * from fasthtml.jupyter import * from IPython.display import IFrame from pathlib import *

Using zip

Fri, Jan 3, 2025

The [zip docs](https://docs.python.org/3/library/functions.html#zip) say that `zip(*iterables, strict=False)`: > Iterate over several iterables in parallel, producing tuples with an item from each one.

FastHTML Piano, Part 3

Thu, Jan 2, 2025

from fastcore.all import * from fasthtml.common import *

FastHTML Piano, Part 2

Thu, Jan 2, 2025

from fastcore.all import * from fasthtml.common import * from fasthtml.jupyter import * from IPython.display import display, Javascript

FastHTML Piano, Part 1

Wed, Jan 1, 2025

My adaptation of https://developer.mozilla.org/en-US/play to FastHTML, with improvements.

Command Substitution in Bash

Wed, Jan 1, 2025

## Simple Command Substitution

Note Box FastTag

Tue, Dec 31, 2024

I needed a quick note box for the index page of this site, without affecting the CSS of my notebooks that explore weird CSS stuff deeply.

Images in Jupyter Notebooks, in Every Way

Mon, Dec 30, 2024

This notebook uses images in every possible way.

Bash in Jupyter Notebooks

Sun, Dec 29, 2024

## Variables

Minimal Typography for FastHTML Apps

Sat, Dec 28, 2024

When using `pico=False` and no CSS framework, a FastHTML page doesn't look great. Can we use minimal typography to make it look decent, without dependencies?

Transforming Notebook Names to Cards

Fri, Dec 27, 2024

I have Jupyter notebooks in `nbs/`. I want to turn them into cards from the filenames, without having to read the file contents.

How I Fixed CSS Scope Leakage in Pygments Syntax Highlighting

Fri, Dec 27, 2024

This notebook shows how to: * Get and use Pygments styles programmatically * Extract and display the source code from Python functions * Apply different Pygments syntax highlighting to different cells of the same notebook with proper CSS scoping * Use Pygments-highlighted code in a FastHTML FastTag

Showing Components in Notebooks

Thu, Dec 26, 2024

## Understand the Problem

Converting Jupyter Notebook Cells to Pygments Syntax-Highlighted HTML

Wed, Dec 25, 2024

## Understand the Problem Can a Jupyter notebook be converted to syntax-highlighted HTML easily with Pygments? Side note: Highlight.js is what Danny and Isaac use for syntax highlighting in FastHTML apps. I'll try that in another notebook later. I started this on a plane where I only had Pygments installed.

What Can `execnb` do?

Tue, Dec 24, 2024

This notebook is a [SolveIt](https://solveit.fast.ai/)-style exploration of [https://github.com/AnswerDotAI/execnb/](https://github.com/AnswerDotAI/execnb/). Here I am following the SolveIt process in a Jupyter notebook to learn new things.

Deck the Halls

Tue, Dec 24, 2024

from fastcore.all import *

execnb's read_nb and nb2fasthtml's render_nb

Mon, Dec 23, 2024

import glob from pathlib import Path from fastcore.all import * from nb2fasthtml.core import * from execnb.nbio import *

Daddy's Snowman Card

Mon, Dec 23, 2024

Here we are checking the numbers from our daughter's snowman card to Daddy. She gave him math problems to solve and a snowman joke.

Using Claudette with FastHTML

Mon, Aug 5, 2024

import os from claudette import * import fasthtml import fasthtml.common from fasthtml.common import * import inspect

Claudette

Sun, Aug 4, 2024

Studying https://claudette.answer.ai/

FastHTML by Example

Mon, Jul 29, 2024

Studying https://docs.fastht.ml/tutorials/by_example.html more

Delegates Decorator

Mon, Jul 29, 2024

My study of the `@delegates` decorator and `GetAttr` from `fastcore`.

Auth in FastHTML

Mon, Jul 29, 2024

My early attempts to figure out auth in FastHTML. Things have likely changed a lot since.

Understanding FastHTML xtend

Tue, Jul 16, 2024

My early exploration of the xtend notebook in FastHTML.

Printing FastHTML Components

Mon, Jul 15, 2024

from fasthtml.common import *

SemanticUI FastHTML Cards

Sun, Jul 14, 2024

Caution: I’ve learned better patterns since I wrote this. Leaving this here for posterity.

Setting Up a Blog With nbdev

Sat, Jul 29, 2023

I feel like Jupyter notebooks would be really nice for blogging or publishing "Today I Learned" posts. I had heard about Fastpages before via Jeremy Howard's blog or YouTube videos, but seeing that it was deprecated in favor of nbdev, I decided to try nbdev.