- Remove extractTags() and calculateWordCount() methods (dead code)
- Keep only extractTitle() method in MetadataExtractor
- Remove includeMetadata option and related infrastructure
- Update PreprocessingResult interfaces across all processors
- Remove wordCount from metadata schema
- Tags still populated from frontmatter (FrontmatterProcessor)
- Build verification passes without errors
Analysis showed these methods extracted data never consumed by Typst
templates or PDF generation pipeline.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Extract embed processing logic from MarkdownPreprocessor to new EmbedProcessor module
- Fix WebP image conversion that was broken during refactoring:
- Update ImageMagick command from deprecated 'convert' to modern 'magick'
- Fix field name mismatch: use 'sizeOrAlt' instead of 'alt' in plugin/EmbedProcessor
- Use PathResolver for proper ImageMagick executable path resolution
- Restore comprehensive embed processing including images, PDFs, and files
- Add proper error handling and fallback for WebP conversion failures
- Maintain size parameter parsing (e.g., "400x300") vs alt text differentiation
Resolves WebP conversion issues and completes Step 2.3 of refactoring plan.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Extract comprehensive wikilink processing functionality into separate module:
- Move processWikilinks() method with complete implementation
- Extract sanitizeFilePath() as public method for reuse by embed processors
- Move sanitizeHeadingForLink() and resolveRelativePath() methods
- Remove duplicate WikilinkConfig interface
- Update all embed processors to use WikilinkProcessor.sanitizeFilePath()
- Add WikilinkProcessor configuration sync in updateConfig()
- Preserve all existing functionality and error handling
Reduces MarkdownPreprocessor from 895 to 816 lines (-79 lines).
WikilinkProcessor: 172 lines of focused wikilink processing logic.
Build passes successfully with no breaking changes.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Extract complete frontmatter processing functionality (260 lines) into a dedicated
FrontmatterProcessor module to improve code organization and maintainability.
Changes:
- Create src/converters/preprocessors/FrontmatterProcessor.ts with complete implementation
- Extract processFrontmatter() method including gray-matter and regex fallback parsing
- Extract formatFrontmatterForDisplay() method with all formatting logic
- Move FRONTMATTER_PATTERN regex and all frontmatter-related dependencies
- Update MarkdownPreprocessor.ts to delegate to FrontmatterProcessor
- Reduce MarkdownPreprocessor.ts from 1,166 to 906 lines (22% reduction)
All functionality preserved:
- Gray-matter primary parsing with js-yaml fallback
- Tag extraction and metadata population
- Title override and noteTitle handling
- preserveFrontmatter and printFrontmatter options
- Error handling and warning accumulation
- Fallback regex parsing for malformed YAML
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add app.metadataCache.getFirstLinkpathDest() as primary resolution strategy
- Fix path resolution issues after folder/note renames
- Update both resolvePdfPath and resolveFilePath methods consistently
- Maintain filesystem fallbacks for backward compatibility
- Resolves "PDF not found" errors when attachment folders are renamed
- Now uses Obsidian's native link resolution algorithm
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Reduce file type classification from 6+ types to 3: image, pdf, file
- Remove processVideoEmbed, processAudioEmbed, processDocumentEmbed methods
- Fix DOCX files not being embedded (were classified as 'document' → links only)
- All non-image/non-PDF files now properly embedded via processFileEmbed
- Update switch statement to handle only the 3 simplified file types
- Maintain backward compatibility for existing functionality
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Move showDependencyStatus() and checkDependenciesAsync() from main.ts to DependencyChecker.ts as static methods
- Replace 31-line implementations with 12-line delegation calls in main.ts
- Add necessary imports (Notice, ExportErrorHandler) to DependencyChecker.ts
- Maintain same public API while improving separation of concerns
- Reduce main.ts from 280 to 253 lines (total 79% reduction from original 1233 lines)
This completes Step 1.10 of the refactoring plan, achieving clean delegation
of dependency management functionality while preserving backward compatibility.
Build verified: ✅ TypeScript compilation successful
Extract the complete settings UI class (427 lines) from main.ts into
src/plugin/SettingsTab.ts to improve maintainability and reduce file size.
Changes:
- Create src/plugin/SettingsTab.ts with full settings UI implementation
- Remove ObsidianTypstPDFExportSettingTab class from main.ts
- Add import for extracted SettingsTab class
- Maintain all existing functionality and UI sections
Build verified: npm run build passes successfully
Line reduction: main.ts reduced from 1233 to 805 lines (-428 lines)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Extract all font management functionality from main.ts into a focused
FontManager module to improve maintainability and reduce complexity.
- Create FontManager.ts with font discovery and caching logic
- Extract cacheAvailableFonts() and getCachedFonts() methods
- Add getAvailableFonts() wrapper method for consistent API
- Delegate font operations from main.ts to FontManager
- Fix initialization order: FontManager before PluginLifecycle
- Make resolveExecutablePath() public for FontManager access
- Reduce main.ts by ~115 lines while maintaining all functionality
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Extract all export orchestration methods from main.ts into a focused
ExportOrchestrator module to improve maintainability and reduce complexity.
- Create ExportOrchestrator.ts with export workflow coordination
- Extract exportFile(), exportFiles(), exportFileWithConfig() methods
- Extract processBatchExport(), cancelExport(), handleFolderExport() methods
- Delegate export operations from main.ts to ExportOrchestrator
- Make processing methods public for ExportOrchestrator access
- Reduce main.ts by ~205 lines while maintaining all functionality
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Extract event handling logic into focused EventHandlers module:
- Create src/plugin/EventHandlers.ts for menu and ribbon handlers
- Move registerEventHandlers() and handleRibbonClick() methods
- Make exportFile(), exportFiles(), showExportModalForFiles(), isMarkdownFile() public
- Reduce main.ts by ~100 lines, improving maintainability
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Extract command registration logic into dedicated CommandRegistry
class to improve separation of concerns and reduce main.ts complexity.
- Create src/plugin/CommandRegistry.ts (~35 lines)
- Move registerCommands() method to CommandRegistry
- Extract all 3 command definitions with callbacks:
* export-current-note
* export-with-config
* check-dependencies
- Update main.ts to delegate to CommandRegistry
- Change exportCurrentNote() and showExportModal() to public
- Remove old registerCommands() method from main.ts
Part of comprehensive refactoring plan (main.ts: 1792 lines → 6 modules).
Step 1.2 complete. Commands functionality preserved.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Extract plugin initialization and cleanup logic into dedicated
PluginLifecycle class to reduce complexity of main.ts file.
- Create src/plugin/PluginLifecycle.ts (~100 lines)
- Move onload/onunload initialization logic
- Move template extraction and component setup
- Move dependency checking and font caching
- Update main.ts to delegate to lifecycle manager
- Change methods to public visibility where needed
Part of comprehensive refactoring plan to break down large files
(main.ts: 1792 lines → 6 focused modules). Step 1.1 complete.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Update CHANGELOG.md with comprehensive 1.1.0 release notes
- Add Generic File Embedding feature to Key Features in README.md
- Document all major fixes and improvements since 1.0.1
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Excludes local guidance documentation from version control
Prevents potential sensitive or personal guidance notes from being tracked in the repository
- 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>
- Add support for user-configured additionalPaths in dependency checking
- Implement comprehensive default system paths (home-relative and absolute)
- Update path resolution to handle both full paths and bare executable names
- Use 'which' command fallback with augmented PATH for executable discovery
- Ensure consistent path handling across sync and async dependency methods
This resolves issues where executables installed in common locations like
/opt/homebrew/bin were not found when executable path settings were empty.
The plugin now searches standard package manager installation directories
by default while respecting user-configured additional paths.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Replace hardcoded '.obsidian' paths with Vault#configDir for proper config directory support
- Move inline styles to CSS classes for better theme compatibility
- Remove unnecessary type casting by using proper type predicates
- Add proper TypeScript type narrowing for filtered arrays
This addresses all required issues identified by the Obsidian Review Bot:
* TempDirectoryManager now accepts configDir parameter from app.vault.configDir
* PdfToImageConverter uses configDir instead of hardcoded '.obsidian'
* ExportConfigModal uses CSS classes (.export-progress-visible, .export-form-hidden) instead of inline styles
* Progress bar width controlled via CSS custom property --progress-width
* Removed 'as TFile[]' casting by implementing isMarkdownFile type predicate
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixes dynamic path detection for plugin resources
Updates version to 1.0.1 across manifest files
Adds version compatibility mapping
Resolves issues with hardcoded directory paths
Ensures more robust plugin directory detection and resource loading
Updates the plugin's name from "Obsidian Typst PDF Export" to "Typst PDF Export".
This change simplifies the plugin's identifier and display name,
making it more concise and user-friendly. It involves updates to
the manifest file, plugin configuration, and references within the
codebase.
Updates the badges in the README to reflect current project status, including download stats and license information.
Changes the project license to GNU GPL v3.0 and updates the license badge accordingly.
Removes console log statements related to template extraction.
These logs were primarily for debugging and are no longer needed in the production code.
Removes the redundant "v" prefix from the release name and body within the release workflow, resulting in a cleaner and more consistent naming convention.
- Fix shell quote escaping in CHANGELOG extraction
- Update to modern softprops/action-gh-release@v1
- Simplify asset uploads with files parameter
- Improve error handling and compatibility
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add template embedding system features
- Document automated release workflow
- Note export consistency fixes
- Update installation and distribution details
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Updates the export file function to utilize the new settings structure for page setup and typography.
This change ensures consistency with the modal settings and simplifies the configuration process.
Implements dual-strategy template distribution for reliable plugin deployment:
Template Embedding System:
- Add esbuild plugin to embed .typ templates as base64 strings in main.js
- Create EmbeddedTemplateManager for automatic template extraction
- Add TypeScript declarations for virtual template-embed module
- Templates auto-extract on plugin load if missing from disk
Release Automation:
- Add GitHub Actions workflow for automated ZIP releases
- Create package-plugin.js script for complete distribution packages
- Update version-bump.mjs for Obsidian-compliant tags (no 'v' prefix)
- Ensure releases include templates/ directory for manual installations
Documentation Updates:
- Comprehensive installation instructions with troubleshooting
- Clear warnings about requiring complete ZIP packages
- Multiple installation methods including manual and automated
This ensures the plugin works regardless of installation method:
- ZIP releases provide templates/ directory (primary method)
- Embedded templates auto-extract as fallback (secondary method)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Improves template resolution for Typst exports by adding the plugin's templates directory as a resource path. This allows Typst to correctly locate and utilize template files within the plugin.
Updates the template path handling to use relative paths from the vault root, ensuring proper import behavior within Typst.
Updates the plugin to comply with Obsidian's plugin submission requirements.
This includes removing debug logging, addressing path handling, and improving modal display logic. Also replaces the plugin license from MIT to GPLv3, adds PDF embedding controls, improves export progress display, and enhances resource path caching.
Removes default hotkeys and sharp dependency. Addresses cross-platform path compatibility and enhances security with path validation and sanitization.
Updates the export config modal to hide the form and show the progress container by modifying the display properties.
It ensures that only one section is visible at any given time for a cleaner user experience.
Adds CSS classes to control the visibility of the export modal and styles the progress bar.
This allows for dynamically showing and hiding the modal and provides a visual cue for export progress.