Skip to content

TeachBooks/recombiner

Repository files navigation

Teachbook recombiner

This is a web app to pick chapters from a pre-defined list of TeachBooks and combine them into a new book using the new external table of content entry type, see the teachbook package.

Checked with Biome

Usage

You can visit the webapp at teachbooks.io/recombiner/. This has uses the default list of books from which you can select chapters. You can select the chapters you want to add you your own book, and either get instructions to follow yourself, or mail them to someone (e.g. the TA responsible).

By clicking on "Add a book" you can add a book that was not in the default list.

There are three ways to present a set of TeachBooks to others:

Catalog

In books.yml you can find the list of books that can be combined.

In chapters.json you can find the same books, but with their table of contents fetched. You should not edit this file manually, as it is generated by running the following command:

# Install the dependencies, if you haven't already
pnpm install
pnpm harvest
# Reads books.yml and generates chapters.json

See the development instructions for more info on the dev setup.

Remote catalog

If you want to show other books the then ones specified in the ./books.yml file, you can point the app to a remote catalog file with the following steps

  1. Create a books.yml file
  2. Host it on the Internet and make sure that CORS is enabled.
  3. Open app with http://teachbooks.io/recombiner/?books_url=<your_url>. Where <your_url> is the URL of your books.yml file.

Sharing user defined books

In the web application you can add a book using a form.

To make those books shareable, you can click the share button in header of the books list. This will open a new window with a link in the adress bar. Sharing that link will allow other users to see the books you defined.

Develop

Developing this webapp requires Node.js and pnpm.

Once you've installed these you can use the following commands;

# Install dependencies
pnpm install
# Start the development server
pnpm dev
# Run formatter and linter in fix mode
pnpm format
# Run linter
pnpm lint
# Run type checker
pnpm typecheck
# Build the app
pnpm build
# Preview the built app
pnpm preview

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •