Files
obsidian-typst-pdf-export/src/core/constants.ts
T
Jarvis 8879f40be5 fix: update ImageMagick to use 'magick' instead of deprecated 'convert'
- Update default ImageMagick executable from 'convert' to 'magick' in constants
- Remove deprecated 'convert' subcommand from ImageMagick spawn calls
- Update UI labels and settings descriptions to reflect 'magick' command
- Fix pdf2img PATH environment to include Node.js installation paths

This resolves ImageMagick v7 deprecation warning and fixes pdf2img execution
failure caused by missing Node.js in PATH. The 'convert' command was deprecated
in ImageMagick v7 in favor of the unified 'magick' command.

Fixes: "env: node: No such file or directory" error in pdf2img execution

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-08 10:55:27 +02:00

80 lines
1.4 KiB
TypeScript

/**
* Constants used throughout the Obsidian Typst PDF Export plugin
*/
/**
* Fallback fonts used when Typst font detection fails
*/
export const FALLBACK_FONTS = [
'Times New Roman',
'Arial',
'Helvetica',
'Georgia',
'Courier New',
'Monaco',
'SF Pro Text',
'SF Mono',
'Concourse OT',
'UbuntuMono Nerd Font Mono',
'Source Code Pro'
] as const;
/**
* Plugin-specific directory names
*/
export const PLUGIN_DIRS = {
TEMP_IMAGES: 'temp-images',
TEMP_PANDOC: 'temp-pandoc',
FONTS_CACHE: 'fonts-cache.json'
} as const;
/**
* Export-related constants
*/
export const EXPORT_CONSTANTS = {
DEFAULT_TIMEOUT: 120000, // 2 minutes
NOTICE_DURATION: {
SHORT: 5000,
LONG: 12000
}
} as const;
/**
* Dependency checking constants and utilities
*/
export const DEPENDENCY_CONSTANTS = {
/**
* Default executable names for dependencies
*/
DEFAULT_EXECUTABLES: {
pandoc: 'pandoc',
typst: 'typst',
imagemagick: 'magick'
},
/**
* Common paths to augment PATH with - these are always checked regardless of user settings
*/
COMMON_PATHS: {
/**
* Paths relative to home directory (will have HOME prepended)
*/
HOME_RELATIVE: [
'/.local/bin',
'/.cargo/bin',
'/go/bin',
'/.npm-global/bin'
],
/**
* System-wide absolute paths (used as-is)
*/
ABSOLUTE: [
'/usr/local/bin',
'/opt/homebrew/bin',
'/usr/bin',
'/bin',
'/opt/local/bin',
'/snap/bin'
]
}
} as const;