Begin work on the English documentation in a compendium

This commit is contained in:
Oliver-Akins 2025-05-27 01:53:55 -06:00
parent 9b3751b281
commit 4b78ab4d01
7 changed files with 1392 additions and 0 deletions

7
.gitignore vendored
View file

@ -1,3 +1,10 @@
# Ignore all of the binaries and stuff that gets built for Foundry from the raw
# JSON data because it's annoying seeing it in my git changes when it isn't actually
# needed.
/packs/**/*
!/packs/**/*/
!/packs/**/*.json
# Logs # Logs
logs logs
*.log *.log

881
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -12,6 +12,7 @@
"build": "NODE_ENV=production vite build --mode prod" "build": "NODE_ENV=production vite build --mode prod"
}, },
"devDependencies": { "devDependencies": {
"@foundryvtt/foundryvtt-cli": "^1.1.0",
"@stylistic/eslint-plugin": "^4.2.0", "@stylistic/eslint-plugin": "^4.2.0",
"eslint": "^9.25.0", "eslint": "^9.25.0",
"glob": "^11.0.1", "glob": "^11.0.1",

View file

@ -0,0 +1,435 @@
{
"name": "English",
"_id": "pBOyeBDuTeowuDOE",
"pages": [
{
"sort": 100000,
"name": "Getting Started",
"type": "text",
"category": "mrZHFR2i0MYp7aaY",
"_id": "xcR48pakEm49hbc2",
"system": {},
"title": {
"show": true,
"level": 1
},
"image": {},
"text": {
"format": 1,
"content": "<p>Thank you for install Stat Tracker!</p><p>This module aims to provide a clean way of keeping track of any data points you want within Foundry, whether that be dice rolls, or other things like how many natural 1s to natural 20s you get.</p><p>I was inspired by the <a href=\"https://foundryvtt.com/packages/dicestats\" title=\"dicestats\">dicestats</a> module, however it only allows tracking dice statistics, which is something I found myself needing to work around, so I decided to make this module to fill that gap.</p><p>You've already done the hardest part of set up for this module to work on the basic level, installing it! However if you want a more advanced set up for the module, this Journal is your go-to for information.</p><p>This module makes use of multiple key terms which are important for your understanding, the main terms you need to understand are:</p><ul><li><p>@UUID[Compendium.stat-tracker.docs.JournalEntry.pBOyeBDuTeowuDOE.JournalEntryPage.ugzCCxQskUSYMZR4]{Table}</p></li><li><p>@UUID[Compendium.stat-tracker.docs.JournalEntry.pBOyeBDuTeowuDOE.JournalEntryPage.S7Z6mZ0JablJVQJu]{Row}</p></li><li><p>and, @UUID[Compendium.stat-tracker.docs.JournalEntry.pBOyeBDuTeowuDOE.JournalEntryPage.e9FYKidbfFnnTspO]{Bucket}</p></li></ul><p>You can find information about what each of those terms mean within the FAQ section of the documentation or by clicking the above links.</p>"
},
"video": {
"controls": true,
"volume": 0.5
},
"src": null,
"ownership": {
"default": -1,
"t2sWGWEYSMFrfBu3": 3
},
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.344",
"systemId": "empty-system",
"systemVersion": "0.0.0",
"createdTime": 1748328891633,
"modifiedTime": 1748329657624,
"lastModifiedBy": "t2sWGWEYSMFrfBu3"
},
"_key": "!journal.pages!pBOyeBDuTeowuDOE.xcR48pakEm49hbc2"
},
{
"sort": 125000,
"name": "What's a \"Table\"",
"type": "text",
"category": "ZPAbuPbVOLWh75hL",
"_id": "ugzCCxQskUSYMZR4",
"system": {},
"title": {
"show": true,
"level": 1
},
"image": {},
"text": {
"format": 1,
"content": "<p>Whenever you see the term \"Table\" in relation to this module, it is indicating a group of @UUID[Compendium.stat-tracker.docs.JournalEntry.pBOyeBDuTeowuDOE.JournalEntryPage.S7Z6mZ0JablJVQJu]{rows} that are all presented together in graphs. The table is also where graph and @UUID[Compendium.stat-tracker.docs.JournalEntry.pBOyeBDuTeowuDOE.JournalEntryPage.e9FYKidbfFnnTspO]{bucket} configuration is stored.</p>"
},
"video": {
"controls": true,
"volume": 0.5
},
"src": null,
"ownership": {
"default": -1,
"t2sWGWEYSMFrfBu3": 3
},
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.344",
"systemId": "empty-system",
"systemVersion": "0.0.0",
"createdTime": 1748329356680,
"modifiedTime": 1748329828806,
"lastModifiedBy": "t2sWGWEYSMFrfBu3"
},
"_key": "!journal.pages!pBOyeBDuTeowuDOE.ugzCCxQskUSYMZR4"
},
{
"sort": 112500,
"name": "What's a \"Row\"",
"type": "text",
"category": "ZPAbuPbVOLWh75hL",
"_id": "S7Z6mZ0JablJVQJu",
"system": {},
"title": {
"show": true,
"level": 1
},
"image": {},
"text": {
"format": 1,
"content": ""
},
"video": {
"controls": true,
"volume": 0.5
},
"src": null,
"ownership": {
"default": -1,
"t2sWGWEYSMFrfBu3": 3
},
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.344",
"systemId": "empty-system",
"systemVersion": "0.0.0",
"createdTime": 1748329454864,
"modifiedTime": 1748329832738,
"lastModifiedBy": "t2sWGWEYSMFrfBu3"
},
"_key": "!journal.pages!pBOyeBDuTeowuDOE.S7Z6mZ0JablJVQJu"
},
{
"sort": 137500,
"name": "What's a \"Bucket\"",
"type": "text",
"category": "ZPAbuPbVOLWh75hL",
"_id": "e9FYKidbfFnnTspO",
"system": {},
"title": {
"show": true,
"level": 1
},
"image": {},
"text": {
"format": 1,
"content": ""
},
"video": {
"controls": true,
"volume": 0.5
},
"src": null,
"ownership": {
"default": -1,
"t2sWGWEYSMFrfBu3": 3
},
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.344",
"systemId": "empty-system",
"systemVersion": "0.0.0",
"createdTime": 1748329573212,
"modifiedTime": 1748329664880,
"lastModifiedBy": "t2sWGWEYSMFrfBu3"
},
"_key": "!journal.pages!pBOyeBDuTeowuDOE.e9FYKidbfFnnTspO"
},
{
"sort": 237500,
"name": "The Sidebar Tab",
"type": "text",
"category": "mrZHFR2i0MYp7aaY",
"_id": "ZI6rVlgXYnZGZ3MS",
"system": {},
"title": {
"show": true,
"level": 1
},
"image": {},
"text": {
"format": 1,
"content": "<p>This stat tracker comes with a custom sidebar tab that provides a general overview of the module's state as well as short-cuts for opening and controlling settings of the module.</p><p>The primary actions within the sidebar are:</p><ul><li><p>Viewing the data in graphs</p></li><li><p>Creating a new @UUID[Compendium.stat-tracker.docs.JournalEntry.pBOyeBDuTeowuDOE.JournalEntryPage.ugzCCxQskUSYMZR4]{table} (Gamemasters only)</p></li><li><p>Managing existing @UUID[Compendium.stat-tracker.docs.JournalEntry.pBOyeBDuTeowuDOE.JournalEntryPage.ugzCCxQskUSYMZR4]{tables} (Gamemasters only)</p></li></ul>"
},
"video": {
"controls": true,
"volume": 0.5
},
"src": null,
"ownership": {
"default": -1,
"t2sWGWEYSMFrfBu3": 3
},
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.344",
"systemId": "empty-system",
"systemVersion": "0.0.0",
"createdTime": 1748329854358,
"modifiedTime": 1748330869938,
"lastModifiedBy": "t2sWGWEYSMFrfBu3"
},
"_key": "!journal.pages!pBOyeBDuTeowuDOE.ZI6rVlgXYnZGZ3MS"
},
{
"sort": 437500,
"name": "Player Settings",
"type": "text",
"category": "mrZHFR2i0MYp7aaY",
"_id": "GgrPHfU09UuJl8W8",
"system": {},
"title": {
"show": true,
"level": 1
},
"image": {},
"text": {
"format": 1,
"content": ""
},
"video": {
"controls": true,
"volume": 0.5
},
"src": null,
"ownership": {
"default": -1,
"t2sWGWEYSMFrfBu3": 3
},
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.344",
"systemId": "empty-system",
"systemVersion": "0.0.0",
"createdTime": 1748330739278,
"modifiedTime": 1748330769327,
"lastModifiedBy": "t2sWGWEYSMFrfBu3"
},
"_key": "!journal.pages!pBOyeBDuTeowuDOE.GgrPHfU09UuJl8W8"
},
{
"sort": 337500,
"name": "Gamemaster Settings",
"type": "text",
"category": "mrZHFR2i0MYp7aaY",
"_id": "UuAWTQtd3QMKOWvU",
"system": {},
"title": {
"show": true,
"level": 1
},
"image": {},
"text": {
"format": 1
},
"video": {
"controls": true,
"volume": 0.5
},
"src": null,
"ownership": {
"default": 0,
"t2sWGWEYSMFrfBu3": 3
},
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.344",
"systemId": "empty-system",
"systemVersion": "0.0.0",
"createdTime": 1748330762378,
"modifiedTime": 1748330780668,
"lastModifiedBy": "t2sWGWEYSMFrfBu3"
},
"_key": "!journal.pages!pBOyeBDuTeowuDOE.UuAWTQtd3QMKOWvU"
},
{
"sort": 537500,
"name": "Utilities",
"type": "text",
"category": "KGdeJUfatQ9v0raI",
"_id": "TQzWrVTEz4oQhLPD",
"system": {},
"title": {
"show": true,
"level": 1
},
"image": {},
"text": {
"format": 1,
"content": "<p>The module provides a multitude of utility functions through it's API for usage however desired. This will go over them and describe their purpose.</p><p></p><h2>filterPrivateRows</h2><p>This method is intended to take @UUID[Compendium.stat-tracker.docs.JournalEntry.pBOyeBDuTeowuDOE.JournalEntryPage.S7Z6mZ0JablJVQJu]{rows} provided by the database and filter out any that the user would not be able to see normally. This is usually called by the database adapters so there's unlikely to be any reason to use it externally.</p><p>Available under <code>&lt;api&gt;.utils.filterPrivateRows</code>.</p><p></p><h2>validateValue</h2><p>Available under <code>&lt;api&gt;.utils.validateValue</code>.</p><p></p><h2>validateBucketConfig</h2><p>Available under <code>&lt;api&gt;.utils.validateBucketConfig</code>.</p>"
},
"video": {
"controls": true,
"volume": 0.5
},
"src": null,
"ownership": {
"default": -1,
"t2sWGWEYSMFrfBu3": 3
},
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.344",
"systemId": "empty-system",
"systemVersion": "0.0.0",
"createdTime": 1748330904988,
"modifiedTime": 1748331608766,
"lastModifiedBy": "t2sWGWEYSMFrfBu3"
},
"_key": "!journal.pages!pBOyeBDuTeowuDOE.TQzWrVTEz4oQhLPD"
},
{
"sort": 337500,
"name": "Database Adapters",
"type": "text",
"category": "KGdeJUfatQ9v0raI",
"_id": "PcdmuLgNM15h0in1",
"system": {},
"title": {
"show": true,
"level": 1
},
"image": {},
"text": {
"format": 1,
"content": "<p>This is a list of all available database adapters and how they're configured.</p><p></p><h2>Database</h2><p>This database adapter isn't a full adapter, this is an abstract class that is used by the other database adapters to enforce a consistent method / interface specification. The general interface includes implementation details for storing the table data in a world setting as well as adding/removing any applications that are rendered as part of the module's operations.</p><p>Available under <code>&lt;api&gt;.databases.Database</code>.</p><p></p><h2>UserFlagDatabase</h2><p>This database adapter uses Foundry's flag system in order to store the row data in the User document, leveraging Foundry's automatic database update propagation to other clients. The application handling and table storage utilizes the abstract implementations.</p><p>Available under <code>&lt;api&gt;.databases.UserFlagDatabase</code>.</p><p></p><h2>MemoryDatabase</h2><p>This database adapter should <strong>not</strong> be used in any actual games, it is intended for development only.</p><p>Available under <code>&lt;api&gt;.databases.MemoryDatabase</code>.</p>"
},
"video": {
"controls": true,
"volume": 0.5
},
"src": null,
"ownership": {
"default": -1,
"t2sWGWEYSMFrfBu3": 3
},
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.344",
"systemId": "empty-system",
"systemVersion": "0.0.0",
"createdTime": 1748331161024,
"modifiedTime": 1748331570983,
"lastModifiedBy": "t2sWGWEYSMFrfBu3"
},
"_key": "!journal.pages!pBOyeBDuTeowuDOE.PcdmuLgNM15h0in1"
}
],
"folder": null,
"categories": [
{
"name": "Overview",
"sort": 100000,
"_id": "mrZHFR2i0MYp7aaY",
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.344",
"systemId": "empty-system",
"systemVersion": "0.0.0",
"createdTime": 1748328842906,
"modifiedTime": 1748328842906,
"lastModifiedBy": "t2sWGWEYSMFrfBu3"
},
"_key": "!journal.categories!pBOyeBDuTeowuDOE.mrZHFR2i0MYp7aaY"
},
{
"name": "API",
"sort": 300000,
"_id": "KGdeJUfatQ9v0raI",
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.344",
"systemId": "empty-system",
"systemVersion": "0.0.0",
"createdTime": 1748328851997,
"modifiedTime": 1748328851997,
"lastModifiedBy": "t2sWGWEYSMFrfBu3"
},
"_key": "!journal.categories!pBOyeBDuTeowuDOE.KGdeJUfatQ9v0raI"
},
{
"name": "FAQ",
"sort": 200000,
"_id": "ZPAbuPbVOLWh75hL",
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.344",
"systemId": "empty-system",
"systemVersion": "0.0.0",
"createdTime": 1748329482648,
"modifiedTime": 1748329482648,
"lastModifiedBy": "t2sWGWEYSMFrfBu3"
},
"_key": "!journal.categories!pBOyeBDuTeowuDOE.ZPAbuPbVOLWh75hL"
}
],
"sort": 0,
"ownership": {
"default": 0,
"t2sWGWEYSMFrfBu3": 3
},
"flags": {
"core": {
"locked": false
}
},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.344",
"systemId": "empty-system",
"systemVersion": "0.0.0",
"createdTime": 1748328832096,
"modifiedTime": 1748330787690,
"lastModifiedBy": "t2sWGWEYSMFrfBu3"
},
"_key": "!journal!pBOyeBDuTeowuDOE"
}

