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.
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:
- using the catalog (books.yml) and generating a new site using that.
- using a remote catalog file and pointing to a running webapp.
- adding books with the "Add a book" button, and sharing a hyperlink.
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.
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
- Create a books.yml file
- Host it on the Internet and make sure that CORS is enabled.
- Open app with
http://teachbooks.io/recombiner/?books_url=<your_url>
. Where<your_url>
is the URL of your books.yml file.
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.
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