danmackinlay / quarto-thumbnail

Try to reduce quarto listing bloat with thumbnail images

Home Page:https://github.com/quarto-dev/quarto-cli/discussions/9390

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Thumbnail images for quarto

Currently, if you use listings in Quarto, the listing page will download a full-size image from every page on the size #9390 which is slow and wasteful (most of the images are never displayed, and none of them are displayed at full size).

This extension is a workaround for that issue. It uses libvips to generate thumbnails of images in quarto documents, and then put the path to the thumbnail image int he page metadata. Unfortunately, quarto does no seem to pick that image sup, so this extension is currently useless.

Installing

This library requires libvips to be in your path. See their installation instructions to install it on your local machine.

Then,

quarto add danmackinlay/quarto-thumbnail

This will install the extension under the _extensions subdirectory. If you're using version control, you will want to check in this directory.

Using

This extension works by walking the Quarto AST of every single element and when it encounters an image, uses libvips to generate avif optimized images.

Example

Here is the source code for a minimal example: example.qmd.

Thanks

The excellent libvips library is used for image processing. This extension is inspired by the work of abhiaagarwal/optimize-images.

About

Try to reduce quarto listing bloat with thumbnail images

https://github.com/quarto-dev/quarto-cli/discussions/9390

License:MIT License


Languages

Language:Lua 100.0%