diff --git a/main.ts b/main.ts index a700c40..f0fc964 100644 --- a/main.ts +++ b/main.ts @@ -31,7 +31,12 @@ export default class MarkitdownPlugin extends Plugin { markitdownVersion: null, }; converter: MarkitdownConverter = new MarkitdownConverter('python', '.'); - private resolvedPythonPath = 'python'; + private _resolvedPythonPath = 'python'; + + /** The Python path actually used after discovery/fallback resolution. */ + get resolvedPythonPath(): string { + return this._resolvedPythonPath; + } async onload() { await this.loadSettings(); @@ -40,7 +45,7 @@ export default class MarkitdownPlugin extends Plugin { const depCheck = await checkDependencies(this.settings.pythonPath, pluginDir); this.dependencyStatus = depCheck.status; // Use the resolved python path (handles python→python3 fallback) - this.resolvedPythonPath = depCheck.resolvedPythonPath; + this._resolvedPythonPath = depCheck.resolvedPythonPath; this.converter = new MarkitdownConverter(this.resolvedPythonPath, pluginDir); // Ribbon icon @@ -232,7 +237,7 @@ export default class MarkitdownPlugin extends Plugin { const pluginDir = this.getPluginDir(); const depCheck = await checkDependencies(this.settings.pythonPath, pluginDir); this.dependencyStatus = depCheck.status; - this.resolvedPythonPath = depCheck.resolvedPythonPath; + this._resolvedPythonPath = depCheck.resolvedPythonPath; this.converter = new MarkitdownConverter(this.resolvedPythonPath, pluginDir); } diff --git a/src/settings/SettingsTab.ts b/src/settings/SettingsTab.ts index 7cc2a42..05e0ba5 100644 --- a/src/settings/SettingsTab.ts +++ b/src/settings/SettingsTab.ts @@ -60,6 +60,14 @@ export class SettingsTab extends PluginSettingTab { }, 1500); })); + // Show the resolved Python path when it differs from the configured path + const configuredPath = this.plugin.settings.pythonPath || 'python'; + const resolvedPath = this.plugin.resolvedPythonPath; + if (resolvedPath && resolvedPath !== configuredPath) { + const hint = containerEl.createDiv('markitdown-resolved-path-hint'); + hint.setText(`Resolved: ${resolvedPath}`); + } + // ── Conversion ────────────────────────── new Setting(containerEl) .setName('Conversion') diff --git a/styles.css b/styles.css index 2c297b6..7ed28f6 100644 --- a/styles.css +++ b/styles.css @@ -66,6 +66,16 @@ Styles for the Markitdown Obsidian plugin color: var(--text-error); } +/* Resolved Python path hint */ +.markitdown-resolved-path-hint { + font-size: 0.85em; + color: var(--text-muted); + margin-top: -8px; + margin-bottom: 12px; + padding-left: 2px; + font-family: var(--font-monospace); +} + /* File type checkbox grid */ .markitdown-checkbox-grid { display: grid;