# pae 2025.10 pae is an ebook format. It uses plain text files (tsv & gemtext or plain text) inside an uncompressed tape archive (tar). This is the informal spec for pae. It is updated when my needs change. The document title has the year and month of the last revision. ## Archive Format A .pae file is a standard uncompressed tar archive. A book contains: ``` book-data.tsv chapters.tsv chapters/ ``` Chapter files are stored inside the `chapters/` directory. A minimal book might contain: ``` book-data.tsv chapters.tsv chapters/0001.txt chapters/0002.txt chapters/0003.txt ``` A pae reader should ignore files it does not understand. ## book-data.tsv The book-data.tsv contains book metadata. Each line contains a key and value separated by a tab: ``` key value ``` Recommended keys are: ``` title The Time Machine author H. G. Wells language en published 1895 ``` * The `title` field should normally be present. * You may add other fields as needed. * Unknown fields are ignored. ## chapters.tsv `chapters.tsv` defines the reading order and titles of the chapters. Each line contains: ``` file title ``` The fields are separated by a tab. Example: ``` chapters/0001.txt Introduction chapters/0002.txt Chapter One chapters/0003.txt Chapter Two ``` The order of entries in `chapters.tsv` is the reading order. A chapter file does not need to repeat its chapter title. ## Chapter Files Chapter files are UTF-8 plain text in gemtext format with the following notes/variations: Line endings may be LF or CRLF. Readers should accept either. ## File Names File names inside the archive should use `/` as the directory separator. Chapter file names may be chosen freely, but simple sequential names are recommended: ``` chapters/0001.txt chapters/0002.txt chapters/0003.txt ``` ## Reader Behavior A reader should: 1. Open the tar archive. 2. Read `book-data.tsv`. 3. Read `chapters.tsv`. 4. Present the chapter list in the order given. 5. Load and display chapter files as requested. Readers should ignore unknown metadata fields and unrecognized files. Malformed entries may be skipped. ## Minimal Example ``` book-data.tsv chapters.tsv chapters/0001.txt chapters/0002.txt ``` `book-data.tsv`: ``` title Example Book author Example Author ``` `chapters.tsv`: ``` chapters/0001.txt Chapter One chapters/0002.txt Chapter Two ``` `chapters/0001.txt`: ``` # A Beginning This is the first paragraph of the book. This is another paragraph. ## A Section * First item * Second item > A short quotation. ```