From 856b12e7a10c72b12c474637b8af8b4359512730 Mon Sep 17 00:00:00 2001 From: amitwh Date: Mon, 1 Sep 2025 21:41:28 +0530 Subject: [PATCH] =?UTF-8?q?Add=20font=20size=20adjustment=20menu=20and=20f?= =?UTF-8?q?ix=20theme=20styling=20Features:=20=E2=80=A2=20Added=20Font=20S?= =?UTF-8?q?ize=20menu=20in=20View=20with=20increase/decrease/reset=20optio?= =?UTF-8?q?ns=20=E2=80=A2=20Keyboard=20shortcuts:=20Ctrl+Shift+Plus/Minus/?= =?UTF-8?q?0=20for=20font=20adjustment=20=E2=80=A2=20Font=20size=20persist?= =?UTF-8?q?s=20between=20sessions=20using=20localStorage=20=E2=80=A2=20Fon?= =?UTF-8?q?t=20sizes=20adjustable=20from=2010px=20to=2024px=20Theme=20Fixe?= =?UTF-8?q?s:=20=E2=80=A2=20Fixed=20missing=20Monokai=20theme=20styles=20f?= =?UTF-8?q?or=20tabs=20and=20editor=20=E2=80=A2=20Added=20complete=20tab?= =?UTF-8?q?=20styling=20for=20Solarized=20theme=20=E2=80=A2=20Added=20comp?= =?UTF-8?q?lete=20tab=20styling=20for=20GitHub=20theme=20=E2=80=A2=20All?= =?UTF-8?q?=20themes=20now=20have=20consistent=20tab=20bar=20appearance=20?= =?UTF-8?q?Other=20Changes:=20=E2=80=A2=20Updated=20CLAUDE.md=20with=20v1.?= =?UTF-8?q?3.x=20features=20documentation=20=E2=80=A2=20Version=20bumped?= =?UTF-8?q?=20to=201.3.4=20=F0=9F=A4=96=20Generated=20with=20[Claude=20Cod?= =?UTF-8?q?e](https://claude.ai/code)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CLAUDE.md | 39 ++++++++++++++++-- package.json | 2 +- src/main.js | 23 ++++++++++- src/renderer.js | 32 +++++++++++++++ src/styles.css | 107 ++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 197 insertions(+), 6 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 0d1cd75..6d626a6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,7 +4,7 @@ **PanConverter** is a cross-platform Markdown editor and converter powered by Pandoc, built with Electron. It provides professional-grade editing capabilities with comprehensive export options. -**Current Version**: v1.2.1 +**Current Version**: v1.3.3 **Author**: Amit Haridas (amit.wh@gmail.com) **License**: MIT **Repository**: https://github.com/amitwh/pan-converter @@ -23,14 +23,15 @@ ``` src/ ├── main.js # Electron main process, menu system, IPC handlers -├── renderer.js # UI logic, editor functionality, event handling -├── index.html # Application layout and components +├── renderer.js # TabManager class, multi-file editing, event handling +├── index.html # Application layout with tabbed interface └── styles.css # Comprehensive styling with multi-theme support assets/ └── icon.png # Application icon package.json # Dependencies and build configuration +CLAUDE.md # Development documentation for AI assistants ``` ## Development Commands @@ -108,6 +109,36 @@ gh release create v1.2.1 --title "Title" --notes "Release notes" \ ## Feature Implementation Guide +### v1.3.x Tabbed Interface & Enhanced Features + +#### 🗂️ Tabbed Multi-File Support (v1.3.0) +**TabManager Class** (`src/renderer.js`) +- Complete tab management system for multiple files +- Tab switching, creation, and closure +- State preservation per tab (content, cursor position, scroll) +- File path tracking for each tab +- Keyboard shortcuts: `Ctrl/Cmd+T` (new tab), `Ctrl/Cmd+W` (close tab) + +#### 🎯 Enhanced PDF Export (v1.3.0) +**Multi-Engine Fallback System** (`src/main.js:239-280`) +- Primary: XeLaTeX with proper margins +- Fallback 1: PDFLaTeX +- Fallback 2: wkhtmltopdf +- Automatic engine detection and switching + +#### 📁 File Association Support (v1.3.1) +**OS Integration** (`src/main.js:452-498`, `package.json:50-65`) +- Double-click .md files to open in PanConverter +- Command-line argument handling +- Pending file queue for startup loading + +#### 🎨 Typography & Spacing (v1.3.2-1.3.3) +**Preview Enhancement** (`src/styles.css`) +- Restored ideal text spacing from v1.0 +- Font sizes increased to 15px for better readability +- Comprehensive selector coverage for legacy and new containers +- Theme-aware typography for all content types + ### v1.2.1 Comprehensive Editor Enhancements #### ✨ Advanced Editor Features @@ -300,4 +331,4 @@ gh release create v1.2.1 --title "Title" --notes "Release notes" \ --- **Last Updated**: September 1, 2025 -**Claude Assistant**: Development completed for v1.2.1 comprehensive editor enhancements \ No newline at end of file +**Claude Assistant**: Development completed for v1.3.3 with tabbed interface, enhanced PDF export, file associations, and improved typography \ No newline at end of file diff --git a/package.json b/package.json index edfa087..802754b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pan-converter", - "version": "1.3.3", + "version": "1.3.4", "description": "Cross-platform Markdown editor and converter using Pandoc", "main": "src/main.js", "scripts": { diff --git a/src/main.js b/src/main.js index c68761e..c3fb7b0 100644 --- a/src/main.js +++ b/src/main.js @@ -153,6 +153,27 @@ function createMenu() { ] }, { type: 'separator' }, + { + label: 'Font Size', + submenu: [ + { + label: 'Increase Font Size', + accelerator: 'CmdOrCtrl+Shift+Plus', + click: () => mainWindow.webContents.send('adjust-font-size', 'increase') + }, + { + label: 'Decrease Font Size', + accelerator: 'CmdOrCtrl+Shift+-', + click: () => mainWindow.webContents.send('adjust-font-size', 'decrease') + }, + { + label: 'Reset Font Size', + accelerator: 'CmdOrCtrl+Shift+0', + click: () => mainWindow.webContents.send('adjust-font-size', 'reset') + } + ] + }, + { type: 'separator' }, { label: 'Reload', accelerator: 'CmdOrCtrl+R', role: 'reload' }, { label: 'Toggle DevTools', accelerator: 'F12', role: 'toggleDevTools' }, { type: 'separator' }, @@ -171,7 +192,7 @@ function createMenu() { type: 'info', title: 'About PanConverter', message: 'PanConverter', - detail: 'A cross-platform Markdown editor and converter using Pandoc.\n\nVersion: 1.3.3\nAuthor: Amit Haridas\nEmail: amit.wh@gmail.com\nLicense: MIT\n\nFeatures:\n• Tabbed interface for multiple files\n• Advanced markdown editing with live preview\n• Enhanced PDF export with LaTeX engines\n• File association support for .md files\n• Improved preview typography and spacing\n• Enhanced font sizes for better readability\n• Find & replace with match highlighting\n• Line numbers and auto-indentation\n• Export to multiple formats via Pandoc\n• PowerPoint & presentation export\n• Export tables to Excel/ODS spreadsheets\n• Document import & conversion\n• Table creation helper\n• Multiple themes support\n• Undo/redo functionality', + detail: 'A cross-platform Markdown editor and converter using Pandoc.\n\nVersion: 1.3.4\nAuthor: Amit Haridas\nEmail: amit.wh@gmail.com\nLicense: MIT\n\nFeatures:\n• Tabbed interface for multiple files\n• Advanced markdown editing with live preview\n• Enhanced PDF export with LaTeX engines\n• File association support for .md files\n• Improved preview typography and spacing\n• Adjustable font sizes via menu (Ctrl+Shift+Plus/Minus)\n• Complete theme support including Monokai fixes\n• Find & replace with match highlighting\n• Line numbers and auto-indentation\n• Export to multiple formats via Pandoc\n• PowerPoint & presentation export\n• Export tables to Excel/ODS spreadsheets\n• Document import & conversion\n• Table creation helper\n• Multiple themes support\n• Undo/redo functionality', buttons: ['OK'] }); } diff --git a/src/renderer.js b/src/renderer.js index 40a4b6f..6d853b0 100644 --- a/src/renderer.js +++ b/src/renderer.js @@ -537,4 +537,36 @@ ipcRenderer.on('toggle-find', () => { ipcRenderer.on('theme-changed', (event, theme) => { document.body.className = `theme-${theme}`; +}); + +// Font size adjustment +let currentFontSize = parseInt(localStorage.getItem('fontSize')) || 15; + +function updateFontSizes(size) { + const editors = document.querySelectorAll('#editor, .editor-textarea'); + const previews = document.querySelectorAll('#preview, .preview-content'); + + editors.forEach(editor => { + editor.style.fontSize = `${size}px`; + }); + + previews.forEach(preview => { + preview.style.fontSize = `${size}px`; + }); + + localStorage.setItem('fontSize', size); +} + +// Apply saved font size on load +updateFontSizes(currentFontSize); + +ipcRenderer.on('adjust-font-size', (event, action) => { + if (action === 'increase' && currentFontSize < 24) { + currentFontSize++; + } else if (action === 'decrease' && currentFontSize > 10) { + currentFontSize--; + } else if (action === 'reset') { + currentFontSize = 15; + } + updateFontSizes(currentFontSize); }); \ No newline at end of file diff --git a/src/styles.css b/src/styles.css index d05ec36..ade98f4 100644 --- a/src/styles.css +++ b/src/styles.css @@ -469,6 +469,40 @@ body.theme-solarized { color: #657b83; } +body.theme-solarized .tab-bar { + background: #eee8d5; + border-bottom-color: #93a1a1; +} + +body.theme-solarized .tab { + background: #fdf6e3; + border-color: #93a1a1; + color: #657b83; +} + +body.theme-solarized .tab.active { + background: #fdf6e3; + border-color: #859900; +} + +body.theme-solarized .tab-close { + color: #657b83; +} + +body.theme-solarized .tab-close:hover { + background: #93a1a1; + color: #dc322f; +} + +body.theme-solarized .new-tab-button { + border-color: #93a1a1; + color: #657b83; +} + +body.theme-solarized .new-tab-button:hover { + background: #eee8d5; +} + body.theme-solarized .toolbar { background: #eee8d5; border-bottom-color: #93a1a1; @@ -510,6 +544,40 @@ body.theme-monokai { color: #f8f8f2; } +body.theme-monokai .tab-bar { + background: #3e3d32; + border-bottom-color: #75715e; +} + +body.theme-monokai .tab { + background: #49483e; + border-color: #75715e; + color: #f8f8f2; +} + +body.theme-monokai .tab.active { + background: #272822; + border-color: #a6e22e; +} + +body.theme-monokai .tab-close { + color: #f8f8f2; +} + +body.theme-monokai .tab-close:hover { + background: #75715e; + color: #f92672; +} + +body.theme-monokai .new-tab-button { + border-color: #75715e; + color: #f8f8f2; +} + +body.theme-monokai .new-tab-button:hover { + background: #49483e; +} + body.theme-monokai .toolbar { background: #3e3d32; border-bottom-color: #75715e; @@ -529,6 +597,11 @@ body.theme-monokai #editor { color: #f8f8f2; } +body.theme-monokai .editor-textarea { + background: #272822; + color: #f8f8f2; +} + body.theme-monokai #preview-pane { background: #272822; } @@ -571,6 +644,40 @@ body.theme-github { color: #24292e; } +body.theme-github .tab-bar { + background: #fafbfc; + border-bottom-color: #e1e4e8; +} + +body.theme-github .tab { + background: #f6f8fa; + border-color: #e1e4e8; + color: #24292e; +} + +body.theme-github .tab.active { + background: #fff; + border-color: #0366d6; +} + +body.theme-github .tab-close { + color: #586069; +} + +body.theme-github .tab-close:hover { + background: #e1e4e8; + color: #cb2431; +} + +body.theme-github .new-tab-button { + border-color: #e1e4e8; + color: #586069; +} + +body.theme-github .new-tab-button:hover { + background: #f6f8fa; +} + body.theme-github .toolbar { background: #fafbfc; border-bottom-color: #e1e4e8;