Code Monkey home page Code Monkey logo

tea-book's Introduction

tea-Book: e-ink tea list

At home, I have a display with small jars of loose tea leaves. I wanted to have some way to quickly reference what was poured out, so I created this script to pull a list of teas from Notion. It generates files for an e-reader to display, which allows me to have an easy to update handheld menu to show guests when they visit.

Example of summary image, displaying 12 teas split into 2 groups

Generate summary image

The summary image shows the 12 teas on the display (6 for the top shelf, 6 for the bottom shelf). Deno is used to generate an SVG file named tea.svg, which can then be converted to a PNG file named tea.png using Inkscape. You can either open Inkscape's UI and export the SVG manually, or use its CLI to export the SVG with one command.

deno run --allow-net=api.notion.com --allow-env --allow-read --allow-write .\src\generate.ts
inkscape --export-type="png" tea.svg

This image is used as an e-book cover. It can also be uploaded separately as a screensaver for the e-reader. For the Nook Simple Touch, I placed file in the following folder on the e-reader hard drive (E:):

E:\screensavers\Tea\tea.png

Generate details ebook

Descriptions of each tea are written to an e-book. The e-book includes a table of contents page formatted as a table with summarized tea information, followed by a chapter for each tea. Deno generates a Markdown file named tea-list.txt which is then converted by Pandoc into an ePub file named tea.epub. ePubs are just zip files with a bunch of HTML, so you can validate the content by making a copy with a .zip suffix instead of a .epub suffix.

deno run --allow-net=api.notion.com --allow-env --allow-read --allow-write .\src\generate.ts
pandoc tea-list.txt -o tea.epub --epub-title-page=false
cp tea.epub tea.zip

Validate result with https://epub-reader.online

tea-book's People

Contributors

notwoods avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.