Commit Graph
100 Commits
Author SHA1 Message Date
AlexKucera 9ca299cafd Fixes bibliography errors
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.
2025-11-04 10:57:24 +01:00
AlexKucera 8329c9dd48 Fixes path handling and adds remote image support
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.
2025-11-04 10:55:24 +01:00
AlexKucera 536351cbbf Updates repository URLs in README
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.
2025-09-26 07:47:35 +02:00
AlexKucera f1d545553b Merge pull request #5 from AlexKucera/1.3.0
Enhances path handling and file resolution
2025-09-25 16:47:12 +02:00
AlexKucera a1293808af Fixes CodeRabbit badge URL
Corrects the CodeRabbit badge URL in the README.
2025-09-25 16:19:48 +02:00
AlexKucera d20e8cf0ae Adds CodeRabbit Reviews badge to README
Includes a CodeRabbit Reviews badge in the README to provide quick access to code review insights.
2025-09-25 15:37:19 +02:00
AlexKucera e320238a79 Updates README downloads badge
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.
2025-09-21 22:09:16 +02:00
AlexKucera 09dff9f1fb Updates shields.io badge color
Updates the color parameter in the GitHub release badge URL to maintain consistency with the shields.io query parameter syntax.
2025-09-21 16:04:17 +02:00
AlexKucera bd2a54bb50 Merge branch 'feature/better_templates' into develop 2025-09-21 16:02:47 +02:00
AlexKucera 0a2a324d77 Updates plugin release badge URL
Updates the release badge URL in the README to point to the correct repository name.
2025-09-21 16:02:36 +02:00
AlexKucera 18c0e1736c Removes unused sharp dependency
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.
2025-09-21 16:02:32 +02:00
AlexKucera 4892b4a6c4 Adds Typst templates for varied document styles
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.
2025-09-21 16:02:27 +02:00
AlexKucera 9124531c58 Improves Typst error reporting in Pandoc conversion
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
2025-09-11 12:11:33 +02:00
AlexKucera 730e4997eb Merge branch 'master' into develop 2025-09-11 09:42:17 +02:00
AlexKucera 7aae2ce63a Enhances README with plugin motivation and benefits
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
2025-09-11 09:42:02 +02:00
AlexKucera dafa9c2caa Adds development philosophy section to README
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
2025-09-11 09:41:19 +02:00
AlexKucera 1d0c6c2541 Fixes typo in README Email Block support description
Corrects spelling of "Support" in feature description section

Improves documentation readability by fixing minor typographical error
2025-09-10 23:03:24 +02:00
AlexKucera a1d633772b Merge branch 'release/1.2.1' into develop 2025-09-10 23:00:56 +02:00
AlexKucera 75d6f3d002 Merge branch 'release/1.2.1' 2025-09-10 23:00:56 +02:00
AlexKucera 473f8e80a6 Merge branch 'master' into develop 2025-09-10 18:04:41 +02:00
AlexKucera 80fecbfab2 Merge branch 'master' into develop 2025-09-10 17:47:52 +02:00
AlexKucera 2a23bef0f9 Merge branch 'release/1.2.0' into develop 2025-09-10 16:58:35 +02:00
AlexKucera 61ebc10de9 Merge branch 'release/1.2.0' 2025-09-10 16:58:35 +02:00
AlexKucera 66d3210f1a Merge branch 'feature/refactor_large_files' into develop 2025-09-10 16:45:56 +02:00
AlexKucera bc836ae56b Merge branch 'release/1.0.2' 2025-09-08 11:03:12 +02:00
AlexKucera ebdfea0a33 Merge branch 'release/1.0.2' into develop 2025-09-08 11:03:12 +02:00
AlexKucera c0b45979eb Merge branch 'hotfix/dependency_fix' 2025-09-08 10:56:27 +02:00
AlexKucera 2fea3fdff3 Merge branch 'hotfix/dependency_fix' into develop 2025-09-08 10:56:27 +02:00
AlexKucera cd3ce0ec89 Add guidance.md to .gitignore
Excludes local guidance documentation from version control

