feat: add Ściągawka Gracza / Mistrza Gry journal compendia
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -17,6 +17,7 @@ import { fileURLToPath } from 'node:url';
|
||||
import { compilePack } from '@foundryvtt/foundryvtt-cli';
|
||||
import { parseJournalBook, parseSplitBookFolder, type JournalDoc, type JournalPage } from './parsers/journal-parser';
|
||||
import { parseTopicalFolder } from './parsers/topical-parser';
|
||||
import { parseCheatsheet } from './parsers/cheatsheet-parser';
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const moduleRoot = resolve(__dirname, '..');
|
||||
@@ -163,6 +164,12 @@ const TOPICAL_CONFIGS: TopicalConfig[] = [
|
||||
{ folder: 'ObsidianNotes/adventures', pack: 'adventures' },
|
||||
];
|
||||
|
||||
/** Single-page vault cheat sheets → one pack each (page per `##` section). */
|
||||
const CHEATSHEET_CONFIGS: Array<{ file: string; pack: string; id: string }> = [
|
||||
{ file: 'ObsidianNotes/rules/Ściągawka Gracza.md', pack: 'cheatsheet-player', id: 'sciagawka-gracza' },
|
||||
{ file: 'ObsidianNotes/rules/Ściągawka Mistrza Gry.md', pack: 'cheatsheet-gm', id: 'sciagawka-mistrza-gry' },
|
||||
];
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Main
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -235,6 +242,18 @@ for (const top of TOPICAL_CONFIGS) {
|
||||
allDocs.push(...docs);
|
||||
}
|
||||
|
||||
// ── Cheat sheets (one entry per pack, one page per section) ──
|
||||
for (const cs of CHEATSHEET_CONFIGS) {
|
||||
const filePath = resolve(repoRoot, cs.file);
|
||||
if (!existsSync(filePath)) {
|
||||
console.warn(` · skip cheat sheet ${cs.pack}: file not found (${cs.file})`);
|
||||
continue;
|
||||
}
|
||||
const docs = parseCheatsheet({ filePath, pack: cs.pack, id: cs.id, sourceBook: 'cheat-sheet' });
|
||||
console.log(` · ${cs.pack}: ${docs[0]?.pages.length ?? 0} pages`);
|
||||
allDocs.push(...docs);
|
||||
}
|
||||
|
||||
console.log(`[lore] parsed ${allDocs.length} journal entries total`);
|
||||
|
||||
if (existsSync(packsSrcDir)) rmSync(packsSrcDir, { recursive: true });
|
||||
|
||||
Reference in New Issue
Block a user