|
1 | 1 | # fezcodex.stories |
2 | | -Stories shown in Fezcodex. |
| 2 | + |
| 3 | +This directory contains the stories content for Fezcodex, structured to be easily consumed by the application. |
| 4 | + |
| 5 | +## Directory Structure |
| 6 | + |
| 7 | +The content is organized as follows: |
| 8 | + |
| 9 | +``` |
| 10 | +public/stories/ |
| 11 | +├── books.json |
| 12 | +└── [book-directory-name]/ |
| 13 | + ├── episode1.txt |
| 14 | + └── episode2.txt |
| 15 | + └── ... |
| 16 | +``` |
| 17 | + |
| 18 | +* `books.json`: This JSON file serves as the main index for all D&D books and their respective episodes. |
| 19 | +* `[book-directory-name]/`: Each book's individual episode content files are stored in their own dedicated subdirectories. For example, `book-one/` would contain episodes for "Book One". |
| 20 | +* `episodeX.txt`: These are plain text files containing the actual narrative content for each episode. |
| 21 | + |
| 22 | +## Book Structure (books.json) |
| 23 | + |
| 24 | +The `books.json` file is an array of book objects. Each book object defines a collection of episodes and their metadata. |
| 25 | + |
| 26 | +```json |
| 27 | +[ |
| 28 | + { |
| 29 | + "bookId": 1, |
| 30 | + "bookTitle": "Book One: The Shadowed Path", |
| 31 | + "episodes": [ |
| 32 | + { |
| 33 | + "id": 1, |
| 34 | + "filename": "book-one/episode1.txt", |
| 35 | + "title": "Episode 1: The Whispering Woods", |
| 36 | + "author": "fezcode" |
| 37 | + }, |
| 38 | + { |
| 39 | + "id": 2, |
| 40 | + "filename": "book-one/episode2.txt", |
| 41 | + "title": "Episode 2: The Goblin Ambush", |
| 42 | + "author": "fezcode" |
| 43 | + } |
| 44 | + ], |
| 45 | + "overlay": "red" |
| 46 | + }, |
| 47 | + // ... more book objects |
| 48 | +] |
| 49 | +``` |
| 50 | + |
| 51 | +### Book Object Properties: |
| 52 | + |
| 53 | +* `bookId` (Number): A unique identifier for the book. |
| 54 | +* `bookTitle` (String): The full title of the book. |
| 55 | +* `episodes` (Array): An array of episode objects belonging to this book. |
| 56 | +* `overlay` (String): A color string (e.g., "red", "blue", "black") used for visual styling in the application. |
| 57 | + |
| 58 | +### Episode Object Properties: |
| 59 | + |
| 60 | +* `id` (Number): A unique identifier for the episode within its book. |
| 61 | +* `filename` (String): The relative path to the plain text file containing the episode's content. This path is relative to the `public/stories/` directory (e.g., `book-one/episode1.txt`). |
| 62 | +* `title` (String): The title of the episode. |
| 63 | +* `author` (String): The author of the episode. |
| 64 | + |
| 65 | +This structure allows the application to dynamically load and display D&D campaign content, organizing it into books and episodes with associated metadata. |
0 commit comments