feat(config): surface optional anki/jimaku keys in example config

Add ankiConnect.deck, jimaku.apiKey, and jimaku.apiKeyCommand to the
defaults so they appear in the generated config.example.jsonc, and
change the static/animated image maxima (imageMaxWidth, imageMaxHeight,
animatedMaxHeight) from undefined to 0 so they render too. The resize
paths already treat 0 as "no limit", so this is behavior-neutral and
just improves discoverability of these previously-undocumented keys.
This commit is contained in:
2026-05-23 21:21:07 -07:00
parent 7e86c4ea3d
commit 4d1a20d69b
4 changed files with 42 additions and 6 deletions
+6
View File
@@ -488,6 +488,7 @@
"tags": [ "tags": [
"SubMiner" "SubMiner"
], // Tags to add to cards mined or updated by SubMiner. Provide an empty array to disable automatic tagging. ], // Tags to add to cards mined or updated by SubMiner. Provide an empty array to disable automatic tagging.
"deck": "", // Restrict duplicate detection and card enrichment to this Anki deck. Leave empty to search all decks.
"fields": { "fields": {
"word": "Expression", // Card field for the mined word or expression text. "word": "Expression", // Card field for the mined word or expression text.
"audio": "ExpressionAudio", // Card field that receives generated sentence audio. "audio": "ExpressionAudio", // Card field that receives generated sentence audio.
@@ -507,8 +508,11 @@
"imageType": "static", // Image capture type: "static" for a single still frame, "avif" for an animated AVIF. Values: static | avif "imageType": "static", // Image capture type: "static" for a single still frame, "avif" for an animated AVIF. Values: static | avif
"imageFormat": "jpg", // Encoding format used when imageType is "static". Values: jpg | png | webp "imageFormat": "jpg", // Encoding format used when imageType is "static". Values: jpg | png | webp
"imageQuality": 92, // Quality (0-100) used for lossy static image encoders. "imageQuality": 92, // Quality (0-100) used for lossy static image encoders.
"imageMaxWidth": 0, // Maximum width for static images, in pixels. Set to 0 to preserve the source resolution.
"imageMaxHeight": 0, // Maximum height for static images, in pixels. Set to 0 to preserve the source resolution.
"animatedFps": 10, // Target frame rate for animated AVIF captures. "animatedFps": 10, // Target frame rate for animated AVIF captures.
"animatedMaxWidth": 640, // Maximum width applied to animated AVIF captures. "animatedMaxWidth": 640, // Maximum width applied to animated AVIF captures.
"animatedMaxHeight": 0, // Maximum height for animated AVIF captures, in pixels. Set to 0 to preserve aspect ratio.
"animatedCrf": 35, // Animated AVIF CRF quality target. Lower values produce larger, higher-quality files. "animatedCrf": 35, // Animated AVIF CRF quality target. Lower values produce larger, higher-quality files.
"syncAnimatedImageToWordAudio": true, // For animated AVIF images, prepend a frozen first frame matching the existing word-audio duration so motion starts with sentence audio. Values: true | false "syncAnimatedImageToWordAudio": true, // For animated AVIF images, prepend a frozen first frame matching the existing word-audio duration so motion starts with sentence audio. Values: true | false
"audioPadding": 0.5, // Seconds of padding appended to both ends of generated sentence audio. "audioPadding": 0.5, // Seconds of padding appended to both ends of generated sentence audio.
@@ -555,6 +559,8 @@
// ========================================== // ==========================================
"jimaku": { "jimaku": {
"apiBaseUrl": "https://jimaku.cc", // Base URL of the Jimaku subtitle search API. "apiBaseUrl": "https://jimaku.cc", // Base URL of the Jimaku subtitle search API.
"apiKey": "", // Jimaku API key. Optional but recommended for higher rate limits. Get one for free at https://jimaku.cc.
"apiKeyCommand": "", // Shell command that prints the Jimaku API key to stdout. Used instead of apiKey to avoid storing the key in plain text.
"languagePreference": "ja", // Preferred language used in Jimaku search. Values: ja | en | none "languagePreference": "ja", // Preferred language used in Jimaku search. Values: ja | en | none
"maxEntryResults": 10 // Maximum Jimaku search results returned. "maxEntryResults": 10 // Maximum Jimaku search results returned.
}, // Jimaku API configuration and defaults. }, // Jimaku API configuration and defaults.
+6
View File
@@ -488,6 +488,7 @@
"tags": [ "tags": [
"SubMiner" "SubMiner"
], // Tags to add to cards mined or updated by SubMiner. Provide an empty array to disable automatic tagging. ], // Tags to add to cards mined or updated by SubMiner. Provide an empty array to disable automatic tagging.
"deck": "", // Restrict duplicate detection and card enrichment to this Anki deck. Leave empty to search all decks.
"fields": { "fields": {
"word": "Expression", // Card field for the mined word or expression text. "word": "Expression", // Card field for the mined word or expression text.
"audio": "ExpressionAudio", // Card field that receives generated sentence audio. "audio": "ExpressionAudio", // Card field that receives generated sentence audio.
@@ -507,8 +508,11 @@
"imageType": "static", // Image capture type: "static" for a single still frame, "avif" for an animated AVIF. Values: static | avif "imageType": "static", // Image capture type: "static" for a single still frame, "avif" for an animated AVIF. Values: static | avif
"imageFormat": "jpg", // Encoding format used when imageType is "static". Values: jpg | png | webp "imageFormat": "jpg", // Encoding format used when imageType is "static". Values: jpg | png | webp
"imageQuality": 92, // Quality (0-100) used for lossy static image encoders. "imageQuality": 92, // Quality (0-100) used for lossy static image encoders.
"imageMaxWidth": 0, // Maximum width for static images, in pixels. Set to 0 to preserve the source resolution.
"imageMaxHeight": 0, // Maximum height for static images, in pixels. Set to 0 to preserve the source resolution.
"animatedFps": 10, // Target frame rate for animated AVIF captures. "animatedFps": 10, // Target frame rate for animated AVIF captures.
"animatedMaxWidth": 640, // Maximum width applied to animated AVIF captures. "animatedMaxWidth": 640, // Maximum width applied to animated AVIF captures.
"animatedMaxHeight": 0, // Maximum height for animated AVIF captures, in pixels. Set to 0 to preserve aspect ratio.
"animatedCrf": 35, // Animated AVIF CRF quality target. Lower values produce larger, higher-quality files. "animatedCrf": 35, // Animated AVIF CRF quality target. Lower values produce larger, higher-quality files.
"syncAnimatedImageToWordAudio": true, // For animated AVIF images, prepend a frozen first frame matching the existing word-audio duration so motion starts with sentence audio. Values: true | false "syncAnimatedImageToWordAudio": true, // For animated AVIF images, prepend a frozen first frame matching the existing word-audio duration so motion starts with sentence audio. Values: true | false
"audioPadding": 0.5, // Seconds of padding appended to both ends of generated sentence audio. "audioPadding": 0.5, // Seconds of padding appended to both ends of generated sentence audio.
@@ -555,6 +559,8 @@
// ========================================== // ==========================================
"jimaku": { "jimaku": {
"apiBaseUrl": "https://jimaku.cc", // Base URL of the Jimaku subtitle search API. "apiBaseUrl": "https://jimaku.cc", // Base URL of the Jimaku subtitle search API.
"apiKey": "", // Jimaku API key. Optional but recommended for higher rate limits. Get one for free at https://jimaku.cc.
"apiKeyCommand": "", // Shell command that prints the Jimaku API key to stdout. Used instead of apiKey to avoid storing the key in plain text.
"languagePreference": "ja", // Preferred language used in Jimaku search. Values: ja | en | none "languagePreference": "ja", // Preferred language used in Jimaku search. Values: ja | en | none
"maxEntryResults": 10 // Maximum Jimaku search results returned. "maxEntryResults": 10 // Maximum Jimaku search results returned.
}, // Jimaku API configuration and defaults. }, // Jimaku API configuration and defaults.
@@ -24,6 +24,7 @@ export const INTEGRATIONS_DEFAULT_CONFIG: Pick<
upstreamUrl: 'http://127.0.0.1:8765', upstreamUrl: 'http://127.0.0.1:8765',
}, },
tags: ['SubMiner'], tags: ['SubMiner'],
deck: '',
fields: { fields: {
word: 'Expression', word: 'Expression',
audio: 'ExpressionAudio', audio: 'ExpressionAudio',
@@ -43,11 +44,11 @@ export const INTEGRATIONS_DEFAULT_CONFIG: Pick<
imageType: 'static', imageType: 'static',
imageFormat: 'jpg', imageFormat: 'jpg',
imageQuality: 92, imageQuality: 92,
imageMaxWidth: undefined, imageMaxWidth: 0,
imageMaxHeight: undefined, imageMaxHeight: 0,
animatedFps: 10, animatedFps: 10,
animatedMaxWidth: 640, animatedMaxWidth: 640,
animatedMaxHeight: undefined, animatedMaxHeight: 0,
animatedCrf: 35, animatedCrf: 35,
syncAnimatedImageToWordAudio: true, syncAnimatedImageToWordAudio: true,
audioPadding: 0.5, audioPadding: 0.5,
@@ -88,6 +89,8 @@ export const INTEGRATIONS_DEFAULT_CONFIG: Pick<
}, },
jimaku: { jimaku: {
apiBaseUrl: 'https://jimaku.cc', apiBaseUrl: 'https://jimaku.cc',
apiKey: '',
apiKeyCommand: '',
languagePreference: 'ja', languagePreference: 'ja',
maxEntryResults: 10, maxEntryResults: 10,
}, },
+24 -3
View File
@@ -58,6 +58,13 @@ export function buildIntegrationConfigOptionRegistry(
description: description:
'Tags to add to cards mined or updated by SubMiner. Provide an empty array to disable automatic tagging.', 'Tags to add to cards mined or updated by SubMiner. Provide an empty array to disable automatic tagging.',
}, },
{
path: 'ankiConnect.deck',
kind: 'string',
defaultValue: defaultConfig.ankiConnect.deck,
description:
'Restrict duplicate detection and card enrichment to this Anki deck. Leave empty to search all decks.',
},
{ {
path: 'ankiConnect.fields.word', path: 'ankiConnect.fields.word',
kind: 'string', kind: 'string',
@@ -200,14 +207,14 @@ export function buildIntegrationConfigOptionRegistry(
kind: 'number', kind: 'number',
defaultValue: defaultConfig.ankiConnect.media.imageMaxWidth, defaultValue: defaultConfig.ankiConnect.media.imageMaxWidth,
description: description:
'Optional maximum width for static images. Leave unset to preserve the source resolution.', 'Maximum width for static images, in pixels. Set to 0 to preserve the source resolution.',
}, },
{ {
path: 'ankiConnect.media.imageMaxHeight', path: 'ankiConnect.media.imageMaxHeight',
kind: 'number', kind: 'number',
defaultValue: defaultConfig.ankiConnect.media.imageMaxHeight, defaultValue: defaultConfig.ankiConnect.media.imageMaxHeight,
description: description:
'Optional maximum height for static images. Leave unset to preserve the source resolution.', 'Maximum height for static images, in pixels. Set to 0 to preserve the source resolution.',
}, },
{ {
path: 'ankiConnect.media.animatedFps', path: 'ankiConnect.media.animatedFps',
@@ -226,7 +233,7 @@ export function buildIntegrationConfigOptionRegistry(
kind: 'number', kind: 'number',
defaultValue: defaultConfig.ankiConnect.media.animatedMaxHeight, defaultValue: defaultConfig.ankiConnect.media.animatedMaxHeight,
description: description:
'Optional maximum height for animated AVIF captures. Leave unset to preserve aspect ratio.', 'Maximum height for animated AVIF captures, in pixels. Set to 0 to preserve aspect ratio.',
}, },
{ {
path: 'ankiConnect.media.animatedCrf', path: 'ankiConnect.media.animatedCrf',
@@ -344,6 +351,20 @@ export function buildIntegrationConfigOptionRegistry(
defaultValue: defaultConfig.jimaku.apiBaseUrl, defaultValue: defaultConfig.jimaku.apiBaseUrl,
description: 'Base URL of the Jimaku subtitle search API.', description: 'Base URL of the Jimaku subtitle search API.',
}, },
{
path: 'jimaku.apiKey',
kind: 'string',
defaultValue: defaultConfig.jimaku.apiKey,
description:
'Jimaku API key. Optional but recommended for higher rate limits. Get one for free at https://jimaku.cc.',
},
{
path: 'jimaku.apiKeyCommand',
kind: 'string',
defaultValue: defaultConfig.jimaku.apiKeyCommand,
description:
'Shell command that prints the Jimaku API key to stdout. Used instead of apiKey to avoid storing the key in plain text.',
},
{ {
path: 'jimaku.languagePreference', path: 'jimaku.languagePreference',
kind: 'enum', kind: 'enum',