Prevents potential sensitive or personal guidance notes from being tracked in the repository
2025-09-08 10:56:00 +02:00
AlexKucera 20e8c0ccf9 Merge branch 'feature/generic_embed' into develop 2025-09-05 18:32:35 +02:00
AlexKucera 31cbb0010e Merge branch 'develop' into feature/generic_embed 2025-09-05 18:03:49 +02:00
AlexKucera a37aef183c Merge branch 'master' into develop 2025-09-05 18:03:38 +02:00
AlexKucera 38fca744cd Improves plugin path resolution and versioning
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
2025-09-05 18:01:16 +02:00
AlexKucera 5f92a07a75 Merge branch 'hotfix/font_caching' into develop 2025-09-05 17:57:13 +02:00
AlexKucera 56ab1ae320 Merge branch 'hotfix/font_caching' 2025-09-05 17:57:13 +02:00
AlexKucera 5519c98957 Improves plugin directory path handling dynamically
Updates file path resolution to use plugin manifest directory dynamically

Replaces hardcoded plugin directory paths with more flexible approach
- Uses `this.manifest.dir!` to determine plugin directory
- Supports better cross-platform and installation compatibility
- Removes static path references in multiple plugin components

Enhances plugin robustness by making directory paths more configurable
2025-09-05 17:56:56 +02:00
AlexKucera 05f28f84f3 Add Generic File embedding 2025-09-05 17:41:18 +02:00
AlexKucera 3cff3ff70a Renames plugin to "Typst PDF Export"
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.
2025-09-05 16:57:23 +02:00
AlexKucera 2181b0cea3 Updates GitHub username in README
Updates the GitHub username in the README file to reflect the correct case.
2025-09-05 16:42:17 +02:00
AlexKucera fb843b490b Updates badges and license info in README
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.
2025-09-05 16:41:06 +02:00
AlexKucera b5387722cf Removes unnecessary console logs
Removes console log statements related to template extraction.

