Skip to main content

Module create

Module create 

Source
Expand description

Making a new package from a single file (lx new --from book.epub): the file in its format’s folder, with a logoxide.toml around it. What the file says about itself fills in the manifest, and anything given (NewPackage) wins over it:

  • EPUB (a book): its title, subtitle (the description), every author (dc:creator, leaving out editors, illustrators, and other roles), language, and publisher, from its package document (the .opf its META-INF/container.xml names)
  • USX, USFM, OSIS, ThML (a Bible, or a book of one): nothing is read from them yet, so a name and a language must be given

A collection (new_collection) has no file: its packages are its dependencies.

Structs§

FileMetadata
What a file’s own metadata says (empty where it says nothing)
NewPackage
What to put in a new package’s [package]; each one given wins over the file’s metadata

Functions§

abbreviation_from
An abbreviation from a name: each word’s first letter or digit, capitalized (The Dorean Principle → TDP)
epub_metadata
An EPUB’s metadata, from the package document its META-INF/container.xml names
file_format
The format a file is in, from its extension (and, for .xml, its root element), and the kind of package it makes
id_from
A package id from a name: lowercase ASCII letters and digits, words joined by - (God's Word Is Not Bound → gods-word-is-not-bound)
new_collection
Writes a new collection’s logoxide.toml into dest: no text, its packages added afterwards as its dependencies (lx add --project <its folder>)
new_from_file
Writes a new package made from one file into dest: its logoxide.toml, and the file in its format’s folder (epub/the-dorean-principle.epub). Gives the manifest
opf_metadata
The metadata in an EPUB’s package document (.opf), EPUB 2 or 3