Merge branch 'develop' into feature/generic_embed
This commit is contained in:
12 files changed
+43
-29
No files matched your search
@@ -128,13 +128,14 @@ export class PdfToImageConverter {
|
||||
let pluginDir: string;
|
||||
|
||||
// Try multiple strategies to find the plugin directory
|
||||
const pluginDirName = this.plugin?.manifest?.dir || 'typst-pdf-export';
|
||||
const possiblePluginDirs = [
|
||||
// Strategy 1: From process.cwd() if it's in the vault
|
||||
path.join(process.cwd(), '.obsidian', 'plugins', 'obsidian-typst-pdf-export'),
|
||||
path.join(process.cwd(), '.obsidian', 'plugins', pluginDirName),
|
||||
// Strategy 2: Assuming we're running from vault root
|
||||
path.join('.obsidian', 'plugins', 'obsidian-typst-pdf-export'),
|
||||
// Strategy 3: Direct path if running in development
|
||||
'/Users/alex/Obsidian/Dev/.obsidian/plugins/obsidian-typst-pdf-export'
|
||||
path.join('.obsidian', 'plugins', pluginDirName),
|
||||
// Strategy 3: From vault base path if plugin is available
|
||||
...(this.plugin ? [path.join((this.plugin.app.vault.adapter as any).basePath, this.plugin.manifest.dir!)] : [])
|
||||
];
|
||||
|
||||
// Find the first directory that exists and has node_modules
|
||||
|
||||
@@ -7,7 +7,7 @@ import { PLUGIN_DIRS } from './constants';
|
||||
export interface TempDirectoryOptions {
|
||||
/** Base path for the vault */
|
||||
vaultPath: string;
|
||||
/** Plugin directory name (defaults to 'obsidian-typst-pdf-export') */
|
||||
/** Plugin directory name (defaults to 'typst-pdf-export') */
|
||||
pluginName?: string;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ export class TempDirectoryManager {
|
||||
|
||||
constructor(options: TempDirectoryOptions) {
|
||||
this.vaultPath = options.vaultPath;
|
||||
this.pluginName = options.pluginName || 'obsidian-typst-pdf-export';
|
||||
this.pluginName = options.pluginName || 'typst-pdf-export';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,7 +16,8 @@ export class TemplateManager {
|
||||
// Templates are stored in the plugin directory
|
||||
this.templatesPath = path.join(
|
||||
(this.plugin.app.vault.adapter as any).basePath,
|
||||
'.obsidian/plugins/obsidian-typst-pdf-export/templates'
|
||||
this.plugin.manifest.dir!,
|
||||
'templates'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ export class TypographySection implements ModalSection {
|
||||
try {
|
||||
// Access the plugin instance through the app
|
||||
// @ts-ignore - accessing private plugin manager
|
||||
const plugin = this.app?.plugins?.plugins?.['obsidian-typst-pdf-export'];
|
||||
const plugin = this.app?.plugins?.plugins?.['typst-pdf-export'];
|
||||
if (plugin && plugin.getCachedFonts) {
|
||||
return await plugin.getCachedFonts();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user