From fed62b18bcecc57aac987b78cf38352595925c82 Mon Sep 17 00:00:00 2001 From: tomasalias Date: Sun, 25 Oct 2026 14:03:15 +0100 Subject: [PATCH] docs: rewrite documentation and README in clear, direct developer tone --- .gitignore | 2 + README.md | 12 ++-- docs/api/index.md | 64 +++++++++---------- docs/guide/installation.md | 100 +++++++++++++++--------------- docs/guide/plugins.md | 54 ++++++++-------- docs/guide/themes.md | 124 ++++++++++++++++++------------------- docs/index.md | 45 +++++++------- 7 files changed, 202 insertions(+), 199 deletions(-) diff --git a/.gitignore b/.gitignore index 996f489..1f04562 100644 --- a/.gitignore +++ b/.gitignore @@ -41,4 +41,6 @@ desktop.ini tools/ update_icon.bat update_icon.py +docs_for_claude.json + diff --git a/README.md b/README.md index 018be3d..d3fe560 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ and `themes/my-theme.css`: ### Writing a plugin -A plugin lives in its own subfolder in `plugins//` with a `manifest.json`, an `index.js`, and an optional companion `styles.css`. +A plugin lives in its own subfolder, `plugins//`, with a `manifest.json`, an `index.js`, and optionally a `styles.css`. `plugins/my-plugin/manifest.json`: @@ -121,10 +121,10 @@ plugin.onDisable = () => { #### What plugins can do -- **UI & DOM tweaks.** Inject custom buttons, badges, links, or panels into CurseForge using standard DOM APIs. If a `styles.css` is present in the plugin folder, it is automatically injected when enabled and removed when disabled. -- **Method patching.** Intercept, modify, or override internal JavaScript functions with `BetterCurseForge.patcher.before()`, `after()`, or `instead()`. -- **Persistent settings.** Store and read user preferences across restarts using `BetterCurseForge.settings.get(key)` and `set(key, value)`. -- **Event listening.** Hook into application lifecycle events using `BetterCurseForge.on(event, callback)`. +- **UI and DOM tweaks.** Add buttons, badges, links or panels with the normal DOM APIs. If the plugin folder has a `styles.css`, it's injected when the plugin is enabled and removed when it's disabled. +- **Method patching.** Hook into or replace internal JavaScript functions with `BetterCurseForge.patcher.before()`, `after()` or `instead()`. +- **Persistent settings.** Save and read preferences across restarts with `BetterCurseForge.settings.get(key)` and `set(key, value)`. +- **Events.** Listen for app lifecycle events with `BetterCurseForge.on(event, callback)`. ## Building from source @@ -142,7 +142,7 @@ The executable ends up in `dist/BetterCurseForge.exe`. ### Syncing changes from GitHub -To pull down updates made on GitHub: +To pull changes from GitHub: ```powershell git pull origin master diff --git a/docs/api/index.md b/docs/api/index.md index 1a75395..09e0de5 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -1,12 +1,12 @@ # API Reference -BetterCurseForge exposes a global runtime object on `window.BetterCurseForge` within the CurseForge Electron renderer process. This API allows themes, plugins, and developer scripts to inject styles, monkey-patch methods, manage settings, and listen to application events. +BetterCurseForge adds a global object, `window.BetterCurseForge`, to CurseForge's Electron renderer process. Themes, plugins and your own scripts can use it to inject styles, patch methods, read and write settings, and listen for events. --- -## TypeScript Definition +## TypeScript definitions -For TypeScript development and autocompletion: +If you're using TypeScript, this gives you types and autocompletion: ```typescript declare global { @@ -54,7 +54,7 @@ export interface BetterCurseForgeAPI { ### `BetterCurseForge.version` - **Type**: `string` -- **Description**: The currently running BetterCurseForge runtime version. +- **Description**: Version of the BetterCurseForge runtime that's currently running. ```javascript console.log(BetterCurseForge.version); // "1.0.0" @@ -64,11 +64,11 @@ console.log(BetterCurseForge.version); // "1.0.0" ### `BetterCurseForge.injectCSS(css)` -Dynamically injects CSS rules into the document ``. +Adds CSS rules to the document ``. - **Parameters**: - - `css` *(string)*: Raw CSS string to inject. -- **Returns**: `() => void` — Function that removes the injected `