Skip to content

sbsdev/catalog

Repository files navigation

https://github.com/sbsdev/catalog/actions/workflows/clojure.yml/badge.svg

Kati

Kati is a web-based system to generate catalogs of new items in the library. It takes MARC21 XML bibliographic data from the library system and produces catalogs in various formats such as accessible PDF or DTBook XML. The PDFs contain either all of the new catalog items or various subsets of the items such as all new large print books or all new audio books for example.

For the DTBook there are actually two variations produced. One can be used for the production of Braille with a separate tool chain (such as pipeline-mod-sbs for example) while the other is imported into Obi for audio production.

https://versions.deps.co/sbsdev/catalog/status.svg

Build and Installation

Kati is based on Luminus version “4.10”. You can build it with Leiningen:

lein uberjar

The resulting jar can be run as follows:

java -Dconf=dev-config.edn -jar catalog.jar

Release

lein release :minor

Documentation

Data structure

The data is read from MARC21 XML and converted into a Clojure sequence of sorted maps. These maps are quite free form, they contain different fields depending on the format of the entry, e.g. a braille book might have a grade while an audio book probably has a narrator. The entries are validated through prismatic/schema. The maps are sorted to maintain order, which is later used to emit the genres or sub-genres in the desired sequence and to create the TOC accordingly.

Output generation

For most outputs the sequence of entries is grouped by format and genre (possibly sub-genre) and essentially converted into a tree of maps. This tree is then passed to the different output functions that render the data. Most of these generate a hiccup style data structure from the tree which is then passed to Apache FOP or used as is in the case of DTBook XML. The text formatter just generates text from the tree structure.

Accessible PDF

Quite a bit of work has gone into making sure the PDF produced by FOP is accessible. Roles are attached to the appropriate elements, atifacts are tagged as such and alt texts are added using the fox:alt-text attributes.

Database

A relational db is used to persist the data. Well, it is really more used like a document-oriented database as we essentially just store the sequence of entries as an edn string. For the exact details refer to the schema.

Markdown

The editorial part of some of the catalogs is edited directly in the browser using markdown. In the browser this is implemented using Bootstrap Markdown and markdown-browser. On the server side we use endophile to convert markdown into clj data structures which are then again converted to a hiccup style data structure.

Configuration and Dependencies

Installation and configuration can be done using an ansible installation script which automates the whole process.

Mostly you will need Java, and some fonts.

License

Copyright © 2015-2023 Swiss Library for the Blind, Visually Impaired and Print Disabled.

Distributed under the GNU Affero General Public License. See the file LICENSE.