- Documents all CodeRabbit review improvements implemented
- Highlights Windows compatibility enhancements
- Details dynamic image format support and pattern matching
- Records cross-platform font discovery improvements
- Notes security and path validation enhancements
- Organizes changes by Added/Fixed/Changed/Security categories
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed vault.adapter operations to use vault-relative paths instead of absolute paths
- Added platform detection to cache data for invalidation on OS changes
- Enhanced error recovery with corrupted cache detection and automatic regeneration
- Improved cache validation with structure and content checks
- Added platform-specific PATH building for better Typst executable discovery
- Enhanced Windows, macOS, and Linux font path resolution
- Added comprehensive fallback mechanisms for all error scenarios
- Improved type safety and error handling throughout
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added pluginName parameter using manifest.id for proper temp directory namespacing
- Improves isolation when multiple similar plugins are installed
- Prevents temp directory conflicts between plugins
- Uses existing TempDirectoryOptions.pluginName field per CodeRabbit review
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added support for multiple image formats (.png, .jpg, .jpeg, .webp, .gif, .bmp, .tiff)
- Replaced hardcoded PNG-only filtering with dynamic extension detection
- Enhanced pattern matching with 5 progressive strategies:
1. Exact filename match
2. Base name match with any supported extension
3. Sanitized pattern match (removes special characters)
4. Fuzzy match for pdf2img patterns (handles -1, -page1 suffixes)
5. Fallback to first available image file
- Updated generateExpectedFilename with format validation and warnings
- Improved error messages to show supported formats and available files
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added support for Windows executable extensions (.cmd, .bat, .ps1, .exe)
- Implemented comprehensive fallback paths for different installation methods
- Enhanced binary discovery with Windows-specific npm locations
- Improved error reporting with detailed search path information
- Maintains backward compatibility for Unix-like systems
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Changed adapter.list() to use empty string for vault root instead of absolute path
- Convert vault-relative paths to absolute paths when returning for external tools
- Fixes cross-platform compatibility issues per CodeRabbit review
- Maintains existing functionality while following Obsidian API best practices
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Remove manual quotes around templatesDir path in PandocCommandBuilder
- Node.js spawn() handles argument quoting automatically
- Manual quotes can break path resolution, especially on Windows
- Follows Node.js best practices for child_process.spawn()
CodeRabbit suggestion implementation 1/6
- Fix pathUtils.fileExists() to handle absolute filesystem paths
- Add proper conversion from absolute to vault-relative paths
- Add fs fallback for external files outside vault
- Resolves 'File not found' errors for embedded PDF, image, and document files
- Maintains compatibility with both vault-relative and absolute paths
This fixes the path resolution issue that occurred after migrating to vault.adapter,
where embedded files were showing as 'not found' because absolute paths were being
passed to vault.adapter.exists() which only accepts vault-relative paths.
- Replace fs operations with vault.adapter methods
- Update constructor to require App parameter
- Make all methods async for vault.adapter compatibility
- Update PluginLifecycle.ts to match new async API
- Remove direct fs/path module dependencies
- Build and lint pass successfully
Safety commit 16/16 - Path migration complete!
- Replace fs.unlink/rename with vault.adapter methods when plugin available
- Replace path.join with PathUtils.joinPath for vault paths
- Add plugin parameter to optimizeImage method for vault.adapter access
- Keep path module for external tool operations
- Add fs fallbacks for temp file operations when plugin unavailable
- Use readBinary/writeBinary pattern for image file moves
- Update PdfToImageConverter.ts to pass plugin to ImageOptimizer
- Maintain dual approach for vault and external temp file handling
- Replace all fs operations with vault.adapter methods
- Replace fs.readdirSync with vault.adapter.list for directory scanning
- Replace fs.existsSync with PathUtils.fileExists
- Replace path.join with PathUtils.joinPath for vault paths
- Remove fs/fsPromises imports, add PathUtils import
- Add plugin parameter to constructor for vault.adapter access
- Update PandocCommandBuilder to pass plugin to ResourcePathResolver
- Maintain resource discovery functionality for Pandoc
- Replace fs.promises operations with vault.adapter methods
- Replace path.join with PathUtils.joinPath for temp file paths
- Replace fsPromises.writeFile/unlink with vault.adapter.write/remove
- Replace fsPromises.rmdir with PathUtils.cleanupDir
- Remove unused path and os imports
- Use TempDirectoryManager consistently for both fallback cases
- Replace path.join operations with PathUtils methods
- Remove path module import, use PathUtils for all path operations
- Already used vault.adapter correctly for file operations
- Maintain consistency with other migrated files
- Replace unsafe basePath cast with PathUtils.getVaultPath()
- Replace fs.existsSync with PathUtils.fileExists()
- Remove fs fallbacks since app is always available in Obsidian
- Keep path module for command-line path building
- Add proper null checking for plugin.app
- Replaced fs.promises.access with PathUtils.fileExists() for file existence checks
- Replaced fs.promises.mkdir with PathUtils.ensureDir() for directory creation
- Replaced fs.promises.copyFile with vault.adapter readBinary/writeBinary operations
- Replaced path.join with PathUtils.joinPath() for consistent path normalization
- Updated all file resolution methods to use proper Obsidian API methods
- Removed fs import and all direct filesystem operations
- Enhanced copyImageToVaultTemp to use vault.adapter for binary file operations
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Replaced multiple basePath hacks (lines 25, 70, 86) with PathUtils.getVaultPath()
- Replaced path.join with PathUtils.joinPath() and getPluginDir()
- Removed path import after migration to PathUtils
- Added PathUtils integration for consistent path operations
- All three basePath hack locations now use proper Obsidian API methods
- TempDirectoryManager calls already updated in previous commit
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Replaced basePath hack with PathUtils.getVaultPath() and getPluginDir()
- Replaced fs.existsSync with vault.adapter.exists() via PathUtils.fileExists()
- Replaced fs.readdirSync with vault.adapter.list() for directory listing
- Replaced fs.readFileSync with vault.adapter.read() for template content
- Replaced path.join with PathUtils.joinPath() for consistent normalization
- Removed fs import and all direct filesystem operations
- All template operations now use proper Obsidian API methods
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Replaced unsafe basePath hack with PathUtils.getVaultPath()
- Replaced fs.promises.access/mkdir with vault.adapter methods via PathUtils.ensureDir()
- Replaced path.join with PathUtils.joinPath() for consistent normalization
- Removed fs import and direct filesystem operations
- Simplified error handling with PathUtils abstraction
- All path operations now use proper Obsidian API methods
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Updated TempDirectoryManager to use vault.adapter methods exclusively
- Made all temp directory operations async (ensureTempDir, cleanupTempDir, cleanupAllTempDirs)
- Removed unnecessary fs fallback since App instance is always available in Obsidian plugins
- Updated calling code in PandocTypstConverter and ExportOrchestrator to handle async
- Updated PluginLifecycle cleanup methods to use fire-and-forget async pattern
- All path operations now use normalizePath for cross-platform compatibility
- Simplified interface - App parameter is now required as it should be
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add ABOUTME comments following guidelines
- Implement safe FileSystemAdapter access with proper type checking
- Use vault.adapter methods (exists, mkdir, list, remove)
- Use normalizePath() consistently for all paths
- Match existing patterns (cleanupDir only removes files, returns boolean)
- Add user-friendly error messages with Notice
- Place in src/core/ alongside other core utilities
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Updates the downloads badge in README to link directly to releases instead of the Obsidian plugins page.
This provides a more direct path to the plugin's release notes and associated files.
Removes the `sharp` dependency from the esbuild configuration.
This dependency was not being used, and its removal reduces the bundle size and improves build performance.
Introduces three new Typst templates: "book," "sidebar," and "two-column."
The "book" template emulates a classic book style with serif fonts, alternating margins, and running headers. It also includes features such as drop caps, email block styling, and a title page.
The "sidebar" template uses a modern sans-serif font and a prominent sidebar for navigation and document information.
The "two-column" template is designed for academic papers or CVs, using a two-column layout, serif fonts, and compact paragraph spacing.
Updates the "modern" template to use a different color scheme for headings and title block.
Replaces intermediate Typst file generation with enhanced diagnostic options
Adds short diagnostic format for better error reporting during Typst PDF engine conversion
Removes complex intermediate file generation and debug file copying logic
Simplifies command builder by focusing on diagnostic improvements
Adds detailed explanation of the plugin's purpose, highlighting key advantages over native Obsidian PDF export
Provides insights into the motivation behind creating the plugin, emphasizing:
- Professional typesetting quality
- Flexible document generation
- Separation of content and styling
- Continuous reading experience
Illustrates how the plugin transforms Obsidian into a more robust document preparation system
Documents AI-assisted development approach with emphasis on quality control
Explains the methodology behind the plugin's development, highlighting:
- Controlled AI code generation
- Strict review and validation processes
- Tools used to prevent low-quality code
- Commitment to maintaining high code standards
Details the systematic approach to leveraging AI while preserving code quality and architectural integrity
Fixes issue where horizontal rules (---) in markdown were causing
"Error parsing YAML metadata" when exporting to PDF via Pandoc.
Changes:
- Add HorizontalRuleProcessor to transform --- to *** before Pandoc
- Preserve YAML frontmatter by detecting and skipping frontmatter sections
- Add horizontalrule definition to all Typst templates for Pandoc compatibility
- Update universal wrapper to import horizontalrule from templates
- Clean up PandocTypstConverter formatting and remove debug output
The processor now detects YAML frontmatter patterns and only transforms
horizontal rules in content body, preventing destruction of document
frontmatter while resolving Pandoc parsing conflicts.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixes 23 TypeScript errors in 8 files by properly handling type assertions
and template variable types:
**DataAdapter Casting Issues (8 fixes):**
- Use double assertion `as unknown as { basePath: string }` instead of
direct casting to avoid TypeScript's type overlap validation
- Files: BinaryLocator, ExportOrchestrator, PathResolver, PluginLifecycle, TemplateManager
**Template Variables Type Issues (15 fixes):**
- Add `undefined` to Record<string, string|number|boolean> union type
- Convert template variable values to appropriate types before passing to UI methods:
- String() for dropdown setValue() methods
- Number() for slider setValue() methods
- Update interface definitions in modalTypes.ts and ModalState.ts
The double assertion pattern is required because basePath exists at runtime
in Obsidian's FileSystemAdapter but isn't in the TypeScript definitions.
Adding undefined to template variables properly handles uninitialized values.
All changes maintain full functionality while ensuring type safety.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Replace all @typescript-eslint/no-explicit-any warnings with proper type assertions
and union types to meet Obsidian plugin review requirements.
Changes:
- Replace (adapter as any).basePath with (adapter as { basePath: string }).basePath
- Change template variable types from Record<string, any> to Record<string, string | number | boolean>
- Change frontmatter types from Record<string, any> to Record<string, unknown>
- Fix error handling in PdfCliExecutor with proper type assertion
- Update method signatures in TypstVariableMapper for type safety
This eliminates all 42 @typescript-eslint/no-explicit-any warnings while
maintaining full functionality and improving type safety.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Remove unused imports and variables across multiple files
- Fix prefer-const warnings by changing let to const
- Remove unused catch block variables or convert to parameter-less catch blocks
- Update package-lock.json with TypeScript-ESLint v8 dependencies
- Reduce ESLint warnings from 42 to 22 (remaining are necessary 'any' types)
- All remaining warnings are for Obsidian API compatibility
Fixes improve code quality while maintaining functionality.
Remaining 'any' type warnings are appropriate for Obsidian plugin development.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Update TypeScript to v5.9.2 for compatibility with typescript-eslint v8
- Install typescript-eslint v8.43.0 for consolidated TypeScript ESLint support
- Rewrite eslint.config.mjs using modern flat config format without FlatCompat
- Incorporate Obsidian sample plugin ESLint rules and best practices:
* Allow @ts-ignore comments for Obsidian API quirks
* Allow require() imports for mixed module environment
* Allow empty functions common in plugin architecture
* Configure no-unused-vars as warnings with ignore patterns
- Configure proper Node.js and ES2022 globals
- Add comprehensive ignore patterns for build artifacts
- Reduce linting issues from 261 errors to 0 errors, 42 warnings
- All builds now pass with TypeScript checking and ESLint validation
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add missing ExportErrorHandler import in SettingsTab.ts
- Add customEnvironmentVariables property to settings interface
- Fix undefined metadata access with optional chaining in EmbedProcessor.ts
- Update ModalState.ts to use new nested settings structure
- Simplify ExportConfigModal.ts to use full settings object
- Add null safety checks for templateDropdown in GeneralSection.ts