Commit graph

46 commits

Author SHA1 Message Date
JK
e427438d1f fix lint II 2026-06-04 21:26:06 +02:00
JK
157c0b57ab lin fix I 2026-06-04 21:01:36 +02:00
JK
b6392a5523 refactor: reorganize src into modular structure and increase test coverage 2026-06-04 20:50:07 +02:00
JK
88cb4e38d5 fix lint more updating 2026-06-04 20:12:07 +02:00
JK
bcc1be7933 updating the plugin 2026-06-04 20:12:07 +02:00
JK
ad4ad7969b feat(tikz): add export SVG functionality and enhance overlay header 2026-06-04 20:12:07 +02:00
JK
4fb6142978 Fix tikz for PDF printing 2026-06-04 20:12:06 +02:00
JK
f1d2e81e85 feat(row-layout): enhance column formatting and width handling in row layout 2026-06-04 20:12:06 +02:00
JK
ff059cdf28 fix(tikz): prevent uncaught null reference errors in tikzjax-load-finished event 2026-06-04 20:12:06 +02:00
JK
efa8d8f94a feat(tikz): add TikZ live preview overlay functionality 2026-06-04 20:12:06 +02:00
JK
096e18bd3c fix flickering when typing outside the live render 2026-06-04 20:12:06 +02:00
JK
57f99e33fd feat(tikz): add support for fetching and applying TikZJax CSS styles 2026-06-04 20:12:06 +02:00
JK
c548bac003 feat(row-layout): aggressively compress vertical spacing for row layout
- Adds a `tightenColumn` helper to override and clear margins/paddings on all inner elements (paragraphs, math blocks, code wrappers, SVGs, MathJax containers).
- Executes spacing compression at delayed intervals (0ms, 50ms, 150ms, 500ms) to ensure late-rendered asynchronous elements are properly shrunk.
- Pulls surrounding paragraph text closer by setting the row element margin to `-0.5em 0`.
- Ensures proper component cleanups via `ctx.addChild` and `destroy()` to prevent memory leaks.
2026-06-04 20:12:06 +02:00
JK
2c48c019f0 feat(row-layout): add side-by-side row layout for Reading View and Live Preview
- Implements support for `;;;row: [widths]` and `;;` columns to render side-by-side layouts dynamically.
- Integrates a CodeMirror 6 `StateField` using `Decoration.replace` for Live Preview, enabling seamless inline layout folding.
- Adds click-to-edit handling which dispatches selection to the raw source code when clicking a rendered layout.
- Ensures robust component lifecycle management: tracks and unloads rendering components via `destroy()` in Live Preview widgets and `ctx.addChild` in Reading View to prevent memory leaks.
- Bumps manifest.json to v2.3.0.
2026-06-04 20:12:06 +02:00
JK
a460ca5bea feat: implement robust offline-first TikZ diagram rendering support
- Added a modular `TikzRenderer` in `src/features/tikz/renderer.ts` to process `tikz` code blocks.
- Fetches and caches the offline-friendly, self-contained 7MB TikZJax JS engine from artisticat1/obsidian-tikzjax.
- Dynamically patches the engine's initialization to execute immediately (bypassing window.onload and document.readyState race conditions).
- Implements a programmatic `TikzJaxCleanup` function that terminates WebAssembly worker pools and disconnects MutationObservers when the plugin unloads, supporting safe Hot Reloads.
- Simplifies block element styling to render transparently and center-aligned, matching standard notes.
- Added Settings UI controls (`enableTikzjax` and `invertColorsInDarkMode`) to manage diagram color inversion and toggle rendering status.
- Integrated `TikzRenderer` setup and cleanup into the main plugin lifecycle.
2026-06-04 20:12:06 +02:00
JK
451ff80edf feat: implement custom note management with hotkey support 2026-06-04 20:12:06 +02:00
JK
ed45018fdc fix: update regex for equation links to correctly handle sub-indices 2026-06-04 20:12:05 +02:00
JK
c5786a8913 fix lazy multiline latex in callout leads to corrupt live preview 2026-06-04 20:12:05 +02:00
JK
6018bd89a5 feat: add Zotero cleanup feature to remove duplicate annotations from active note 2026-06-04 20:12:05 +02:00
JK
e1f8b1831b feat(snippets): add 'Clean Double Dollar Symbols' text transform snippet 2026-06-04 20:12:05 +02:00
JK
80f7042a57 feat(snippets): streamline snippet management and introduce text transformation features 2026-06-04 20:12:05 +02:00
JK
d1d809f029 fix(live-preview): fixed cursor kicking when editing referenced block 2026-06-04 20:12:05 +02:00
JK
bcc862731a feat(equation-cache): NO VAULT WIDE scans at startup; remove EquationCache and integrate equation processing directly in LatexLinkProvider 2026-06-04 20:12:05 +02:00
JK
bd877592c0 fix(equations): enhance handling of list sections in equation processing 2026-06-04 20:12:05 +02:00
JK
a3d9e1e494 fix(callout): Implement custom rendering for equation links and numbers in dynamically rendered callouts. 2026-06-04 20:12:05 +02:00
JK
9d9889e99c feat(pdf-export): improve modal layout and preview sizing
- Refactor export modal to use a 2-column flex layout (preview left, settings right).
- Increase modal dimensions to 90vw width and 90vh height for better visibility.
- Fix PDF preview sizing to ensure full width and height are visible by calculating webview height from physical page dimensions.
- Remove padding and alignment constraints from the preview container to maximize space.
2026-06-04 20:12:04 +02:00
JK
8512d8158b feat: add custom LaTeX snippets feature with hotkey support
- Add `Snippet` interface and persistent storage in settings
- Implement `SnippetManager` to handle snippet logic and command registration
- Add settings UI for creating, editing, and deleting snippets
- Add `SnippetSuggestModal` for fuzzy searching and inserting snippets
- Register "Insert Snippet" command and individual commands for each snippet to enable custom hotkey assignments
2026-06-04 20:12:04 +02:00
JK
138e40e4b2 fix: resolve pdf export issues and callout math formatting validation
Major fixes including:
- fix(pdf): remove legacy rendering hack that caused export failures in newer Obsidian versions
- fix(core): ensure auto-injected IDs and tags correctly inherit callout indentation (fixes "zombie lines" and broken previews)
- feat: add "Fix callout equations in active note" command to repair existing malformed content
- refactor: centralize callout parsing logic in `src/utils/parse.ts` for SOLID/DRY compliance
2026-06-04 20:12:04 +02:00
JK
a35f355956 fixed mathblock obsidian problem when mathJax inside codeblock doesnt start with > 2026-06-04 20:12:04 +02:00
JK
b3aec3f6c3 fixed rendering in Callout Manager 2026-06-04 20:12:04 +02:00
JK
e8e9b3e93e Fixed pdf export 2026-06-04 20:12:03 +02:00
JK
47b7ad4639 fix: obsidian-export-better-pdf updated syntax to match latest version of node libs 2026-06-04 20:12:03 +02:00
JK
e4d60f4d65 feat: adding obsidian-better-export-pdf 2026-06-04 20:12:03 +02:00
JK
06ffb81f65 feat: Quick Preview external dependency removed
- Added new modules for Quick Preview:
  - `hoverParent.ts`, `patcher.ts`, `popoverManager.ts`, `types.ts`, and `utils.ts`.
