rework to allow for image gen
All checks were successful
ci/woodpecker/push/ci Pipeline was successful

This commit is contained in:
Madison Grubb
2025-09-04 16:52:13 -04:00
parent af315783e0
commit 1e1d745e55
9 changed files with 372 additions and 135 deletions

View File

@@ -1,6 +1,7 @@
import 'dotenv/config';
import { generateDungeonPDF } from "./generateDungeon.js";
import { generateDungeon } from "./dungeonGenerator.js";
import { generateDungeonImages } from "./imageGenerator.js";
import { generatePDF } from "./generatePDF.js";
// Utility to create a filesystem-safe filename from the dungeon title
function slugify(text) {
@@ -12,17 +13,20 @@ function slugify(text) {
(async () => {
try {
// Generate dungeon JSON from Ollama
// Generate the dungeon data
const dungeonData = await generateDungeon();
// Optional: replace the map placeholder with your local map path
// dungeonData.map = "/absolute/path/to/dungeon-map.png";
// Generate dungeon map image (uses dungeonData.flavor)
console.log("🖼️ Generating dungeon map image...");
const mapPath = await generateDungeonImages(dungeonData);
// Generate a safe filename based on the dungeon's title
dungeonData.map = mapPath;
// Generate PDF filename based on the title
const filename = `${slugify(dungeonData.title)}.pdf`;
// Generate PDF
await generateDungeonPDF(dungeonData, filename);
// Generate the PDF using full dungeon data (including map)
await generatePDF(dungeonData, filename);
console.log(`Dungeon PDF successfully generated: ${filename}`);
} catch (err) {