mirror of
https://github.com/SillyTavern/SillyTavern-Pronouns.git
synced 2026-10-15 18:11:56 +00:00
[PR #9] [MERGED] Pronouns Extension v2.0 — Full Refactor: Macro Rename, Platform Compatibility, New Architecture #10
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
SillyTavern/SillyTavern-Pronouns#10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/SillyTavern/SillyTavern-Pronouns/pull/9
Author: @Wolfsblvt
Created: 4/11/2026
Status: ✅ Merged
Merged: 4/11/2026
Merged by: @Wolfsblvt
Base:
main← Head:dev📝 Commits (10+)
d8bd97drefactor: restructure repo, split into src/ + templates/, init hook, new macro architecturebca614cfeat: macro engine refactor — verb-be, contractions, settings migrationdf8d248feat: rename macros to camelCase, WyvernChat compat, Janitor fix, pre-processor73e6b62feat: WyvernChat Cap macros, Janitor poss_p fix, replacer rewrite, settings subheadingsefcdf0efix: use single quotes for consistency in getPrimaryMacroName default returna5ef178refactor: simplify CSS by removing redundant gap declarations, add margin to replacer buttone78c620fix: rename persona pronouns heading from 'Pronoun Settings' to 'Pronouns'00dcf59refactor: clean up macros.js file header comment562b48efeat: rewrite slash commands with helpString docs, fix shorthands logic, remove WyvernChat refs76097bddocs: update slash commands table in README📊 Changes
14 files changed (+1332 additions, -826 deletions)
View changed files
📝
README.md(+98 -46)📝
index.js(+43 -457)📝
manifest.json(+6 -3)➖
persona-pronouns.html(+0 -51)➖
pronounsSlashCommands.js(+0 -159)➖
settings.html(+0 -20)➕
src/macros.js(+252 -0)➕
src/pronouns.js(+259 -0)📝
src/replacer.js(+102 -82)➕
src/slash-commands.js(+282 -0)➕
src/ui.js(+201 -0)📝
style.css(+4 -8)➕
templates/persona-pronouns.html(+51 -0)➕
templates/settings.html(+34 -0)📄 Description
This PR is a complete overhaul of the Pronouns extension — a v2.0 rewrite covering architecture, macro naming, platform compatibility, slash commands, and documentation. The extension is fully restructured, all macro names are standardised, and platform-specific compatibility (WyvernChat, JanitorAI) is made explicit and opt-in where appropriate.
What Changed
Architecture & Project Structure
src/subfolder (pronouns.js,macros.js,ui.js,replacer.js,slash-commands.js)templates/subfolderindex.jsis now a slim entry point that exportsinit()for theactivatelifecycle hookmanifest.jsonupdated: display name set toSillyTavern Pronouns,hooks.activateadded, version bumped to2.0.0Macro Names — Renamed to camelCase
The primary macros are renamed to camelCase to align with WyvernChat's own pronoun placeholder names. This means WyvernChat character cards work out of the box without any compatibility toggle:
{{pronoun-subjective}}{{pronounSubjective}}{{pronoun-objective}}{{pronounObjective}}{{pronoun-pos-det}}{{pronounPosDet}}{{pronoun-pos-pro}}{{pronounPosPro}}{{pronoun-reflexive}}{{pronounReflexive}}{{pronoun-verb-be}}{{pronounVerbBe}}WyvernChat Compatibility
{{pronoun.subjective}},{{pronoun.objective}}, etc. are automatically rewritten to the camelCase names at runtime — WyvernChat cards using the older dot-notation work without any manual conversion or toggle.{{pronounSubjectiveCap}}etc.) available as an opt-in toggle for cards that use WyvernChat's capitalized placeholder names.JanitorAI Compatibility
{{sub}},{{obj}},{{pos}},{{poss_p}},{{ref}}) are behind a dedicated opt-in toggle.{{poss}}; corrected to{{pos}}(confirmed from JanitorAI's UI).Shorthand Macros — Simplified
{{she}},{{him}},{{their_}},{{hers}},{{himself}}, etc.) are registered as aliases when enabled.{{they_re}}etc.) removed — too grammar-specific to be a useful general feature.Settings — New Keys
enableShorthands(renamed fromenableWyvernShorthands)enableWyvernCompat(new — controls capitalized Cap variants)enableJanitorCompat(renamed fromenableJanitorShorthands)_curVersion— internal field stamped on every load with the running extension version, for use in future migration guardsenablePersonaShorthands) and early v2 (enableWyvernShorthands,enableJanitorShorthands) keysText Replacer Rewrite
pickShorthandAlias()introduced: matches by exact value against the correct shorthand group, handles trailing_on possessive determiner aliases correctlySlash Commands — Improved
resolveShorthandsArg()helper centralises shorthand toggle argument handling: warns the user and returns early (empty string) ifshorthands=trueis passed but the toggle is globally disabledhelpStringadded to all four commands with descriptions, behaviour notes, and usage examplesCommands:
/pronouns-set key=<key> <value>— set a single pronoun field/pronouns-set-preset <preset>— apply a preset (she/he/they/it)/pronouns-replace [shorthands] [preset] [subjective/objective/...] <text>— replace pronoun words in text with macros/pronouns-open-replacer [shorthands] [text]— open the replacer popupMinor Fixes & Polish
gapdeclarations removed, margin added to replacer buttonmanifest.json: requiredclient_versionset to1.13.5Why These Changes
The v1 macro names (
pronoun-subjectiveetc.) were inconsistent with both WyvernChat's naming and general camelCase conventions for SillyTavern macros. Since many users import WyvernChat cards, the primary macros now match WyvernChat exactly — no toggle, no conversion needed for the common case.The platform compatibility features (WyvernChat capitalized variants, JanitorAI macros) are opt-in because they register short or generic macro names that could collide with other extensions or user-defined macros. Making them explicit toggles gives users control and avoids silent conflicts.
The architecture refactor was needed to make the codebase maintainable — the original
index.jscontained everything in one 500-line file. Thesrc/split makes each concern independently readable and testable.Settings Migration
Existing users are migrated automatically on first load:
enablePersonaShorthands(v1) →enableShorthandsenableWyvernShorthands(early v2) →enableShorthandsenableJanitorShorthands(early v2) →enableJanitorCompatNo user action required.
Breaking Changes
{{pronoun-subjective}}etc.) will need to be updated to the new camelCase names. The old names are not aliased.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.