These logs were primarily for debugging and are no longer needed in the production code.
2025-09-05 16:15:44 +02:00
AlexKucera c0d9cff790 Shortens plugin name
Updates the plugin's display name for brevity in notices and settings.
2025-09-05 16:10:37 +02:00
AlexKucera 5c3cf06542 Simplifies release name generation
Removes the redundant "v" prefix from the release name and body within the release workflow, resulting in a cleaner and more consistent naming convention.
2025-09-05 16:10:30 +02:00
AlexKucera da678ada03 Updates export to use new settings structure
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.
2025-09-05 15:47:39 +02:00
AlexKucera d40253e6c4 Enhances template handling for Typst exports.
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.
2025-09-05 10:41:31 +02:00
AlexKucera 96660bfbba Prepares plugin for Obsidian submission
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.
2025-09-05 07:47:32 +02:00
AlexKucera 1dced48333 Improves export progress display
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.
2025-09-04 23:05:15 +02:00
AlexKucera d2eea5f2cb Improves export modal's progress display
Ensures the form container is hidden using CSS classes
during the export process to improve user experience.
2025-09-04 22:59:16 +02:00
AlexKucera e6c6cca5b8 Adds export modal display utilities
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.
2025-09-04 22:55:00 +02:00
AlexKucera 6ff1a24773 Removes excessive logging
Removes console log statements used for debugging during development, resulting in cleaner output and improved performance in production.
2025-09-04 22:48:55 +02:00
AlexKucera 21fdfbf207 Normalizes output folder path for settings
Ensures that the output folder path is normalized before being saved in the settings. This prevents issues with inconsistent or invalid paths.
2025-09-04 22:30:06 +02:00
AlexKucera 151dc537a5 Removes default hotkeys for export commands
Removes the default hotkeys assigned to the export commands.
This allows users to define their own preferred hotkeys
without being restricted by default settings.
2025-09-04 22:26:46 +02:00
AlexKucera f742f9b1ed Adds code fencing to email example
Adds code fencing to the email example within the documentation for clarity and proper rendering. This ensures the example is displayed correctly.
2025-09-04 17:21:36 +02:00
AlexKucera 4585cdd357 Replaces license with GPLv3
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.
2025-09-04 17:20:05 +02:00
AlexKucera 6273be7c22 Adds Email Block support
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.
2025-09-04 17:17:36 +02:00
AlexKucera a15caaef1e Adds type safety to process event handlers
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.
2025-09-04 16:40:02 +02:00
AlexKucera 2c5b916978 Improves resource path caching error handling
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.
2025-09-04 16:38:02 +02:00
AlexKucera 9285f1d852 Updates README for clarity and consistency
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.
2025-09-04 16:26:50 +02:00
AlexKucera 40a3c1b579 Updates eslint and globals dependencies
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.
2025-09-04 16:24:36 +02:00
AlexKucera f6f0979ad6 Migrates to flat ESLint configuration
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.
2025-09-04 16:24:18 +02:00
AlexKucera 436fd8ee23 Adds README and funding URLs to manifest
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.
2025-09-04 15:27:37 +02:00
AlexKucera 1b3f83e6e6 Improves export performance with resource path caching
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.
2025-09-04 15:17:35 +02:00
AlexKucera 6af3f74e68 Improves file access using asynchronous methods
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.
2025-09-04 15:09:56 +02:00
AlexKucera 557a0675be Refactors file stat to use async API
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.
2025-09-04 15:03:43 +02:00
AlexKucera b255b6354e Refactors batch export logic
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.
2025-09-04 15:01:06 +02:00
AlexKucera c872a56bc2 Improves error reporting for template loading.
Adds error message to the notice when loading templates fails, providing more context for debugging.
2025-09-04 14:36:41 +02:00
AlexKucera e48af55635 Adds robustness to file system operations
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.
2025-09-03 23:09:36 +02:00
AlexKucera 742b9a14c8 Adds user notification on font caching failure
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.
2025-09-03 23:05:51 +02:00
AlexKucera ddac8bd045 Cleans up temporary directories on startup/unload
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.
2025-09-03 23:02:11 +02:00
AlexKucera 42aa8e176c Adds output path validation for enhanced security
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.
2025-09-03 22:56:30 +02:00
AlexKucera d4c4a1be73 Refactors margin input settings
Introduces a helper function to streamline the creation of margin input settings in the plugin settings tab. This improves code readability and reduces redundancy.
2025-09-03 22:46:10 +02:00
AlexKucera f4d43a7236 Refactors typography settings with helper
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.
2025-09-03 22:41:29 +02:00
AlexKucera f00bc88bb2 Improves dependency checking security
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.
2025-09-03 22:33:29 +02:00
AlexKucera fcb62d5025 Enhances font caching with process spawning
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.
2025-09-03 22:31:35 +02:00
AlexKucera 5fed127ed0 Updates gitignore
Updates the .gitignore file to exclude the repomix output file. This prevents the repomix-output.xml file from being tracked in the repository.
2025-09-03 22:28:27 +02:00
AlexKucera 3f8f2b2089 Refactors project structure for improved modularity
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.
2025-09-03 22:05:45 +02:00
AlexKucera f05ffa8bc8 Refactors project structure and PDF embedding
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.
2025-09-03 22:05:32 +02:00
AlexKucera a676f7e6c4 Refactors PDF embed logic for Typst
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.
2025-09-03 19:54:06 +02:00
AlexKucera 2bf0e57cdc Refactors PDF path resolution
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.
2025-09-03 19:52:37 +02:00
AlexKucera a2020c90f3 Introduces temp directory management
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.
2025-09-03 19:48:43 +02:00
AlexKucera f9a6166da3 Centralizes export error handling
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.
2025-09-03 19:43:52 +02:00
AlexKucera 608a51b81e Refactors export modal settings preparation
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.
2025-09-03 19:38:43 +02:00
AlexKucera d0b096368f Refactors dependency checking into a class
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.
2025-09-03 19:35:07 +02:00
AlexKucera 5fc8e348f4 Refactors fallback fonts into a constant
Moves the list of fallback fonts to a dedicated constant file.
This improves code readability and maintainability by centralizing
this configuration.
2025-09-03 19:31:19 +02:00
AlexKucera ccc0e5aec6 Delete Unused Code 2025-09-03 19:23:44 +02:00
AlexKucera 42ad862ba0 Prioritizes config format in template variables
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.
2025-09-03 19:21:13 +02:00
AlexKucera 247d5add36 Removes backup file
Removes the backup file as it's no longer needed
2025-09-03 18:16:35 +02:00
AlexKucera a8035b1b33 Removes obsolete CLAUDE.md file
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.
2025-09-03 18:15:13 +02:00
AlexKucera 856a16330e Some more gitignored files 2025-09-03 18:13:59 +02:00
AlexKucera df59486b7f Removes gitignored files
removes file that were committed but are actually in gitignore
2025-09-03 18:12:56 +02:00
AlexKucera fd23b0be4b Adds ignore rules for various files
Extends the .gitignore file to exclude various temporary files, cache directories, and project-specific files, preventing them from being tracked by Git. This helps to keep the repository clean and focused on relevant source code.
2025-09-03 18:05:22 +02:00
AlexKucera 908c7c6fe6 Add release workflow 2025-09-03 17:58:52 +02:00
AlexKucera e12fb9d40a Updates minimum Obsidian version
Updates the minimum Obsidian version required to run the plugin
to 1.9.12 and marks the plugin as desktop only.