View file

@ -22,5 +22,14 @@
"name": "English (Canadian)", "name": "English (Canadian)",
"path": "langs/en-ca.json" "path": "langs/en-ca.json"
} }
],
"packs": [
{
"name": "docs",
"label": "Documentation",
"module": "stat-tracker",
"type": "JournalEntry",
"path": "packs/docs"
}
] ]
} }

View file

@ -0,0 +1,32 @@
import { existsSync } from "fs";
import { readFile } from "fs/promises";
import { join } from "path";
import { compilePack } from "@foundryvtt/foundryvtt-cli";
async function main() {
const manifest = JSON.parse(await readFile(`./public/module.json`, `utf-8`));
if (!manifest.packs || manifest.packs.length === 0) {
console.log(`No compendium packs defined`);
process.exit(0);
};
for (const compendium of manifest.packs) {
console.debug(`Packing ${compendium.label} (${compendium.name})`);
let src = join(process.cwd(), compendium.path, `_source`);
if (!existsSync(src)) {
console.warn(`${compendium.path} doesn't exist, skipping.`)
continue;
};
await compilePack(
src,
join(process.cwd(), compendium.path),
{ recursive: true },
);
console.debug(`Finished packing ${compendium.name}`);
};
console.log(`Finished packing compendia`)
};
main();

View file

@ -0,0 +1,27 @@
import { readFile } from "fs/promises";
import { join } from "path";
import { extractPack } from "@foundryvtt/foundryvtt-cli";
async function main() {
const manifest = JSON.parse(await readFile(`./public/module.json`, `utf-8`));
if (!manifest.packs || manifest.packs.length === 0) {
console.log(`No compendium packs defined`);
process.exit(0);
};
for (const compendium of manifest.packs) {
console.debug(`Unpacking ${compendium.label} (${compendium.name})`);
let src = join(process.cwd(), compendium.path, `_source`);
await extractPack(
join(process.cwd(), compendium.path),
src,
{ recursive: true },
);
console.debug(`Finished packing ${compendium.name}`);
};
console.log(`Finished unpacking compendia`);
};
main();