Standardizes terminology and error handling
Corrects capitalization inconsistencies in UI and documentation, improving clarity and professionalism. Enhances error handling in the image download function by properly rejecting promises on errors, thus increasing reliability and maintainability. Relates to obsidian-bot-review branch tasks.
This commit is contained in:
7 files changed
+27
-29
No files matched your search
+11
-15
@@ -28,10 +28,6 @@ export class ObsidianTypstPDFExportSettingTab extends PluginSettingTab {
|
||||
const { containerEl } = this;
|
||||
containerEl.empty();
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Typst PDF Export Settings')
|
||||
.setHeading();
|
||||
|
||||
// Executable paths section
|
||||
this.createExecutablePathsSection(containerEl);
|
||||
|
||||
@@ -66,9 +62,9 @@ export class ObsidianTypstPDFExportSettingTab extends PluginSettingTab {
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Pandoc path')
|
||||
.setDesc('Path to pandoc executable (leave empty to use system PATH)')
|
||||
.setDesc('Path to pandoc executable (leave empty to use system path)')
|
||||
.addText(text => text
|
||||
.setPlaceholder('pandoc')
|
||||
.setPlaceholder('Pandoc')
|
||||
.setValue(this.plugin.settings.pandocPath)
|
||||
.onChange(async (value) => {
|
||||
if (!SecurityUtils.validateExecutablePath(value)) {
|
||||
@@ -81,9 +77,9 @@ export class ObsidianTypstPDFExportSettingTab extends PluginSettingTab {
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Typst path')
|
||||
.setDesc('Path to typst executable (leave empty to use system PATH)')
|
||||
.setDesc('Path to typst executable (leave empty to use system path)')
|
||||
.addText(text => text
|
||||
.setPlaceholder('typst')
|
||||
.setPlaceholder('Typst')
|
||||
.setValue(this.plugin.settings.typstPath)
|
||||
.onChange(async (value) => {
|
||||
if (!SecurityUtils.validateExecutablePath(value)) {
|
||||
@@ -95,10 +91,10 @@ export class ObsidianTypstPDFExportSettingTab extends PluginSettingTab {
|
||||
}));
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('ImageMagick path')
|
||||
.setDesc('Path to ImageMagick executable (leave empty to use system PATH)')
|
||||
.setName('Imagemagick path')
|
||||
.setDesc('Path to imagemagick executable (leave empty to use system path)')
|
||||
.addText(text => text
|
||||
.setPlaceholder('magick')
|
||||
.setPlaceholder('Magick')
|
||||
.setValue(this.plugin.settings.executablePaths.imagemagickPath)
|
||||
.onChange(async (value) => {
|
||||
if (!SecurityUtils.validateExecutablePath(value)) {
|
||||
@@ -141,7 +137,7 @@ export class ObsidianTypstPDFExportSettingTab extends PluginSettingTab {
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Default template')
|
||||
.setDesc('Default Typst template for exports')
|
||||
.setDesc('Default typst template for exports')
|
||||
.addDropdown(async (dropdown) => {
|
||||
try {
|
||||
const templates = await this.plugin.templateManager.getAvailableTemplates();
|
||||
@@ -163,7 +159,7 @@ export class ObsidianTypstPDFExportSettingTab extends PluginSettingTab {
|
||||
} catch (error) {
|
||||
console.error('Failed to load templates:', error);
|
||||
// Fallback to text input
|
||||
dropdown.addOption('default.typ', 'default.typ');
|
||||
dropdown.addOption('default.typ', 'Default.typ');
|
||||
dropdown.setValue(this.plugin.settings.exportDefaults.template);
|
||||
}
|
||||
});
|
||||
@@ -182,10 +178,10 @@ export class ObsidianTypstPDFExportSettingTab extends PluginSettingTab {
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Output folder')
|
||||
.setDesc('Default folder for exported PDFs (relative to vault root)')
|
||||
.setDesc('Folder for exported pdfs (relative to vault root)')
|
||||
.addText(text => {
|
||||
text
|
||||
.setPlaceholder('exports')
|
||||
.setPlaceholder('Exports')
|
||||
.setValue(this.plugin.settings.outputFolder)
|
||||
.onChange(async (value) => {
|
||||
const normalizedValue = normalizePath(value);
|
||||
|
||||
Reference in new issue
Block a user