- Updated `declarations.d.ts` with reusable `Suggestions` interface for type safety.
- Removed `obsidian-quick-preview` dependency from `main.ts`.
- Integrated internal Quick Preview patcher for `LinkAutocomplete` and `MathSearchModal`.
- Improved item normalization for precise linking via block IDs.
- Enhanced modularity and user experience with better hover popover management.
2026-06-04 20:12:03 +02:00
JK
230193aa1d refactor: remove legacy styles and enhance search functionality
- Deleted unused CSS/SCSS files: generated-styles.css, obsidian-styles.css, styles.scss, framed.scss, plain.scss, mathwiki.scss, vivid.scss, and main.css.
- Introduced new `main.css` with optimized styles for equation numbering, theorem callouts, and dependency validation.
- Updated esbuild.config.mjs to copy `main.css` to the development vault.
- Simplified `renderSuggestion` in `core-search.ts` and removed redundant class logic in `modal.ts`.
- Streamlined styling and improved maintainability while enhancing search behavior.
2026-06-04 20:12:03 +02:00
JK
74292ebc70 cleanup: Remove unused code and simplify utilities
- Removed unused module declaration in `src/declarations.d.ts`.
- Cleaned up `live-preview-equations.ts` by removing unused imports and the `EquationNumberWidget` class.
- Simplified `editor.ts` by removing redundant utility functions.
- Streamlined `general.ts` by eliminating unused helper functions.
- Refactored `obsidian.ts` to remove obsolete file utilities, cache/metadata handlers, and markdown view helpers.
- Deleted the `parseLatexComment` function from `parse.ts`.
- Removed the `render.ts` file, which contained unused rendering utilities.
- Overall, reduced code clutter and improved maintainability.
2026-06-04 20:12:03 +02:00
JK
31008d1443 refactor: remove legacy equation and search modules; update imports for new feature structure
- Deleted `numbering.ts`, `reading-view.ts`, and `core.ts`, removing outdated logic for equation numbering and search.
- Updated `main.ts` to use new import paths under `features/` directory.
- Removed references to deleted modules and ensured all imports reflect the reorganized feature-based structure.
- Internal refactor to modularize and modernize the codebase; no user-facing features affected.
2026-06-04 20:12:02 +02:00
JK
83f425243a feat: remove MathLinks integration and related code
- Deleted `cleveref.ts` and removed `CleverefProvider` class.
- Removed `obsidian-mathlinks` dependency from package.json.
- Cleaned up `main.ts` by removing MathLinks imports, registration logic, and user notices.
- Refactored `live-preview-link-renderer.ts` to simplify link decoration logic and remove verbose debug logs.
- Removed all MathLinks-related code paths and settings.
- Plugin now fully relies on its own equation reference logic for rendering and linking.
2026-06-04 20:12:02 +02:00
JK
4eb40c41e2 feat: add sub-equation reference support and improve equation tagging logic
- Updated reference parsing to support sub-equation links (e.g., [[#^eq-abc-2]]).
- Enhanced tag manager to handle multi-tagging with sub-indices (e.g., \tag{1.2}).
- Improved single-tag logic for consistent cleanup and insertion.
- Propagated sub-index data through numbering.ts and provider.ts.
- Extended `EquationBlock` with `$subIndices?: Set<number>` for granular tracking.
- Modified reading view to suppress numbering for sub-indexed equations.
- Refactored block ID insertion to use comment format (`% id: eq-...`) before closing $$.
- Cleaned up legacy code and improved comments for clarity and consistency.
2026-06-04 20:12:02 +02:00
JK
f8b3725ae3 refactor: improve equation numbering logic and consistency across views
- Rewrote live preview equation numbering using `EquationInfo` and a robust math block parser.
- Added `TagManager` to manage `\tag{...}` commands based on reference counts and settings.
- Injected unique internal IDs into all math blocks.
- Enhanced `processActiveNoteEquations` to support both legacy and new-style equation links.
- Refactored reading view processor to read file content directly, supporting embeds, hover preview, and PDF export.
- Improved mapping of math block positions to equation numbers, avoiding duplicates.
- Ensured consistent equation referencing and numbering across all plugin views.
- Cleaned up and modularized code for better maintainability and future extensibility
2026-06-04 20:12:02 +02:00
JK
e31a9b0cb2 refactor: streamline equation referencing and plugin settings
Simplified plugin settings:
- Replaced multi-profile settings with a single `PluginSettings` object.
- Removed legacy fields and logic (e.g., `extraSettings`, `indexManager`, theorem/proof callouts).
- Flattened settings structure for easier loading/saving.

Standardized equation types:
- Unified all equation-related types to use `EquationBlock` from `types`.
- Updated imports across cleveref.ts, provider.ts, numbering.ts, live-preview.ts, and core.ts.
- Refactored `processActiveNoteEquations` to use plugin settings directly.

Refactored provider and equation number logic:
- Simplified `CleverefProvider` by removing index-based logic.
- Updated equation number widget and reading view to use new types and settings.

Improved search and suggestions:
- Refactored `ActiveNoteSearchCore` to use updated provider and settings.
- Unified suggestion rendering and link insertion logic.

General cleanup:
- Removed dead, commented, and obsolete code.
- Reduced indirection and legacy compatibility layers for better maintainability.
2026-06-04 20:12:01 +02:00
JK
72f2e080ab feat: major refactor of equation numbering and provider logic
- Introduced `numbering.ts` with `processActiveNoteEquations` to process equations, count backlinks, and assign print/reference names.
- Refactored `provider.ts` to accept file content as string instead of Editor instance, improving reliability in Live Preview.
- Updated `live-preview.ts` to use CodeMirror decorations and new equation processing logic;
  removed index dependency.
- Simplified `reading-view.ts` by removing `EquationNumberRenderer` and using new processor.
- Refactored `cleveref.ts` to resolve block references and equation names via new utility;
  improved block link and note title handling.
- Updated `core.ts` to pass editor content string to equation provider.
- Enhanced `main.ts` with debug logging and error handling for MathLinks provider registration.

This refactor improves accuracy and reliability of equation handling across views
by operating directly on file content and unifying equation processing logic.
2026-06-04 20:12:01 +02:00
JK
9cc87ab062 disabled plugin split notice 2026-06-04 20:12:01 +02:00
JK
20a96458a3 Reroute Search & Autocomplete to the New System
Modify the search modal and editor autocomplete features to source
their data from the new `ActiveNoteEquationProvider`
instead of the vault-wide `MathIndex`. This is the first
"strangling" action.
2026-06-04 20:12:01 +02:00
JK
d1e5f85603 Staging the setup 2026-06-04 20:12:01 +02:00
JK
7e75089cb2 initializing 2026-06-04 20:11:56 +02:00