Commit graph

13 commits

Author SHA1 Message Date
JK
77f5f739b5 feat(equations): add document-level equation prefix via hidden obsitex block
- Parse `obsitex` YAML codeblocks (`eq-prefix: S` or `- eq-prefix: S`) using Obsidian's `parseYaml` API.
- Inject document-level `eq-prefix` into equation tags rendered in Live Preview, Reading View, and PDF export.
- Support prefixed ID generation (`% id: eq-S-xxxx`) for newly auto-generated equation tags.
- Update equation ID regex patterns (`/eq-[\w.-]+/`) to support dots in prefixes.
- Register hidden `obsitex` markdown codeblock processor and CSS rules (`.block-language-obsitex`) to hide instructions across views.
- Implement `FileIO.read()` across `ActiveNoteIO` and `NonActiveNoteIO`.
- Add unit tests for `obsitex` config parsing and `getEqNumberPrefix`.
- Add user-facing and architectural documentation in `docs/features/equations.md` and `docs/configuration/settings.md`.
2026-07-20 15:19:24 +02:00
JK
8e7a3072ef feat(snippets): add text transform for cleaning inline double dollar equations
- Implement `Clean Inline Double Dollar Symbols` text transform snippet.
- Convert inline double dollar signs `$$` to single dollar sign `$`.
- Keep block/display equation dollar signs (`$$`) intact (e.g. multi-line blocks or single-line equations starting/ending with `$$`).
- Add unit tests in `test_helpers/transforms.test.ts` to verify behavior.
- Update documentation in `docs/features/snippets.md` to document the new and existing double-dollar cleanup transforms.
2026-06-28 12:34:59 +02:00
Jovi Koikkara
eea4d67e3e
feat(tikz): major rendering, layout, and editor enhancements (#1)
Fixes
- WebAssembly & initialization
  - Fix TikZJax WebAssembly initialization issues.

- Fonts & symbol rendering
  - Override DVI parser `machine.putText` to use split character code offsets from `tikzjax.js`.
  - Map codes 0–9 starting at 161 to fix incorrect Γ rendering (was showing as Θ).
  - Map codes 10–19 starting at 173 to resolve Ω and ⊗ collisions with soft hyphen.

- Layout & rendering
  - Fix SVG clipping by switching to `position: relative` with `overflow: visible`.
  - Adjust inline SVG behavior to prevent top-of-page clipping.

- Type compatibility
  - Cast types to `unknown` in `TikzJaxLoader` and worker functions for compatibility.

- Error handling & cleanup
  - Improve error handling across TikZ components.
  - Remove unused dependencies and unnecessary console logs.

Features
- Package loading system
  - Add robust dependency resolution in `loader.ts` for:
    - `tikz-cd`
    - `tikz-feynhand`
    - `pgfcalendar`
  - Ensure required libraries and keys load dynamically on demand.

- Rendering & layout improvements
  - Enhance SVG bounding box calculation.
  - Implement dynamic column width calculation.
  - Improve row and column layout alignment and responsiveness.

- TikZ editor enhancements
  - Add keyboard shortcut tooltips to sidebar buttons.
  - Introduce thickness control slider for elements.
  - Improve snapping system with modes:
    - grid
    - half
    - none
  - Add support for new shapes:
    - circles
    - rectangles
    - triangles
  - Improve TikZ code generation error handling.

Improvements
- Selection & editing UX
  - Add lasso selection for multiple vertices in `CanvasGrid`.
  - Support multi-element editing in `RightSidebar`.
  - Refactor `TikzEditorModal` to handle multiple selected vertices.
  - Enable batch updates for selected elements.

- Layout & styling
  - Compact `.block-language-tikz` layout:
    - margin: `1.5em 0` → `0.3em 0`
    - padding: `1rem 0` → `0`
  - Improve canvas controls and interaction styles.

- Component refactoring
  - Refactor `CanvasGrid` to use template literals.
  - Replace inline styles with `setCssStyles`.
  - Improve `TikzCodec` node naming clarity.
  - Improve `history manager` type safety with `EditorElement`.
  - Use `window.setTimeout` in asset manager for better compatibility.

- Accessibility & UI polish
  - Improve sidebar button titles and tooltips.
  - Standardize live preview overlay button titles.
  - Clean up modal styling and text consistency.

Documentation
- Revamp TeXcore plugin documentation:
  - Clarify PDF export features and settings.
  - Improve quick preview architecture explanation.
  - Enhance equation search and autocomplete docs.
  - Streamline snippets usage and transformations.
  - Expand TikZ diagrams section with graphical editor guide.
  - Improve getting started guide with clearer steps.
  - Add navigation and configuration updates.

- Update plugin manifest descriptions for clarity.
2026-06-06 12:08:11 +02:00
JK
bea33c7cac feat(tikz): decouple TikZJax loader and assets for fully offline, worker-based rendering
- Extracted 214 TeX libraries, packages, core formats, and WebAssembly binaries from monolithic `tikzjax.js` into local `tikzjax-assets/` folder.
- Replaced monolithic 7MB runtime JS asset download from GitHub with a lightweight loader and Web Worker compilation engine.
- Implemented `tikzjax.worker.ts` to execute the TeX engine in a background Web Worker thread using modern Web standard APIs, preventing main-thread UI locks.
- Implemented `TikzJaxLoader` to parse code block preambles, lazily load/decompress assets synchronously via native `zlib`, cache core buffers in memory, and compile diagrams via the worker.
- Refactored `renderer.ts` and `live-preview-overlay.ts` to utilize the async loader, removing DOM-polluting `<script>` tags, global mutation observers, and custom window hooks.
- Swapped unsafe `.innerHTML` DOM writes with secure browser `DOMParser` APIs for SVG parsing.
- Configured `esbuild` and `package.json` to recursively copy `tikzjax-assets/` to both development and production release locations.
- Removed temporary extraction scripts to keep runtime codebase clean.
- Added asset origin citations to module README, project root README, and MkDocs features documentation.
- Fixed all 111 ESLint type check and style errors, ensuring clean linter execution.
2026-06-05 15:19:32 +02:00
JK
4aa6d9cdac Updated Naming Convention 2026-06-05 14:50:35 +02:00
JK
b6392a5523 refactor: reorganize src into modular structure and increase test coverage 2026-06-04 20:50:07 +02:00
JK
0f00ee5f90 setting up prod release 2026-06-04 20:26:28 +02:00
JK
bcc1be7933 updating the plugin 2026-06-04 20:12:07 +02:00
JK
80f7042a57 feat(snippets): streamline snippet management and introduce text transformation features 2026-06-04 20:12:05 +02:00
JK
94cd23a4c3 Added docs 2026-06-04 20:12:04 +02:00
JK
02da857384 Docs updating 2026-06-04 20:12:04 +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
7e75089cb2 initializing 2026-06-04 20:11:56 +02:00