This ensures compatibility with newer Obsidian APIs and features,
and reflects that the plugin is intended for desktop use only.
2025-09-03 17:54:08 +02:00
AlexKucera 2f7d1feac8 Updates export command labels and descriptions
Refines the naming and descriptions of the export commands
to better reflect their functionality and improve user
understanding. The "Export current note to PDF" command is
now "Export current note(s)", and "Export to PDF with
configuration" is now "Export with configuration…".
2025-09-03 17:22:20 +02:00
AlexKucera 819b127987 Improves export config modal and template vars
Refactors the export configuration modal to provide a better user experience and more accurate default values.

- Removes the batch export feature from the right-click menu.
- Updates the template variables to derive from the settings tab.
- Modifies the reset function in the export config modal to reset to plugin defaults.
- Improves font handling and font size settings in the TypographySection of the export config modal, including slider for font size.
- Enhances default template variable initialization in the ModalState.
2025-09-03 17:04:29 +02:00
AlexKucera 05fd3d5db4 Adds .gitignore for cache directory
Prevents the cache directory from being tracked by Git,
improving repository cleanliness and reducing unnecessary
data in the repository.
2025-09-03 16:57:01 +02:00
AlexKucera 8678e110b9 Standardizes heading font size calculation
Removes configurable heading and small font sizes, and calculates the heading font size based on the body font size to ensure consistency across templates.
2025-09-03 16:56:53 +02:00
AlexKucera 26ddbb7f35 Enhances paper size selection and handling
Updates the paper size selection in settings and modals to use a predefined list of supported sizes, ensuring consistency across the plugin and compatibility with Typst.

It also maps the selected paper size to its Typst equivalent before passing it to the converter, preventing issues with unsupported sizes.
The change also ensures that template validation uses the correct paper sizes.
2025-09-03 14:35:34 +02:00
AlexKucera c749852125 Simplifies margin handling to use centimeters
Updates the margin settings to directly use centimeters, removing unnecessary conversions to points.
This simplifies the configuration and improves accuracy in setting page margins for PDF exports.
The settings tab and modal now accept and display margins in centimeters.
2025-09-03 13:59:35 +02:00
AlexKucera 4b4f0e55ed Uses page-margin variable for page margins
Replaces hardcoded page margin values with the `page-margin`
variable in the default and modern templates. This promotes
consistency and makes it easier to adjust margins globally.
2025-09-03 11:37:09 +02:00