Addresses potential resource leaks by ensuring that temporary
files and event listeners are properly cleaned up when the
converter is disposed. This prevents issues with multiple
conversions, especially on platforms like Windows where file
locking can occur.
The `uncaughtException` handler is removed to avoid
swallowing errors, and a flag is added to prevent double
cleanup.
Ensures that relative redirect URLs are resolved against the original image URL.
This prevents issues when downloading remote images from servers that return
relative redirect paths.
Ensures images without file extensions are properly handled by appending ".png" to the filename, preventing potential issues with image processing or display.
Preserves existing extensions for other image types (e.g., svg, ico, avif) without forcing a ".png" extension.
Adds comprehensive unit tests to improve code coverage for core functionalities: constants, paper size mapping, modal settings, security utilities, temporary directory management, and variable mapping.
This ensures that basic functionalities work as expected and enhances the reliability of the plugin.
Additionally, this commit includes a mock Obsidian API to facilitate testing in a non-Obsidian environment.
Removes unnecessary conditional logic when constructing paths for temporary directories.
The logic previously checked if the plugin directory was absolute before joining it with the directory name. This check is redundant as `path.join` correctly handles both absolute and relative paths.
Ensures that standard markdown images with remote URLs are processed for download after embeds and before wikilinks.
This ensures that remote URLs in the standard markdown format `` are correctly queued for download.
Consolidates local path resolution logic into a dedicated
`resolveLocalPath` method for improved code reuse and readability.
Improves image downloading by using the vault adapter to write
binary data, preventing potential data corruption.
This change addresses issues with image embed resolution,
especially for attachments in non-standard locations, and fixes
file overwriting during image downloads.
Simplifies the path joining logic by leveraging the built-in `path.join` method directly.
This change removes the manual iteration and absolute path handling, resulting in more concise and readable code.
Ensures correct path handling on Windows.
Refactors the code to leverage `path.join` for cross-platform path manipulation, especially improving handling of absolute paths on Windows.
Removes redundant normalizations and simplifies the logic for determining temporary directories. This change ensures consistent behavior across different operating systems and reduces code complexity.
Disables Pandoc's automatic citeproc filter to prevent errors
when processing documents without a bibliography file. This
resolves issues where Pandoc incorrectly detects citation-like
patterns in markdown and attempts to generate bibliographies,
leading to "document does not contain a bibliography" errors.
Addresses issues with path construction on Windows by using `path.isAbsolute()` to correctly handle absolute paths. Improves cross-platform compatibility in temp directory management and binary location.
Adds support for downloading and embedding remote images (http/https URLs) in markdown, enhancing content integration. Provides fallback mechanism with placeholder text upon download failure.
Updates the repository URLs in the README file to reflect the correct owner.
This ensures users are directed to the correct location for the project and its releases, especially for installation instructions.
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
Excludes local guidance documentation from version control
Prevents potential sensitive or personal guidance notes from being tracked in the repository
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.
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.
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.
Removes the default hotkeys assigned to the export commands.
This allows users to define their own preferred hotkeys
without being restricted by default settings.
Updates the project license to GNU GPLv3.
This change ensures that the software is distributed under a widely recognized and respected open-source license, granting users the freedoms to use, share, and modify the software.
Adds support for the YAML Email Block format, enabling users to easily incorporate pre-formatted email templates into their notes.
Provides documentation on how to use the feature.
Specifies the types for data and close events in process handlers.
This improves code clarity and maintainability by ensuring that the
data received from stdout and stderr streams is treated as a Buffer,
and the close event receives a number or null for the exit code.
Moves the catch block for resource path scanning to be inside the try block.
This ensures that errors during resource path caching do not prevent the timestamp from being updated, potentially leading to repeated scanning.
Refines the README to improve readability and maintain consistency.
- Rewrites the description for better clarity.
- Renames "Why Typst Over Standard PDF Export?" to "Why Typst?" for conciseness.
- Updates table of contents to reflect the new name and remove unnecessary characters.
- Replaces bullet points in the "Why Typst?" section with a more concise format.
- Adds installation instructions using brew for Pandoc, Typst and ImageMagick.
- Updates GitHub username in contact section.
Updates the eslint and globals dependencies in package.json and package-lock.json.
This change brings in the latest versions of these packages,
potentially including bug fixes, performance improvements, and new
features.
Updates ESLint configuration to the new flat config format.
This change removes the old `.eslintrc` and `.eslintignore` files and replaces them with a new `eslint.config.mjs` file.
This provides a more modern and flexible approach to ESLint configuration and should improve performance.
Adds a comprehensive README file detailing the plugin's features, installation, usage, and development.
Includes funding URLs in the manifest to allow users to support the project.
Implements a cache for resource paths to avoid rescanning the vault directory on every export.
This significantly improves the speed of subsequent exports,
especially when the vault contains a large number of files. The cache
expires after a configurable interval (default: 5 minutes) to ensure
that new or removed resources are eventually reflected.
Refactors file access operations to use asynchronous methods
instead of synchronous ones. This enhances performance and
responsiveness by preventing blocking operations, especially
during file system interactions.
The changes involve using `fs.promises.access` instead of
`fs.existsSync` and `fs.promises.mkdir` instead of
`fs.mkdirSync`. This ensures non-blocking file system operations
across the application, improving the overall user experience.
Updates file stat operation to use the asynchronous API
to prevent blocking the event loop during file system operations.
This improves the responsiveness of the application, especially
when dealing with potentially slow or numerous file system accesses.
Consolidates the export files and export files with configuration functionalities into a shared `processBatchExport` method.
This reduces code duplication and improves maintainability
by centralizing the batch processing logic.
Improves error handling when creating directories,
loading, and saving settings. This prevents crashes and
provides more informative error messages to the user.
Adds a try-catch block to `fs.statSync` to handle cases where a
file might be deleted between `readdirSync` and `statSync`,
preventing program termination.
Notifies the user when font caching fails, providing different levels of detail depending on whether debug mode is enabled.
This helps the user to be aware of potential font rendering issues and provides guidance on how to troubleshoot them.
Ensures temporary directories are cleaned up when the plugin loads and unloads, preventing potential issues from leftover files.
This addresses potential accumulation of temp files from previous sessions and on plugin disable.
Enhances security by validating output paths and executable paths.
This prevents path traversal attacks and command injection vulnerabilities
by ensuring that users can only specify valid relative paths within the vault
and safe executable paths. It also displays notices when the path is deemed unsafe.
Introduces a helper function to streamline the creation of margin input settings in the plugin settings tab. This improves code readability and reduces redundancy.
Uses a helper method to create the font dropdown settings, reducing code duplication and improving maintainability.
The shared logic for setting up font selection dropdowns is now encapsulated in a single function.
Replaces `child_process.exec` with `child_process.spawn` for both asynchronous and synchronous dependency checks.
This change mitigates potential command injection vulnerabilities by passing arguments separately, enhancing the security of the application.
Improves the font caching mechanism by using `child_process.spawn` instead of `child_process.exec` for enhanced security and reliability. This change also adds error handling for process spawning failures and includes the ability to set environment variables such as PATH.
Moves components and modules to more appropriate directories.
This change improves project organization and maintainability by grouping related files into logical directories, enhancing code discoverability and reducing potential naming conflicts.
Moves components and converters to more appropriate directories for better code organization.
Adds a dedicated function for copying images to the vault temp directory and generating relative paths, reducing code duplication and simplifying PDF embedding.
Introduces a helper function to generate Typst PDF embed syntax, including optional preview images and error handling.
This improves code readability and maintainability by centralizing the PDF embed logic.
Simplifies PDF embed processing by introducing a dedicated
`resolvePdfPath` method. This improves code readability and
maintainability by encapsulating the logic for finding PDF files
using different path resolution strategies. It also makes it easier to
test the path resolution logic independently.
Centralizes temporary directory creation and cleanup using a dedicated `TempDirectoryManager` class.
This change improves code maintainability and reduces redundancy by encapsulating temporary directory logic.
It also ensures that temporary directories are properly cleaned up after export operations, preventing potential disk space issues.
Introduces `ExportErrorHandler` to manage export-related errors, progress notices, and batch results.
This change provides a unified way to handle errors, display progress, and report results of export operations, improving code maintainability and user experience.
Introduces a helper class to encapsulate the logic for preparing the export configuration modal settings.
This improves code readability and maintainability by extracting the complex settings preparation logic from the main plugin file.
The helper handles both single and multi-file export scenarios, ensuring consistent settings across different export contexts.
Consolidates dependency checking logic into a dedicated `DependencyChecker` class.
This improves code organization and reusability.
It now uses a single method for checking all dependencies, both asynchronously (for displaying status) and synchronously (for startup checks).
It also augments the PATH environment variable to include common binary locations to improve detection.
The status modal now displays more detailed information about each dependency.
Ensures that the format specified in the export configuration
takes precedence over the default format specified in the settings
when populating template variables for PDF conversion.
Additionally, only uses the settings default for the export format
if one is not already provided.
Removes the CLAUDE.md file and adds it to .gitignore.
The CLAUDE.md file is no longer needed and is removed to clean up the repository.
Adding it to .gitignore prevents it from being accidentally re-added.