Skip to content

Commit ccecc81

Browse files
committed
Merge branch 'maintenance/Documentation_fixes'
2 parents a360646 + f63b2c3 commit ccecc81

6 files changed

Lines changed: 26 additions & 5 deletions

File tree

Ida/.env.example

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
# Environment Variables example
2+
# This file is used to generate and deploy the documentation site.
23
# Copy this file to .env and fill in your actual values
34

5+
# Main repository URL, for example https://github.com/innerbytes/idajs
6+
MAIN_REPO_URL=
7+
48
# Documentation deployment repository URL.
59
# This repo has to be setup to automatically publish to the documentation site folder.
610
# Example: ssh://user@example.com/path/to/repo.git
711
DEPLOY_REPO_URL=
812

913
# Documentation site host URL
10-
# Example: https://docs.example.com/
14+
# Example: https://ida.innerbytes.com/
1115
DOC_HOST_URL=

Ida/README.template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ This way you can combine your custom life script logic with the original LBA 2 b
485485
**What are Move Scripts?**
486486

487487
Move scripts are **coroutines** that execute animation and movement sequences over multiple frames.
488-
Unlike life scripts that run completely each frame, move scripts pause and resume their execution across many frames.
488+
Unlike life scripts that run completely each frame, move scripts continue their execution across many frames.
489489

490490
**Key Characteristics:**
491491

@@ -933,7 +933,7 @@ Your mod project contains a small set of folders and files:
933933
- `src/` — your mod code. Start with `src/index.js` (or `.ts` for TS template). This is the entry point loaded by {{{ida}}}.
934934
- `media/` — assets used by your mod. {{{ida}}} will convert media assets to LBA2 formats automatically.
935935
- `media/sprites/` — small PNGs used as dialog sprites and similar inline images.
936-
- `media/images/` — full‑screen PNGs for dialogs/backgrounds.
936+
- `media/images/` — full‑screen PNGs (640x480) for dialogs/backgrounds.
937937
- Root files — tooling and configuration; not part of gameplay logic:
938938
- `package.json` — metadata (name, description, author) and handy scripts.
939939
- `.idajs.json` — {{{ida}}} config (the path to {{{ida}}} project).

Ida/generate-readme.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
#!/usr/bin/env node
22

3+
require("dotenv").config();
4+
35
const { execSync } = require("child_process");
46
const fs = require("fs");
57
const path = require("path");
68
const os = require("os");
79

810
// Configuration
9-
const GIT_URL = "https://github.com/innerbytes/idajs";
11+
const GIT_URL =
12+
process.env.MAIN_REPO_URL ||
13+
(() => {
14+
console.warn(
15+
"⚠️ Warning: MAIN_REPO_URL not set in .env file. Using default: https://example.com/repo"
16+
);
17+
return "https://example.com/repo";
18+
})().replace(/\/$/, "");
1019

1120
/**
1221
* Executes a shell command and returns the output

Ida/generate-typedoc-config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ const fs = require("fs");
22
const { execSync } = require("child_process");
33
const path = require("path");
44

5+
require("dotenv").config();
6+
57
const TYPEDOC_CONFIG = "./typedoc.json";
68
const FOOTER_FILE = "./typedoc-footer.html";
9+
const GIT_URL = (process.env.MAIN_REPO_URL || "").replace(/\/$/, "");
710

811
// Check if typedoc-footer.html exists
912
if (!fs.existsSync(FOOTER_FILE)) {
@@ -59,6 +62,7 @@ try {
5962
const footerContent = fs
6063
.readFileSync(FOOTER_FILE, "utf8")
6164
.trim()
65+
.replace(/\$\(currentYear\)/g, new Date().getFullYear())
6266
.replace(/\n/g, "")
6367
.replace(/\s+/g, " ");
6468

@@ -67,6 +71,9 @@ const typedocConfig = JSON.parse(fs.readFileSync(TYPEDOC_CONFIG, "utf8"));
6771

6872
// Inject footer content
6973
typedocConfig.customFooterHtml = footerContent;
74+
if (GIT_URL) {
75+
typedocConfig.sourceLinkTemplate = `${GIT_URL}/blob/{gitRevision}/{path}#L{line}`;
76+
}
7077

7178
// Write updated config
7279
fs.writeFileSync(TYPEDOC_CONFIG, JSON.stringify(typedocConfig, null, 2) + "\n");

Ida/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"minor": "npm version minor --no-git-tag-version && git add package.json package-lock.json && node version-commit.js && node release.js",
1818
"major": "npm version major --no-git-tag-version && git add package.json package-lock.json && node version-commit.js && node release.js",
1919
"push": "git push --follow-tags",
20-
"docs": "node generate-readme.js && npx typedoc && npx open-cli ./docs/index.html",
20+
"docs": "node generate-readme.js && node generate-typedoc-config.js && npx typedoc && npx open-cli ./docs/index.html && rm README.md && node generate-typedoc-config.js --reset",
2121
"create": "node srcjs/create-mod/index.js",
2222
"publish:types": "node check-publish.js srcjs/types && node publish-package.js srcjs/types",
2323
"publish:types:dev": "node check-publish.js srcjs/types --dev-publish && node publish-package.js srcjs/types --dev",

Ida/typedoc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"excludeInternal": false,
1818
"excludePrivate": false,
1919
"excludeProtected": false,
20+
"customFooterHtmlDisableWrapper": true,
2021
"highlightLanguages": ["typescript", "javascript", "cpp", "bash", "json", "powershell", "cmd"],
2122
"navigationLinks": {
2223
"❤️ Support IdaJS ❤️": "https://innerbytes.com/#about",

0 commit comments

Comments
 (0)