mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 10:00:17 +05:30
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16c0e00201 |
+35
-35
@@ -1,36 +1,36 @@
|
||||
node_modules/
|
||||
dist/
|
||||
*.log
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
.env
|
||||
.env.local
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
.vscode/
|
||||
.idea/
|
||||
*.iml
|
||||
out/
|
||||
.cache/
|
||||
.npm/
|
||||
.electron/
|
||||
package-lock.json
|
||||
|
||||
# Screenshots and temp files
|
||||
*.png.bak
|
||||
Screen.png
|
||||
dark.png
|
||||
light.png
|
||||
pdf.png
|
||||
uvmodal.png
|
||||
nul
|
||||
*.tmp
|
||||
|
||||
# Development screenshots
|
||||
pdf\ modal.png
|
||||
|
||||
# Claude/AI development files
|
||||
.claude/
|
||||
CLAUDE.md
|
||||
node_modules/
|
||||
dist/
|
||||
*.log
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
.env
|
||||
.env.local
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
.vscode/
|
||||
.idea/
|
||||
*.iml
|
||||
out/
|
||||
.cache/
|
||||
.npm/
|
||||
.electron/
|
||||
package-lock.json
|
||||
|
||||
# Screenshots and temp files
|
||||
*.png.bak
|
||||
Screen.png
|
||||
dark.png
|
||||
light.png
|
||||
pdf.png
|
||||
uvmodal.png
|
||||
nul
|
||||
*.tmp
|
||||
|
||||
# Development screenshots
|
||||
pdf\ modal.png
|
||||
|
||||
# Claude/AI development files
|
||||
.claude/
|
||||
CLAUDE.md
|
||||
agents.md
|
||||
+11
-11
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"semi": true,
|
||||
"singleQuote": true,
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"trailingComma": "es5",
|
||||
"bracketSpacing": true,
|
||||
"arrowParens": "always",
|
||||
"printWidth": 100,
|
||||
"endOfLine": "auto"
|
||||
}
|
||||
{
|
||||
"semi": true,
|
||||
"singleQuote": true,
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"trailingComma": "es5",
|
||||
"bracketSpacing": true,
|
||||
"arrowParens": "always",
|
||||
"printWidth": 100,
|
||||
"endOfLine": "auto"
|
||||
}
|
||||
|
||||
+102
-102
@@ -1,103 +1,103 @@
|
||||
# Export Functionality Fix - Summary
|
||||
|
||||
## Issues Found and Fixed
|
||||
|
||||
### 1. **Primary Issue: Pandoc Installation Problem**
|
||||
- **Problem**: Pandoc is installed but has a system error (paging file too small)
|
||||
- **Impact**: All pandoc-dependent exports (DOCX, LaTeX, etc.) were failing
|
||||
- **Solution**: Added robust fallback mechanisms
|
||||
|
||||
### 2. **Export Function Improvements**
|
||||
|
||||
#### Before (Issues):
|
||||
- ❌ No pandoc availability checking
|
||||
- ❌ Poor error messages
|
||||
- ❌ No fallback for missing pandoc
|
||||
- ❌ Limited debugging information
|
||||
|
||||
#### After (Fixed):
|
||||
- ✅ **Pandoc Detection**: Automatically checks if pandoc is available
|
||||
- ✅ **Built-in HTML Export**: Works without pandoc using marked library
|
||||
- ✅ **Built-in PDF Export**: Works without pandoc using Electron's printToPDF
|
||||
- ✅ **Better Error Messages**: Clear instructions for users
|
||||
- ✅ **Comprehensive Logging**: Debug information in console
|
||||
- ✅ **Graceful Fallbacks**: Falls back to built-in converters when pandoc fails
|
||||
|
||||
## How It Works Now
|
||||
|
||||
### Export Process Flow:
|
||||
1. **User clicks export** → Check if file is saved
|
||||
2. **Select output location** → Show save dialog
|
||||
3. **Check pandoc availability** → Async pandoc detection
|
||||
4. **Choose export method**:
|
||||
- **If pandoc available**: Use pandoc with format-specific options
|
||||
- **If pandoc not available**:
|
||||
- HTML → Use built-in marked converter
|
||||
- PDF → Use Electron's printToPDF
|
||||
- Other formats → Show helpful error with installation guide
|
||||
|
||||
### Supported Export Formats:
|
||||
|
||||
#### ✅ **Always Work** (no pandoc required):
|
||||
- **HTML**: Built-in converter using marked library
|
||||
- **PDF**: Built-in converter using Electron
|
||||
|
||||
#### ✅ **Work with Pandoc** (better quality):
|
||||
- **DOCX**: Microsoft Word format
|
||||
- **LaTeX**: LaTeX document
|
||||
- **RTF**: Rich Text Format
|
||||
- **ODT**: OpenDocument Text
|
||||
- **EPUB**: E-book format
|
||||
- **PPTX**: PowerPoint presentations
|
||||
- **ODP**: OpenDocument Presentations
|
||||
|
||||
## Testing the Fixes
|
||||
|
||||
### Manual Test Procedure:
|
||||
1. **Start the application**: `npm start`
|
||||
2. **Open test file**: Load `test-export.md`
|
||||
3. **Test HTML export**: File → Export → HTML (should work)
|
||||
4. **Test PDF export**: File → Export → PDF (should work)
|
||||
5. **Test DOCX export**: File → Export → DOCX (will show pandoc error)
|
||||
|
||||
### Expected Behavior:
|
||||
- **HTML/PDF exports**: Should work immediately and create files
|
||||
- **Other format exports**: Should show informative error about pandoc
|
||||
- **Console logs**: Should show debug information about export process
|
||||
|
||||
## Fix Summary
|
||||
|
||||
### Code Changes Made:
|
||||
1. **Added `checkPandocAvailability()` function** - Detects pandoc
|
||||
2. **Added `exportToHTML()` function** - Built-in HTML export
|
||||
3. **Added `exportToPDFElectron()` function** - Built-in PDF export
|
||||
4. **Added `exportWithPandoc()` helper** - Generic pandoc export
|
||||
5. **Added `exportWithPandocPDF()` helper** - PDF with fallbacks
|
||||
6. **Improved `exportFile()` function** - Main export logic with detection
|
||||
7. **Enhanced error handling** - Better user messages
|
||||
8. **Added comprehensive logging** - Debug information
|
||||
|
||||
### Files Modified:
|
||||
- `src/main.js` - Enhanced export functionality
|
||||
- `test-export.md` - Created test file
|
||||
- `test-export-functionality.js` - Created test script
|
||||
|
||||
## User Instructions
|
||||
|
||||
### For Users Without Pandoc:
|
||||
- ✅ **HTML and PDF exports work perfectly**
|
||||
- ✅ **No additional software needed**
|
||||
- ✅ **Professional-looking output with proper styling**
|
||||
|
||||
### For Users Who Want All Formats:
|
||||
1. **Install Pandoc**: Visit https://pandoc.org/installing.html
|
||||
2. **For PDF with LaTeX**: Also install MiKTeX or TeX Live
|
||||
3. **Restart the application** after installation
|
||||
4. **All export formats will then be available**
|
||||
|
||||
## Result
|
||||
🎉 **Export functionality is now working reliably!**
|
||||
- Built-in exports (HTML, PDF) work without any dependencies
|
||||
- Clear error messages guide users for advanced formats
|
||||
- Robust error handling prevents crashes
|
||||
# Export Functionality Fix - Summary
|
||||
|
||||
## Issues Found and Fixed
|
||||
|
||||
### 1. **Primary Issue: Pandoc Installation Problem**
|
||||
- **Problem**: Pandoc is installed but has a system error (paging file too small)
|
||||
- **Impact**: All pandoc-dependent exports (DOCX, LaTeX, etc.) were failing
|
||||
- **Solution**: Added robust fallback mechanisms
|
||||
|
||||
### 2. **Export Function Improvements**
|
||||
|
||||
#### Before (Issues):
|
||||
- ❌ No pandoc availability checking
|
||||
- ❌ Poor error messages
|
||||
- ❌ No fallback for missing pandoc
|
||||
- ❌ Limited debugging information
|
||||
|
||||
#### After (Fixed):
|
||||
- ✅ **Pandoc Detection**: Automatically checks if pandoc is available
|
||||
- ✅ **Built-in HTML Export**: Works without pandoc using marked library
|
||||
- ✅ **Built-in PDF Export**: Works without pandoc using Electron's printToPDF
|
||||
- ✅ **Better Error Messages**: Clear instructions for users
|
||||
- ✅ **Comprehensive Logging**: Debug information in console
|
||||
- ✅ **Graceful Fallbacks**: Falls back to built-in converters when pandoc fails
|
||||
|
||||
## How It Works Now
|
||||
|
||||
### Export Process Flow:
|
||||
1. **User clicks export** → Check if file is saved
|
||||
2. **Select output location** → Show save dialog
|
||||
3. **Check pandoc availability** → Async pandoc detection
|
||||
4. **Choose export method**:
|
||||
- **If pandoc available**: Use pandoc with format-specific options
|
||||
- **If pandoc not available**:
|
||||
- HTML → Use built-in marked converter
|
||||
- PDF → Use Electron's printToPDF
|
||||
- Other formats → Show helpful error with installation guide
|
||||
|
||||
### Supported Export Formats:
|
||||
|
||||
#### ✅ **Always Work** (no pandoc required):
|
||||
- **HTML**: Built-in converter using marked library
|
||||
- **PDF**: Built-in converter using Electron
|
||||
|
||||
#### ✅ **Work with Pandoc** (better quality):
|
||||
- **DOCX**: Microsoft Word format
|
||||
- **LaTeX**: LaTeX document
|
||||
- **RTF**: Rich Text Format
|
||||
- **ODT**: OpenDocument Text
|
||||
- **EPUB**: E-book format
|
||||
- **PPTX**: PowerPoint presentations
|
||||
- **ODP**: OpenDocument Presentations
|
||||
|
||||
## Testing the Fixes
|
||||
|
||||
### Manual Test Procedure:
|
||||
1. **Start the application**: `npm start`
|
||||
2. **Open test file**: Load `test-export.md`
|
||||
3. **Test HTML export**: File → Export → HTML (should work)
|
||||
4. **Test PDF export**: File → Export → PDF (should work)
|
||||
5. **Test DOCX export**: File → Export → DOCX (will show pandoc error)
|
||||
|
||||
### Expected Behavior:
|
||||
- **HTML/PDF exports**: Should work immediately and create files
|
||||
- **Other format exports**: Should show informative error about pandoc
|
||||
- **Console logs**: Should show debug information about export process
|
||||
|
||||
## Fix Summary
|
||||
|
||||
### Code Changes Made:
|
||||
1. **Added `checkPandocAvailability()` function** - Detects pandoc
|
||||
2. **Added `exportToHTML()` function** - Built-in HTML export
|
||||
3. **Added `exportToPDFElectron()` function** - Built-in PDF export
|
||||
4. **Added `exportWithPandoc()` helper** - Generic pandoc export
|
||||
5. **Added `exportWithPandocPDF()` helper** - PDF with fallbacks
|
||||
6. **Improved `exportFile()` function** - Main export logic with detection
|
||||
7. **Enhanced error handling** - Better user messages
|
||||
8. **Added comprehensive logging** - Debug information
|
||||
|
||||
### Files Modified:
|
||||
- `src/main.js` - Enhanced export functionality
|
||||
- `test-export.md` - Created test file
|
||||
- `test-export-functionality.js` - Created test script
|
||||
|
||||
## User Instructions
|
||||
|
||||
### For Users Without Pandoc:
|
||||
- ✅ **HTML and PDF exports work perfectly**
|
||||
- ✅ **No additional software needed**
|
||||
- ✅ **Professional-looking output with proper styling**
|
||||
|
||||
### For Users Who Want All Formats:
|
||||
1. **Install Pandoc**: Visit https://pandoc.org/installing.html
|
||||
2. **For PDF with LaTeX**: Also install MiKTeX or TeX Live
|
||||
3. **Restart the application** after installation
|
||||
4. **All export formats will then be available**
|
||||
|
||||
## Result
|
||||
🎉 **Export functionality is now working reliably!**
|
||||
- Built-in exports (HTML, PDF) work without any dependencies
|
||||
- Clear error messages guide users for advanced formats
|
||||
- Robust error handling prevents crashes
|
||||
- Better user experience with informative dialogs
|
||||
@@ -1,82 +1,82 @@
|
||||
# GEMINI.md
|
||||
|
||||
## Project Overview
|
||||
|
||||
This project is a cross-platform Markdown editor and converter named **PanConverter**. It is built using the Electron framework, allowing it to run on Windows, macOS, and Linux. The application provides a rich text editor for writing Markdown, a live preview pane, and robust export capabilities powered by Pandoc.
|
||||
|
||||
The core technologies used are:
|
||||
- **Electron:** For creating the desktop application.
|
||||
- **JavaScript:** The primary programming language.
|
||||
- **Pandoc:** For converting Markdown to various formats like PDF, DOCX, HTML, etc.
|
||||
- **Marked:** For parsing and rendering the Markdown preview in real-time.
|
||||
- **CodeMirror:** As the underlying text editor component.
|
||||
- **highlight.js:** For syntax highlighting in the editor.
|
||||
- **DOMPurify:** To sanitize the HTML output in the preview pane for security.
|
||||
|
||||
The application features a tabbed interface for working with multiple files, various themes, find and replace functionality, and detailed document statistics.
|
||||
|
||||
## Building and Running
|
||||
|
||||
To build and run this project locally, you will need to have Node.js and npm installed.
|
||||
|
||||
### Installation
|
||||
|
||||
1. **Clone the repository:**
|
||||
```bash
|
||||
git clone https://github.com/amitwh/pan-converter.git
|
||||
cd pan-converter
|
||||
```
|
||||
|
||||
2. **Install dependencies:**
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
### Running the Application
|
||||
|
||||
To run the application in development mode, use the following command:
|
||||
|
||||
```bash
|
||||
npm start
|
||||
```
|
||||
|
||||
### Building the Application
|
||||
|
||||
You can build the application for different platforms using the scripts defined in `package.json`.
|
||||
|
||||
- **Build for the current platform:**
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
- **Build for a specific platform:**
|
||||
```bash
|
||||
npm run build:win # For Windows
|
||||
npm run build:mac # For macOS
|
||||
npm run build:linux # For Linux
|
||||
```
|
||||
|
||||
- **Build for all platforms at once:**
|
||||
```bash
|
||||
npm run dist:all
|
||||
```
|
||||
|
||||
The distributable files will be located in the `dist/` directory.
|
||||
|
||||
### Testing
|
||||
|
||||
The project does not have a dedicated test suite configured. The `test` script in `package.json` currently returns an error.
|
||||
|
||||
```bash
|
||||
npm test
|
||||
```
|
||||
|
||||
## Development Conventions
|
||||
|
||||
- **Code Style:** The codebase is written in JavaScript (ES6+). There is no linter or formatter configured, but the code generally follows standard JavaScript conventions.
|
||||
- **Main vs. Renderer Process:** The application logic is split between the Electron main process (`src/main.js`) and the renderer process (`src/renderer.js`).
|
||||
- `src/main.js` handles window management, application menus, file system operations, and communication with the operating system.
|
||||
- `src/renderer.js` manages the user interface, editor functionality, and the Markdown preview.
|
||||
- **Dependencies:** Project dependencies are managed through `package.json`. `devDependencies` are used for the build process, while `dependencies` are required for the application to run.
|
||||
- **User Data:** The application stores settings and recent files in the user's application data directory.
|
||||
- **Pandoc Integration:** The application relies on a system-installed version of Pandoc for its export functionality. It does not bundle Pandoc.
|
||||
# GEMINI.md
|
||||
|
||||
## Project Overview
|
||||
|
||||
This project is a cross-platform Markdown editor and converter named **PanConverter**. It is built using the Electron framework, allowing it to run on Windows, macOS, and Linux. The application provides a rich text editor for writing Markdown, a live preview pane, and robust export capabilities powered by Pandoc.
|
||||
|
||||
The core technologies used are:
|
||||
- **Electron:** For creating the desktop application.
|
||||
- **JavaScript:** The primary programming language.
|
||||
- **Pandoc:** For converting Markdown to various formats like PDF, DOCX, HTML, etc.
|
||||
- **Marked:** For parsing and rendering the Markdown preview in real-time.
|
||||
- **CodeMirror:** As the underlying text editor component.
|
||||
- **highlight.js:** For syntax highlighting in the editor.
|
||||
- **DOMPurify:** To sanitize the HTML output in the preview pane for security.
|
||||
|
||||
The application features a tabbed interface for working with multiple files, various themes, find and replace functionality, and detailed document statistics.
|
||||
|
||||
## Building and Running
|
||||
|
||||
To build and run this project locally, you will need to have Node.js and npm installed.
|
||||
|
||||
### Installation
|
||||
|
||||
1. **Clone the repository:**
|
||||
```bash
|
||||
git clone https://github.com/amitwh/pan-converter.git
|
||||
cd pan-converter
|
||||
```
|
||||
|
||||
2. **Install dependencies:**
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
### Running the Application
|
||||
|
||||
To run the application in development mode, use the following command:
|
||||
|
||||
```bash
|
||||
npm start
|
||||
```
|
||||
|
||||
### Building the Application
|
||||
|
||||
You can build the application for different platforms using the scripts defined in `package.json`.
|
||||
|
||||
- **Build for the current platform:**
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
- **Build for a specific platform:**
|
||||
```bash
|
||||
npm run build:win # For Windows
|
||||
npm run build:mac # For macOS
|
||||
npm run build:linux # For Linux
|
||||
```
|
||||
|
||||
- **Build for all platforms at once:**
|
||||
```bash
|
||||
npm run dist:all
|
||||
```
|
||||
|
||||
The distributable files will be located in the `dist/` directory.
|
||||
|
||||
### Testing
|
||||
|
||||
The project does not have a dedicated test suite configured. The `test` script in `package.json` currently returns an error.
|
||||
|
||||
```bash
|
||||
npm test
|
||||
```
|
||||
|
||||
## Development Conventions
|
||||
|
||||
- **Code Style:** The codebase is written in JavaScript (ES6+). There is no linter or formatter configured, but the code generally follows standard JavaScript conventions.
|
||||
- **Main vs. Renderer Process:** The application logic is split between the Electron main process (`src/main.js`) and the renderer process (`src/renderer.js`).
|
||||
- `src/main.js` handles window management, application menus, file system operations, and communication with the operating system.
|
||||
- `src/renderer.js` manages the user interface, editor functionality, and the Markdown preview.
|
||||
- **Dependencies:** Project dependencies are managed through `package.json`. `devDependencies` are used for the build process, while `dependencies` are required for the application to run.
|
||||
- **User Data:** The application stores settings and recent files in the user's application data directory.
|
||||
- **Pandoc Integration:** The application relies on a system-installed version of Pandoc for its export functionality. It does not bundle Pandoc.
|
||||
|
||||
+1478
-1478
File diff suppressed because it is too large
Load Diff
@@ -1,21 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024 Amit Haridas
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024 Amit Haridas
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
+12
-12
@@ -1,12 +1,12 @@
|
||||
# Test Double-Click File Opening
|
||||
|
||||
This is a test file to verify double-click functionality.
|
||||
|
||||
## Features to Test
|
||||
- File should load automatically
|
||||
- Content should display in editor
|
||||
- Tab should show filename
|
||||
- Preview should render markdown
|
||||
|
||||
**This text should be bold**
|
||||
*This text should be italic*
|
||||
# Test Double-Click File Opening
|
||||
|
||||
This is a test file to verify double-click functionality.
|
||||
|
||||
## Features to Test
|
||||
- File should load automatically
|
||||
- Content should display in editor
|
||||
- Tab should show filename
|
||||
- Preview should render markdown
|
||||
|
||||
**This text should be bold**
|
||||
*This text should be italic*
|
||||
|
||||
+378
-378
@@ -1,378 +1,378 @@
|
||||
\hypertarget{panconverter}{%
|
||||
\section{PanConverter}\label{panconverter}}
|
||||
|
||||
A cross-platform Markdown editor and converter powered by Pandoc.
|
||||
|
||||
\begin{figure}
|
||||
\centering
|
||||
\includegraphics{assets/icon.png}
|
||||
\caption{PanConverter}
|
||||
\end{figure}
|
||||
|
||||
\hypertarget{features}{%
|
||||
\subsection{Features}\label{features}}
|
||||
|
||||
\hypertarget{advanced-markdown-editor}{%
|
||||
\subsubsection{✨ Advanced Markdown
|
||||
Editor}\label{advanced-markdown-editor}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
🗂️ \textbf{Tabbed Interface} - Work with multiple files simultaneously
|
||||
in separate tabs
|
||||
\item
|
||||
📝 \textbf{Rich Text Editor} - Full-featured editor with syntax
|
||||
highlighting and comprehensive toolbar
|
||||
\item
|
||||
🔍 \textbf{Find \& Replace} - Powerful search and replace with match
|
||||
highlighting and navigation
|
||||
\item
|
||||
🔢 \textbf{Line Numbers} - Toggle line numbers for easier code editing
|
||||
and navigation
|
||||
\item
|
||||
↩️ \textbf{Smart Auto-Indentation} - Automatic list continuation and
|
||||
intelligent indentation
|
||||
\item
|
||||
⏪ \textbf{Undo/Redo} - Full undo/redo support with keyboard shortcuts
|
||||
\item
|
||||
⌨️ \textbf{Advanced Shortcuts} - Tab indentation, line selection, and
|
||||
smart text formatting
|
||||
\item
|
||||
📂 \textbf{File Association Support} - Open markdown files directly
|
||||
from file manager
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{themes-interface}{%
|
||||
\subsubsection{🎨 Themes \& Interface}\label{themes-interface}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
👁️ \textbf{Live Preview} - See your markdown rendered in real-time
|
||||
with synchronized scrolling
|
||||
\item
|
||||
🎨 \textbf{Multiple Themes} - Choose from Light, Dark, Solarized,
|
||||
Monokai, or GitHub themes
|
||||
\item
|
||||
💾 \textbf{Auto-Save} - Never lose your work with automatic saving
|
||||
every 30 seconds
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{export-conversion}{%
|
||||
\subsubsection{📤 Export \& Conversion}\label{export-conversion}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
📄 \textbf{Enhanced PDF Export} - Robust PDF generation with multiple
|
||||
LaTeX engine fallbacks (XeLaTeX, PDFLaTeX, wkhtmltopdf)
|
||||
\item
|
||||
📄 \textbf{Document Export} - Convert to HTML, DOCX, LaTeX, RTF, ODT,
|
||||
EPUB, PowerPoint (PPTX), and OpenDocument Presentation (ODP)
|
||||
\item
|
||||
📊 \textbf{Spreadsheet Export} - Export markdown tables to Excel
|
||||
(XLSX/XLS) and OpenDocument Spreadsheet (ODS) formats
|
||||
\item
|
||||
📥 \textbf{Document Import} - Import DOCX, ODT, RTF, HTML, PDF, and
|
||||
presentation files to markdown
|
||||
\item
|
||||
📋 \textbf{Table Creation Helper} - Built-in table generator for easy
|
||||
markdown table creation
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{platform-support}{%
|
||||
\subsubsection{🖥️ Platform Support}\label{platform-support}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
\textbf{Cross-Platform} - Works seamlessly on Windows, macOS, and
|
||||
Linux
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{installation}{%
|
||||
\subsection{Installation}\label{installation}}
|
||||
|
||||
\hypertarget{prerequisites}{%
|
||||
\subsubsection{Prerequisites}\label{prerequisites}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
\href{https://pandoc.org/installing.html}{Pandoc} must be installed
|
||||
for export functionality
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
\textbf{Ubuntu/Debian}: \texttt{sudo\ apt-get\ install\ pandoc}
|
||||
\item
|
||||
\textbf{macOS}: \texttt{brew\ install\ pandoc}
|
||||
\item
|
||||
\textbf{Windows}: Download installer from Pandoc website
|
||||
\end{itemize}
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{pdf-export-requirements}{%
|
||||
\subsubsection{PDF Export Requirements}\label{pdf-export-requirements}}
|
||||
|
||||
For optimal PDF export, install a LaTeX engine (recommended): -
|
||||
\textbf{Ubuntu/Debian}:
|
||||
\texttt{sudo\ apt-get\ install\ texlive-xetex\ texlive-latex-base} -
|
||||
\textbf{macOS}: \texttt{brew\ install\ -\/-cask\ mactex} -
|
||||
\textbf{Windows}: Install MiKTeX or TeX Live - \textbf{Alternative}:
|
||||
\texttt{sudo\ apt-get\ install\ wkhtmltopdf} (fallback option)
|
||||
|
||||
\hypertarget{download}{%
|
||||
\subsubsection{Download}\label{download}}
|
||||
|
||||
Download the latest release for your platform from the
|
||||
\href{https://github.com/amitwh/pan-converter/releases}{Releases} page.
|
||||
|
||||
\hypertarget{linux}{%
|
||||
\paragraph{Linux}\label{linux}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
\textbf{AppImage}: \texttt{PanConverter-1.3.1.AppImage} (universal,
|
||||
may require \texttt{-\/-no-sandbox} flag)
|
||||
\item
|
||||
\textbf{Debian Package}: \texttt{pan-converter\_1.3.1\_amd64.deb}
|
||||
\item
|
||||
\textbf{Snap Package}: \texttt{pan-converter\_1.3.1\_amd64.snap}
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{install-from-source}{%
|
||||
\subsubsection{Install from Source}\label{install-from-source}}
|
||||
|
||||
\begin{Shaded}
|
||||
\begin{Highlighting}[]
|
||||
\FunctionTok{git}\NormalTok{ clone https://github.com/amitwh/pan{-}converter.git}
|
||||
\BuiltInTok{cd}\NormalTok{ pan{-}converter}
|
||||
\ExtensionTok{npm}\NormalTok{ install}
|
||||
\ExtensionTok{npm}\NormalTok{ start}
|
||||
\end{Highlighting}
|
||||
\end{Shaded}
|
||||
|
||||
\hypertarget{usage}{%
|
||||
\subsection{Usage}\label{usage}}
|
||||
|
||||
\hypertarget{basic-workflow}{%
|
||||
\subsubsection{Basic Workflow}\label{basic-workflow}}
|
||||
|
||||
\begin{enumerate}
|
||||
\def\labelenumi{\arabic{enumi}.}
|
||||
\tightlist
|
||||
\item
|
||||
\textbf{Write} - Use the editor to write your Markdown content
|
||||
\item
|
||||
\textbf{Preview} - Toggle the preview pane to see rendered output
|
||||
\item
|
||||
\textbf{Theme} - Choose your preferred theme from the View menu
|
||||
\item
|
||||
\textbf{Export} - Export your document to various formats
|
||||
\end{enumerate}
|
||||
|
||||
\hypertarget{export-options}{%
|
||||
\subsubsection{Export Options}\label{export-options}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
\textbf{Documents}: HTML, PDF, DOCX, LaTeX, RTF, ODT, EPUB
|
||||
\item
|
||||
\textbf{Presentations}: PowerPoint (PPTX), OpenDocument Presentation
|
||||
(ODP)
|
||||
\item
|
||||
\textbf{Spreadsheets}: Excel (XLSX/XLS), OpenDocument Spreadsheet
|
||||
(ODS)
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{import-conversion}{%
|
||||
\subsubsection{Import \& Conversion}\label{import-conversion}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
\textbf{Import Documents}: Convert DOCX, ODT, RTF, HTML, PDF, and
|
||||
presentation files to Markdown
|
||||
\item
|
||||
\textbf{Cross-Format Conversion}: Convert current file between
|
||||
multiple formats
|
||||
\item
|
||||
\textbf{Smart Presentation Handling}: Automatic slide-level formatting
|
||||
for PPTX/ODP exports
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{table-creation}{%
|
||||
\subsubsection{Table Creation}\label{table-creation}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
Click the table button in the toolbar
|
||||
\item
|
||||
Specify number of rows and columns
|
||||
\item
|
||||
Automatically generates properly formatted Markdown tables
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{keyboard-shortcuts}{%
|
||||
\subsection{Keyboard Shortcuts}\label{keyboard-shortcuts}}
|
||||
|
||||
\hypertarget{file-operations}{%
|
||||
\subsubsection{File Operations}\label{file-operations}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ N} - New file/tab
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ T} - New tab
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ W} - Close current tab
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ Tab} - Switch to next tab
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ O} - Open file
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ S} - Save file
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ Shift\ +\ S} - Save as
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ I} - Import document
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{editor-features}{%
|
||||
\subsubsection{Editor Features}\label{editor-features}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ F} - Find \& Replace
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ Z} - Undo
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ Shift\ +\ Z} - Redo
|
||||
\item
|
||||
\texttt{Tab} - Indent lines or insert 4 spaces
|
||||
\item
|
||||
\texttt{Shift\ +\ Tab} - Outdent selected lines
|
||||
\item
|
||||
\texttt{Enter} - Auto-continue lists with proper indentation
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{view-navigation}{%
|
||||
\subsubsection{View \& Navigation}\label{view-navigation}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ P} - Toggle preview
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ Enter} - Toggle preview (alternative)
|
||||
\item
|
||||
\texttt{Escape} - Close find dialog
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{building}{%
|
||||
\subsection{Building}\label{building}}
|
||||
|
||||
\begin{Shaded}
|
||||
\begin{Highlighting}[]
|
||||
\CommentTok{\# Install dependencies}
|
||||
\ExtensionTok{npm}\NormalTok{ install}
|
||||
|
||||
\CommentTok{\# Generate icons}
|
||||
\ExtensionTok{npm}\NormalTok{ run generate{-}icons}
|
||||
|
||||
\CommentTok{\# Build for current platform}
|
||||
\ExtensionTok{npm}\NormalTok{ run build}
|
||||
|
||||
\CommentTok{\# Build for specific platform}
|
||||
\ExtensionTok{npm}\NormalTok{ run build:win }\CommentTok{\# Windows}
|
||||
\ExtensionTok{npm}\NormalTok{ run build:mac }\CommentTok{\# macOS }
|
||||
\ExtensionTok{npm}\NormalTok{ run build:linux }\CommentTok{\# Linux (generates .deb, .AppImage, and .snap)}
|
||||
|
||||
\CommentTok{\# Build for all platforms}
|
||||
\ExtensionTok{npm}\NormalTok{ run dist:all}
|
||||
\end{Highlighting}
|
||||
\end{Shaded}
|
||||
|
||||
\hypertarget{version-history}{%
|
||||
\subsection{Version History}\label{version-history}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
\textbf{v1.3.1} - Bug fixes: Fixed file associations for
|
||||
double-clicking .md files, corrected 50/50 layout alignment for
|
||||
editor/preview panes
|
||||
\item
|
||||
\textbf{v1.3.0} - Major update: Tabbed interface for multiple files,
|
||||
enhanced PDF export with LaTeX engines, fixed file associations,
|
||||
removed redundant converter menu, improved UI architecture
|
||||
\item
|
||||
\textbf{v1.2.1} - Comprehensive editor enhancements: Find \& Replace,
|
||||
Line Numbers, Undo/Redo, Auto-indentation, PowerPoint export, document
|
||||
conversion menu, table creation helper, spreadsheet export
|
||||
\item
|
||||
\textbf{v1.1.0} - Added Excel/ODS spreadsheet export, updated author
|
||||
information, renamed to PanConverter
|
||||
\item
|
||||
\textbf{v1.0.0} - Initial release with basic markdown editing, themes,
|
||||
and Pandoc export
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{known-issues}{%
|
||||
\subsection{Known Issues}\label{known-issues}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
AppImage may require \texttt{-\/-no-sandbox} flag on some Linux
|
||||
systems
|
||||
\item
|
||||
Windows/Mac builds require platform-specific build environments
|
||||
\item
|
||||
Large files may cause performance issues
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{contributing}{%
|
||||
\subsection{Contributing}\label{contributing}}
|
||||
|
||||
Contributions are welcome! Please feel free to submit a Pull Request to
|
||||
the \href{https://github.com/amitwh/pan-converter}{GitHub repository}.
|
||||
|
||||
\hypertarget{license}{%
|
||||
\subsection{License}\label{license}}
|
||||
|
||||
MIT License - see LICENSE file for details.
|
||||
|
||||
\hypertarget{author}{%
|
||||
\subsection{Author}\label{author}}
|
||||
|
||||
\textbf{Amit Haridas} -
|
||||
\href{mailto:amit.wh@gmail.com}{\nolinkurl{amit.wh@gmail.com}}
|
||||
|
||||
\hypertarget{acknowledgments}{%
|
||||
\subsection{Acknowledgments}\label{acknowledgments}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
Built with \href{https://www.electronjs.org/}{Electron}
|
||||
\item
|
||||
Markdown parsing by \href{https://marked.js.org/}{marked}
|
||||
\item
|
||||
Export functionality powered by \href{https://pandoc.org/}{Pandoc}
|
||||
\item
|
||||
Syntax highlighting by \href{https://highlightjs.org/}{highlight.js}
|
||||
\item
|
||||
Spreadsheet export by \href{https://www.npmjs.com/package/xlsx}{XLSX}
|
||||
\item
|
||||
HTML sanitization by
|
||||
\href{https://www.npmjs.com/package/dompurify}{DOMPurify}
|
||||
\end{itemize}
|
||||
\hypertarget{panconverter}{%
|
||||
\section{PanConverter}\label{panconverter}}
|
||||
|
||||
A cross-platform Markdown editor and converter powered by Pandoc.
|
||||
|
||||
\begin{figure}
|
||||
\centering
|
||||
\includegraphics{assets/icon.png}
|
||||
\caption{PanConverter}
|
||||
\end{figure}
|
||||
|
||||
\hypertarget{features}{%
|
||||
\subsection{Features}\label{features}}
|
||||
|
||||
\hypertarget{advanced-markdown-editor}{%
|
||||
\subsubsection{✨ Advanced Markdown
|
||||
Editor}\label{advanced-markdown-editor}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
🗂️ \textbf{Tabbed Interface} - Work with multiple files simultaneously
|
||||
in separate tabs
|
||||
\item
|
||||
📝 \textbf{Rich Text Editor} - Full-featured editor with syntax
|
||||
highlighting and comprehensive toolbar
|
||||
\item
|
||||
🔍 \textbf{Find \& Replace} - Powerful search and replace with match
|
||||
highlighting and navigation
|
||||
\item
|
||||
🔢 \textbf{Line Numbers} - Toggle line numbers for easier code editing
|
||||
and navigation
|
||||
\item
|
||||
↩️ \textbf{Smart Auto-Indentation} - Automatic list continuation and
|
||||
intelligent indentation
|
||||
\item
|
||||
⏪ \textbf{Undo/Redo} - Full undo/redo support with keyboard shortcuts
|
||||
\item
|
||||
⌨️ \textbf{Advanced Shortcuts} - Tab indentation, line selection, and
|
||||
smart text formatting
|
||||
\item
|
||||
📂 \textbf{File Association Support} - Open markdown files directly
|
||||
from file manager
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{themes-interface}{%
|
||||
\subsubsection{🎨 Themes \& Interface}\label{themes-interface}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
👁️ \textbf{Live Preview} - See your markdown rendered in real-time
|
||||
with synchronized scrolling
|
||||
\item
|
||||
🎨 \textbf{Multiple Themes} - Choose from Light, Dark, Solarized,
|
||||
Monokai, or GitHub themes
|
||||
\item
|
||||
💾 \textbf{Auto-Save} - Never lose your work with automatic saving
|
||||
every 30 seconds
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{export-conversion}{%
|
||||
\subsubsection{📤 Export \& Conversion}\label{export-conversion}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
📄 \textbf{Enhanced PDF Export} - Robust PDF generation with multiple
|
||||
LaTeX engine fallbacks (XeLaTeX, PDFLaTeX, wkhtmltopdf)
|
||||
\item
|
||||
📄 \textbf{Document Export} - Convert to HTML, DOCX, LaTeX, RTF, ODT,
|
||||
EPUB, PowerPoint (PPTX), and OpenDocument Presentation (ODP)
|
||||
\item
|
||||
📊 \textbf{Spreadsheet Export} - Export markdown tables to Excel
|
||||
(XLSX/XLS) and OpenDocument Spreadsheet (ODS) formats
|
||||
\item
|
||||
📥 \textbf{Document Import} - Import DOCX, ODT, RTF, HTML, PDF, and
|
||||
presentation files to markdown
|
||||
\item
|
||||
📋 \textbf{Table Creation Helper} - Built-in table generator for easy
|
||||
markdown table creation
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{platform-support}{%
|
||||
\subsubsection{🖥️ Platform Support}\label{platform-support}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
\textbf{Cross-Platform} - Works seamlessly on Windows, macOS, and
|
||||
Linux
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{installation}{%
|
||||
\subsection{Installation}\label{installation}}
|
||||
|
||||
\hypertarget{prerequisites}{%
|
||||
\subsubsection{Prerequisites}\label{prerequisites}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
\href{https://pandoc.org/installing.html}{Pandoc} must be installed
|
||||
for export functionality
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
\textbf{Ubuntu/Debian}: \texttt{sudo\ apt-get\ install\ pandoc}
|
||||
\item
|
||||
\textbf{macOS}: \texttt{brew\ install\ pandoc}
|
||||
\item
|
||||
\textbf{Windows}: Download installer from Pandoc website
|
||||
\end{itemize}
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{pdf-export-requirements}{%
|
||||
\subsubsection{PDF Export Requirements}\label{pdf-export-requirements}}
|
||||
|
||||
For optimal PDF export, install a LaTeX engine (recommended): -
|
||||
\textbf{Ubuntu/Debian}:
|
||||
\texttt{sudo\ apt-get\ install\ texlive-xetex\ texlive-latex-base} -
|
||||
\textbf{macOS}: \texttt{brew\ install\ -\/-cask\ mactex} -
|
||||
\textbf{Windows}: Install MiKTeX or TeX Live - \textbf{Alternative}:
|
||||
\texttt{sudo\ apt-get\ install\ wkhtmltopdf} (fallback option)
|
||||
|
||||
\hypertarget{download}{%
|
||||
\subsubsection{Download}\label{download}}
|
||||
|
||||
Download the latest release for your platform from the
|
||||
\href{https://github.com/amitwh/pan-converter/releases}{Releases} page.
|
||||
|
||||
\hypertarget{linux}{%
|
||||
\paragraph{Linux}\label{linux}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
\textbf{AppImage}: \texttt{PanConverter-1.3.1.AppImage} (universal,
|
||||
may require \texttt{-\/-no-sandbox} flag)
|
||||
\item
|
||||
\textbf{Debian Package}: \texttt{pan-converter\_1.3.1\_amd64.deb}
|
||||
\item
|
||||
\textbf{Snap Package}: \texttt{pan-converter\_1.3.1\_amd64.snap}
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{install-from-source}{%
|
||||
\subsubsection{Install from Source}\label{install-from-source}}
|
||||
|
||||
\begin{Shaded}
|
||||
\begin{Highlighting}[]
|
||||
\FunctionTok{git}\NormalTok{ clone https://github.com/amitwh/pan{-}converter.git}
|
||||
\BuiltInTok{cd}\NormalTok{ pan{-}converter}
|
||||
\ExtensionTok{npm}\NormalTok{ install}
|
||||
\ExtensionTok{npm}\NormalTok{ start}
|
||||
\end{Highlighting}
|
||||
\end{Shaded}
|
||||
|
||||
\hypertarget{usage}{%
|
||||
\subsection{Usage}\label{usage}}
|
||||
|
||||
\hypertarget{basic-workflow}{%
|
||||
\subsubsection{Basic Workflow}\label{basic-workflow}}
|
||||
|
||||
\begin{enumerate}
|
||||
\def\labelenumi{\arabic{enumi}.}
|
||||
\tightlist
|
||||
\item
|
||||
\textbf{Write} - Use the editor to write your Markdown content
|
||||
\item
|
||||
\textbf{Preview} - Toggle the preview pane to see rendered output
|
||||
\item
|
||||
\textbf{Theme} - Choose your preferred theme from the View menu
|
||||
\item
|
||||
\textbf{Export} - Export your document to various formats
|
||||
\end{enumerate}
|
||||
|
||||
\hypertarget{export-options}{%
|
||||
\subsubsection{Export Options}\label{export-options}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
\textbf{Documents}: HTML, PDF, DOCX, LaTeX, RTF, ODT, EPUB
|
||||
\item
|
||||
\textbf{Presentations}: PowerPoint (PPTX), OpenDocument Presentation
|
||||
(ODP)
|
||||
\item
|
||||
\textbf{Spreadsheets}: Excel (XLSX/XLS), OpenDocument Spreadsheet
|
||||
(ODS)
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{import-conversion}{%
|
||||
\subsubsection{Import \& Conversion}\label{import-conversion}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
\textbf{Import Documents}: Convert DOCX, ODT, RTF, HTML, PDF, and
|
||||
presentation files to Markdown
|
||||
\item
|
||||
\textbf{Cross-Format Conversion}: Convert current file between
|
||||
multiple formats
|
||||
\item
|
||||
\textbf{Smart Presentation Handling}: Automatic slide-level formatting
|
||||
for PPTX/ODP exports
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{table-creation}{%
|
||||
\subsubsection{Table Creation}\label{table-creation}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
Click the table button in the toolbar
|
||||
\item
|
||||
Specify number of rows and columns
|
||||
\item
|
||||
Automatically generates properly formatted Markdown tables
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{keyboard-shortcuts}{%
|
||||
\subsection{Keyboard Shortcuts}\label{keyboard-shortcuts}}
|
||||
|
||||
\hypertarget{file-operations}{%
|
||||
\subsubsection{File Operations}\label{file-operations}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ N} - New file/tab
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ T} - New tab
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ W} - Close current tab
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ Tab} - Switch to next tab
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ O} - Open file
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ S} - Save file
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ Shift\ +\ S} - Save as
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ I} - Import document
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{editor-features}{%
|
||||
\subsubsection{Editor Features}\label{editor-features}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ F} - Find \& Replace
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ Z} - Undo
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ Shift\ +\ Z} - Redo
|
||||
\item
|
||||
\texttt{Tab} - Indent lines or insert 4 spaces
|
||||
\item
|
||||
\texttt{Shift\ +\ Tab} - Outdent selected lines
|
||||
\item
|
||||
\texttt{Enter} - Auto-continue lists with proper indentation
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{view-navigation}{%
|
||||
\subsubsection{View \& Navigation}\label{view-navigation}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ P} - Toggle preview
|
||||
\item
|
||||
\texttt{Ctrl/Cmd\ +\ Enter} - Toggle preview (alternative)
|
||||
\item
|
||||
\texttt{Escape} - Close find dialog
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{building}{%
|
||||
\subsection{Building}\label{building}}
|
||||
|
||||
\begin{Shaded}
|
||||
\begin{Highlighting}[]
|
||||
\CommentTok{\# Install dependencies}
|
||||
\ExtensionTok{npm}\NormalTok{ install}
|
||||
|
||||
\CommentTok{\# Generate icons}
|
||||
\ExtensionTok{npm}\NormalTok{ run generate{-}icons}
|
||||
|
||||
\CommentTok{\# Build for current platform}
|
||||
\ExtensionTok{npm}\NormalTok{ run build}
|
||||
|
||||
\CommentTok{\# Build for specific platform}
|
||||
\ExtensionTok{npm}\NormalTok{ run build:win }\CommentTok{\# Windows}
|
||||
\ExtensionTok{npm}\NormalTok{ run build:mac }\CommentTok{\# macOS }
|
||||
\ExtensionTok{npm}\NormalTok{ run build:linux }\CommentTok{\# Linux (generates .deb, .AppImage, and .snap)}
|
||||
|
||||
\CommentTok{\# Build for all platforms}
|
||||
\ExtensionTok{npm}\NormalTok{ run dist:all}
|
||||
\end{Highlighting}
|
||||
\end{Shaded}
|
||||
|
||||
\hypertarget{version-history}{%
|
||||
\subsection{Version History}\label{version-history}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
\textbf{v1.3.1} - Bug fixes: Fixed file associations for
|
||||
double-clicking .md files, corrected 50/50 layout alignment for
|
||||
editor/preview panes
|
||||
\item
|
||||
\textbf{v1.3.0} - Major update: Tabbed interface for multiple files,
|
||||
enhanced PDF export with LaTeX engines, fixed file associations,
|
||||
removed redundant converter menu, improved UI architecture
|
||||
\item
|
||||
\textbf{v1.2.1} - Comprehensive editor enhancements: Find \& Replace,
|
||||
Line Numbers, Undo/Redo, Auto-indentation, PowerPoint export, document
|
||||
conversion menu, table creation helper, spreadsheet export
|
||||
\item
|
||||
\textbf{v1.1.0} - Added Excel/ODS spreadsheet export, updated author
|
||||
information, renamed to PanConverter
|
||||
\item
|
||||
\textbf{v1.0.0} - Initial release with basic markdown editing, themes,
|
||||
and Pandoc export
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{known-issues}{%
|
||||
\subsection{Known Issues}\label{known-issues}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
AppImage may require \texttt{-\/-no-sandbox} flag on some Linux
|
||||
systems
|
||||
\item
|
||||
Windows/Mac builds require platform-specific build environments
|
||||
\item
|
||||
Large files may cause performance issues
|
||||
\end{itemize}
|
||||
|
||||
\hypertarget{contributing}{%
|
||||
\subsection{Contributing}\label{contributing}}
|
||||
|
||||
Contributions are welcome! Please feel free to submit a Pull Request to
|
||||
the \href{https://github.com/amitwh/pan-converter}{GitHub repository}.
|
||||
|
||||
\hypertarget{license}{%
|
||||
\subsection{License}\label{license}}
|
||||
|
||||
MIT License - see LICENSE file for details.
|
||||
|
||||
\hypertarget{author}{%
|
||||
\subsection{Author}\label{author}}
|
||||
|
||||
\textbf{Amit Haridas} -
|
||||
\href{mailto:amit.wh@gmail.com}{\nolinkurl{amit.wh@gmail.com}}
|
||||
|
||||
\hypertarget{acknowledgments}{%
|
||||
\subsection{Acknowledgments}\label{acknowledgments}}
|
||||
|
||||
\begin{itemize}
|
||||
\tightlist
|
||||
\item
|
||||
Built with \href{https://www.electronjs.org/}{Electron}
|
||||
\item
|
||||
Markdown parsing by \href{https://marked.js.org/}{marked}
|
||||
\item
|
||||
Export functionality powered by \href{https://pandoc.org/}{Pandoc}
|
||||
\item
|
||||
Syntax highlighting by \href{https://highlightjs.org/}{highlight.js}
|
||||
\item
|
||||
Spreadsheet export by \href{https://www.npmjs.com/package/xlsx}{XLSX}
|
||||
\item
|
||||
HTML sanitization by
|
||||
\href{https://www.npmjs.com/package/dompurify}{DOMPurify}
|
||||
\end{itemize}
|
||||
|
||||
@@ -1,165 +1,165 @@
|
||||
# MarkdownConverter
|
||||
|
||||
A powerful cross-platform Markdown editor and document converter powered by Pandoc, built with Electron. 100% open-source with no proprietary dependencies.
|
||||
|
||||
## Features
|
||||
|
||||
### Markdown Editor
|
||||
<img width="1920" height="1032" alt="image" src="https://github.com/user-attachments/assets/5f53ba94-7663-47c3-b12b-b7b8bd2645aa" />
|
||||
- **Multi-tab editing** - Work on multiple files simultaneously
|
||||
- **Live preview** - Real-time markdown rendering with syntax highlighting
|
||||
- **Dynamic splitter** - Drag to resize editor and preview panes
|
||||
- **25+ themes** - Light and dark themes including Atom One Light, Dracula, Nord, Sepia, and more
|
||||
- **Find & Replace** - Search and replace with regex support
|
||||
- **Line numbers** - Toggle line numbers in the editor
|
||||
- **Auto-save** - Automatic saving every 30 seconds
|
||||
- **Math support** - KaTeX integration for mathematical expressions
|
||||
|
||||
### PDF Viewer & Editor
|
||||
<img width="1920" height="1032" alt="image" src="https://github.com/user-attachments/assets/f10f62be-af3d-496e-81df-37ab4f91abfd" />
|
||||
|
||||
- **Built-in PDF viewer** - Open and view PDF files directly in the app
|
||||
- **Page navigation** - Navigate pages with keyboard or buttons
|
||||
- **Zoom controls** - Zoom in/out, fit to width, fit to page
|
||||
- **Rotation** - Rotate pages left or right
|
||||
- **PDF Editor tools**:
|
||||
- Merge multiple PDFs
|
||||
- Split PDFs by page range
|
||||
- Compress PDFs
|
||||
- Rotate pages
|
||||
- Delete pages
|
||||
- Reorder pages
|
||||
- Add watermarks
|
||||
- Password protection
|
||||
- Remove passwords
|
||||
- Set permissions
|
||||
|
||||
### Export Options
|
||||
- **PDF** - Export to PDF with customizable page sizes and orientation
|
||||
- **DOCX** - Standard and Enhanced (template-based) Word export
|
||||
- **ODT** - OpenDocument format
|
||||
- **HTML** - Web-ready HTML export
|
||||
- **PowerPoint** - PPTX presentation export
|
||||
- **EPUB** - E-book format
|
||||
- **LaTeX** - Academic document format
|
||||
- **RTF** - Rich Text Format
|
||||
|
||||
### Advanced Features
|
||||
- **Custom headers & footers** - Add headers/footers to exports with dynamic fields
|
||||
- **Page size configuration** - A3, A4, A5, B4, B5, Letter, Legal, Tabloid, or custom sizes
|
||||
- **Batch conversion** - Convert entire folders of markdown files
|
||||
- **ASCII Art Generator** - Create text banners and diagrams
|
||||
- **Word templates** - Use custom Word templates for enhanced exports
|
||||
- **Import documents** - Import from 30+ formats (DOCX, PDF, HTML, etc.)
|
||||
|
||||
## Installation
|
||||
|
||||
### Prerequisites
|
||||
- [Node.js](https://nodejs.org/) (v16 or later)
|
||||
- [Pandoc](https://pandoc.org/installing.html) (required for export functionality)
|
||||
|
||||
### Install Dependencies
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
### Run the Application
|
||||
```bash
|
||||
npm start
|
||||
```
|
||||
|
||||
### Build for Distribution
|
||||
```bash
|
||||
# Windows
|
||||
npm run build:win
|
||||
|
||||
# macOS
|
||||
npm run build:mac
|
||||
|
||||
# Linux
|
||||
npm run build:linux
|
||||
```
|
||||
|
||||
## Keyboard Shortcuts
|
||||
|
||||
| Action | Shortcut |
|
||||
|--------|----------|
|
||||
| New File | Ctrl+N |
|
||||
| Open File | Ctrl+O |
|
||||
| Open PDF | Ctrl+Shift+O |
|
||||
| Save | Ctrl+S |
|
||||
| Save As | Ctrl+Shift+S |
|
||||
| Export | Ctrl+E |
|
||||
| Print | Ctrl+P |
|
||||
| Find | Ctrl+F |
|
||||
| Undo | Ctrl+Z |
|
||||
| Redo | Ctrl+Shift+Z |
|
||||
| New Tab | Ctrl+T |
|
||||
| Close Tab | Ctrl+W |
|
||||
| Toggle Preview | Ctrl+Shift+P |
|
||||
| Zoom In | Ctrl+Shift++ |
|
||||
| Zoom Out | Ctrl+Shift+- |
|
||||
|
||||
## Themes
|
||||
|
||||
### Light Themes
|
||||
- Atom One Light (Default)
|
||||
- GitHub Light
|
||||
- Light
|
||||
- Solarized Light
|
||||
- Gruvbox Light
|
||||
- Ayu Light
|
||||
- Sepia
|
||||
- Paper
|
||||
- Rose Pine Dawn
|
||||
- Concrete Light
|
||||
|
||||
### Dark Themes
|
||||
- Dark
|
||||
- One Dark
|
||||
- Dracula
|
||||
- Nord
|
||||
- Monokai
|
||||
- Material
|
||||
- Gruvbox Dark
|
||||
- Tokyo Night
|
||||
- Palenight
|
||||
- Ayu Dark
|
||||
- Ayu Mirage
|
||||
- Oceanic Next
|
||||
- Cobalt2
|
||||
- Concrete Dark
|
||||
- Concrete Warm
|
||||
|
||||
## PDF Viewer
|
||||
|
||||
Open PDF files directly in MarkdownConverter:
|
||||
- **File > Open PDF** or **Ctrl+Shift+O**
|
||||
- Navigate pages with arrow buttons or page input
|
||||
- Zoom controls: +/- buttons, Fit Width, Fit Page
|
||||
- Rotate pages left or right
|
||||
- Close PDF to return to editor
|
||||
|
||||
## Open Source
|
||||
|
||||
MarkdownConverter is 100% open-source. All dependencies are permissively licensed:
|
||||
- **Electron** - MIT License
|
||||
- **pdf-lib** - MIT License
|
||||
- **pdfjs-dist** - Apache 2.0 License
|
||||
- **marked** - MIT License
|
||||
- **highlight.js** - BSD 3-Clause License
|
||||
- **dompurify** - Apache 2.0/MIT License
|
||||
- **docx** - MIT License
|
||||
- **xlsx** - Apache 2.0 License (SheetJS Community Edition)
|
||||
|
||||
## License
|
||||
|
||||
MIT License - see LICENSE file for details.
|
||||
|
||||
## Author
|
||||
|
||||
Amit Haridas (amit.wh@gmail.com)
|
||||
|
||||
## Version
|
||||
|
||||
v3.0.0
|
||||
# MarkdownConverter
|
||||
|
||||
A powerful cross-platform Markdown editor and document converter powered by Pandoc, built with Electron. 100% open-source with no proprietary dependencies.
|
||||
|
||||
## Features
|
||||
|
||||
### Markdown Editor
|
||||
<img width="1920" height="1032" alt="image" src="https://github.com/user-attachments/assets/5f53ba94-7663-47c3-b12b-b7b8bd2645aa" />
|
||||
- **Multi-tab editing** - Work on multiple files simultaneously
|
||||
- **Live preview** - Real-time markdown rendering with syntax highlighting
|
||||
- **Dynamic splitter** - Drag to resize editor and preview panes
|
||||
- **25+ themes** - Light and dark themes including Atom One Light, Dracula, Nord, Sepia, and more
|
||||
- **Find & Replace** - Search and replace with regex support
|
||||
- **Line numbers** - Toggle line numbers in the editor
|
||||
- **Auto-save** - Automatic saving every 30 seconds
|
||||
- **Math support** - KaTeX integration for mathematical expressions
|
||||
|
||||
### PDF Viewer & Editor
|
||||
<img width="1920" height="1032" alt="image" src="https://github.com/user-attachments/assets/f10f62be-af3d-496e-81df-37ab4f91abfd" />
|
||||
|
||||
- **Built-in PDF viewer** - Open and view PDF files directly in the app
|
||||
- **Page navigation** - Navigate pages with keyboard or buttons
|
||||
- **Zoom controls** - Zoom in/out, fit to width, fit to page
|
||||
- **Rotation** - Rotate pages left or right
|
||||
- **PDF Editor tools**:
|
||||
- Merge multiple PDFs
|
||||
- Split PDFs by page range
|
||||
- Compress PDFs
|
||||
- Rotate pages
|
||||
- Delete pages
|
||||
- Reorder pages
|
||||
- Add watermarks
|
||||
- Password protection
|
||||
- Remove passwords
|
||||
- Set permissions
|
||||
|
||||
### Export Options
|
||||
- **PDF** - Export to PDF with customizable page sizes and orientation
|
||||
- **DOCX** - Standard and Enhanced (template-based) Word export
|
||||
- **ODT** - OpenDocument format
|
||||
- **HTML** - Web-ready HTML export
|
||||
- **PowerPoint** - PPTX presentation export
|
||||
- **EPUB** - E-book format
|
||||
- **LaTeX** - Academic document format
|
||||
- **RTF** - Rich Text Format
|
||||
|
||||
### Advanced Features
|
||||
- **Custom headers & footers** - Add headers/footers to exports with dynamic fields
|
||||
- **Page size configuration** - A3, A4, A5, B4, B5, Letter, Legal, Tabloid, or custom sizes
|
||||
- **Batch conversion** - Convert entire folders of markdown files
|
||||
- **ASCII Art Generator** - Create text banners and diagrams
|
||||
- **Word templates** - Use custom Word templates for enhanced exports
|
||||
- **Import documents** - Import from 30+ formats (DOCX, PDF, HTML, etc.)
|
||||
|
||||
## Installation
|
||||
|
||||
### Prerequisites
|
||||
- [Node.js](https://nodejs.org/) (v16 or later)
|
||||
- [Pandoc](https://pandoc.org/installing.html) (required for export functionality)
|
||||
|
||||
### Install Dependencies
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
### Run the Application
|
||||
```bash
|
||||
npm start
|
||||
```
|
||||
|
||||
### Build for Distribution
|
||||
```bash
|
||||
# Windows
|
||||
npm run build:win
|
||||
|
||||
# macOS
|
||||
npm run build:mac
|
||||
|
||||
# Linux
|
||||
npm run build:linux
|
||||
```
|
||||
|
||||
## Keyboard Shortcuts
|
||||
|
||||
| Action | Shortcut |
|
||||
|--------|----------|
|
||||
| New File | Ctrl+N |
|
||||
| Open File | Ctrl+O |
|
||||
| Open PDF | Ctrl+Shift+O |
|
||||
| Save | Ctrl+S |
|
||||
| Save As | Ctrl+Shift+S |
|
||||
| Export | Ctrl+E |
|
||||
| Print | Ctrl+P |
|
||||
| Find | Ctrl+F |
|
||||
| Undo | Ctrl+Z |
|
||||
| Redo | Ctrl+Shift+Z |
|
||||
| New Tab | Ctrl+T |
|
||||
| Close Tab | Ctrl+W |
|
||||
| Toggle Preview | Ctrl+Shift+P |
|
||||
| Zoom In | Ctrl+Shift++ |
|
||||
| Zoom Out | Ctrl+Shift+- |
|
||||
|
||||
## Themes
|
||||
|
||||
### Light Themes
|
||||
- Atom One Light (Default)
|
||||
- GitHub Light
|
||||
- Light
|
||||
- Solarized Light
|
||||
- Gruvbox Light
|
||||
- Ayu Light
|
||||
- Sepia
|
||||
- Paper
|
||||
- Rose Pine Dawn
|
||||
- Concrete Light
|
||||
|
||||
### Dark Themes
|
||||
- Dark
|
||||
- One Dark
|
||||
- Dracula
|
||||
- Nord
|
||||
- Monokai
|
||||
- Material
|
||||
- Gruvbox Dark
|
||||
- Tokyo Night
|
||||
- Palenight
|
||||
- Ayu Dark
|
||||
- Ayu Mirage
|
||||
- Oceanic Next
|
||||
- Cobalt2
|
||||
- Concrete Dark
|
||||
- Concrete Warm
|
||||
|
||||
## PDF Viewer
|
||||
|
||||
Open PDF files directly in MarkdownConverter:
|
||||
- **File > Open PDF** or **Ctrl+Shift+O**
|
||||
- Navigate pages with arrow buttons or page input
|
||||
- Zoom controls: +/- buttons, Fit Width, Fit Page
|
||||
- Rotate pages left or right
|
||||
- Close PDF to return to editor
|
||||
|
||||
## Open Source
|
||||
|
||||
MarkdownConverter is 100% open-source. All dependencies are permissively licensed:
|
||||
- **Electron** - MIT License
|
||||
- **pdf-lib** - MIT License
|
||||
- **pdfjs-dist** - Apache 2.0 License
|
||||
- **marked** - MIT License
|
||||
- **highlight.js** - BSD 3-Clause License
|
||||
- **dompurify** - Apache 2.0/MIT License
|
||||
- **docx** - MIT License
|
||||
- **xlsx** - Apache 2.0 License (SheetJS Community Edition)
|
||||
|
||||
## License
|
||||
|
||||
MIT License - see LICENSE file for details.
|
||||
|
||||
## Author
|
||||
|
||||
Amit Haridas (amit.wh@gmail.com)
|
||||
|
||||
## Version
|
||||
|
||||
v3.0.0
|
||||
|
||||
+166
-166
@@ -1,166 +1,166 @@
|
||||
# PanConverter - Updates & Changelog
|
||||
|
||||
## Version 2.1.0 (December 14, 2025)
|
||||
|
||||
### 🎨 UI/UX Improvements
|
||||
|
||||
#### Subtle & Small Preview Popout Button
|
||||
- Redesigned popout button with minimalist aesthetic
|
||||
- Removed border for cleaner appearance
|
||||
- Reduced size: 11px font, 2px×6px padding (previously 14px font, 4px×8px padding)
|
||||
- Added opacity transition: 50% when idle, 100% on hover
|
||||
- Subtle background effect on hover instead of heavy border styling
|
||||
- **File**: `src/styles.css:195-211`
|
||||
|
||||
#### Simplified Table Headers in Preview
|
||||
- Removed gradient background from table headers in modern theme
|
||||
- Changed from `var(--primary-gradient)` (purple gradient) to simple light gray (#f0f0f0)
|
||||
- Updated text color to dark (#333333) for better readability
|
||||
- Clean, professional appearance matching standard themes
|
||||
- **File**: `src/styles-modern.css:445-449`
|
||||
|
||||
### 📥 Enhanced Import Capabilities
|
||||
|
||||
#### Comprehensive Format-to-Markdown Conversion
|
||||
Dramatically expanded the "Import Document" feature to support 30+ file formats:
|
||||
|
||||
**Supported Formats:**
|
||||
- **Documents**: DOCX, ODT, RTF, HTML, HTM, TEX, EPUB, PDF, TXT
|
||||
- **Presentations**: PPTX, ODP
|
||||
- **Markup Languages**: RST, Textile, MediaWiki, Org-mode, AsciiDoc, TWiki, OPML
|
||||
- **E-book Formats**: EPUB, FB2
|
||||
- **LaTeX Formats**: TEX, LATEX, LTX
|
||||
- **Web Formats**: HTML, HTM, XHTML
|
||||
- **Wiki Formats**: MediaWiki, DokuWiki, TikiWiki, TWiki
|
||||
- **Data Formats**: CSV, TSV, JSON
|
||||
|
||||
**Format-Specific Optimizations:**
|
||||
- PDF text extraction with XeLaTeX engine
|
||||
- CSV/TSV automatic table conversion
|
||||
- JSON structure handling
|
||||
- Improved error messages with format hints
|
||||
|
||||
**Access**: File → Import Document (Ctrl+I)
|
||||
**File**: `src/main.js:1933-1994`
|
||||
|
||||
### 🎨 Exhaustive ASCII Art Generator
|
||||
|
||||
#### 5 New Text Banner Styles
|
||||
Complete alphabet (A-Z) and numbers (0-9) support for all styles:
|
||||
|
||||
1. **Standard** - Classic ASCII art with slashes and underscores
|
||||
2. **Banner** - Large format using # characters (7-line height)
|
||||
3. **Block** - Modern Unicode block characters (█ ╔ ╗ ═ ║)
|
||||
4. **Bubble** - Circular bubble letters (Ⓐ Ⓑ Ⓒ)
|
||||
5. **Digital** - Digital display style (▄ ▀ ▐ ▌)
|
||||
|
||||
**File**: `src/renderer.js:3397-3537`
|
||||
|
||||
#### 19 Professional ASCII Templates
|
||||
Organized into 4 categories with expanded options:
|
||||
|
||||
**Arrows & Flow (4 templates):**
|
||||
- Arrow Right - Horizontal flow indicators
|
||||
- Arrow Down - Vertical flow indicators
|
||||
- Decision - Binary decision diagrams
|
||||
- Process Flow - Multi-step process visualization
|
||||
|
||||
**Diagrams & Charts (6 templates):**
|
||||
- Flowchart - Advanced flowchart with decision branches and loops
|
||||
- Sequence - Sequence diagrams for User-System-Database interactions
|
||||
- Network - Server-client network topology
|
||||
- Hierarchy - Organizational tree structures
|
||||
- Timeline - Milestone visualization with dates
|
||||
- Table Simple - Basic table template with borders
|
||||
|
||||
**Boxes & Containers (4 templates):**
|
||||
- Header - Section header with decorative borders
|
||||
- Note Box - Important notes with rounded corners (┏━━┓)
|
||||
- Warning Box - Warning messages with bold borders (╔═══╗)
|
||||
- Info Box - Information boxes with subtle styling (╭───╮)
|
||||
|
||||
**Decorative Elements (6 templates):**
|
||||
- Divider - Horizontal section separator (═══)
|
||||
- Separator Fancy - Elegant rounded divider
|
||||
- Brackets - Japanese-style brackets 【 】
|
||||
- Banner Stars - Star-bordered banners
|
||||
- Checklist - Task lists with ✓ checkmarks
|
||||
- Progress Bar - Visual progress indicators
|
||||
|
||||
**Features:**
|
||||
- All ASCII art automatically wrapped in code blocks for proper rendering
|
||||
- Preserved formatting in markdown preview and all export formats
|
||||
- Categorized template selection interface
|
||||
- Real-time preview generation
|
||||
|
||||
**Access**: Tools → ASCII Art Generator
|
||||
**Files**: `src/renderer.js:3513-3671`, `src/index.html:427-466`
|
||||
|
||||
### 📝 Technical Improvements
|
||||
|
||||
- Enhanced ASCII art detection in Word template exporter
|
||||
- Improved monospace font rendering across all export formats
|
||||
- Better code block preservation in PDF and Word exports
|
||||
- Optimized template categorization and organization
|
||||
|
||||
### 🔧 Files Modified
|
||||
|
||||
- `src/styles.css` - Preview popout button styling
|
||||
- `src/styles-modern.css` - Table header simplification
|
||||
- `src/main.js` - Enhanced import function, version update
|
||||
- `src/renderer.js` - ASCII art generator enhancements
|
||||
- `src/index.html` - ASCII template UI organization
|
||||
- `package.json` - Version bump to 2.1.0
|
||||
|
||||
---
|
||||
|
||||
## Version 2.0.0 (Previous Release)
|
||||
|
||||
### Major Features
|
||||
- Export Profiles - Save and reuse export configurations
|
||||
- Mermaid.js diagram support
|
||||
- Command Palette (Ctrl+Shift+P)
|
||||
- GitHub Light/Dark preview themes
|
||||
- Table Generator
|
||||
- ASCII Art Generator (basic)
|
||||
- Resizable Preview Pane
|
||||
- Pop-out Preview Window
|
||||
- Configurable page sizes (A3-A5, B4-B5, Letter, Legal, Tabloid, Custom)
|
||||
- Custom Headers & Footers for exports
|
||||
- Enhanced PDF and Word export with templates
|
||||
- 22 beautiful themes
|
||||
|
||||
### Core Capabilities
|
||||
- Cross-platform markdown editor with live preview
|
||||
- Universal document conversion (30+ formats)
|
||||
- PDF Editor (merge, split, compress, rotate, watermark, encrypt)
|
||||
- Batch file conversion
|
||||
- File association support
|
||||
- Advanced export options
|
||||
- Multi-tab interface
|
||||
|
||||
---
|
||||
|
||||
## Installation & Usage
|
||||
|
||||
### Prerequisites
|
||||
- **Pandoc** - Required for document conversion
|
||||
- **Optional**: LibreOffice, ImageMagick, FFmpeg for universal converter
|
||||
|
||||
### Download
|
||||
Get the latest release from: https://github.com/amitwh/pan-converter/releases
|
||||
|
||||
### Supported Platforms
|
||||
- Windows (x64)
|
||||
- Linux (AppImage, .deb, .snap)
|
||||
- macOS (planned)
|
||||
|
||||
---
|
||||
|
||||
## Contributing
|
||||
|
||||
Contributions are welcome! Please see [CLAUDE.md](CLAUDE.md) for development guidelines.
|
||||
|
||||
**Author**: Amit Haridas (amit.wh@gmail.com)
|
||||
**License**: MIT
|
||||
**Repository**: https://github.com/amitwh/pan-converter
|
||||
# PanConverter - Updates & Changelog
|
||||
|
||||
## Version 2.1.0 (December 14, 2025)
|
||||
|
||||
### 🎨 UI/UX Improvements
|
||||
|
||||
#### Subtle & Small Preview Popout Button
|
||||
- Redesigned popout button with minimalist aesthetic
|
||||
- Removed border for cleaner appearance
|
||||
- Reduced size: 11px font, 2px×6px padding (previously 14px font, 4px×8px padding)
|
||||
- Added opacity transition: 50% when idle, 100% on hover
|
||||
- Subtle background effect on hover instead of heavy border styling
|
||||
- **File**: `src/styles.css:195-211`
|
||||
|
||||
#### Simplified Table Headers in Preview
|
||||
- Removed gradient background from table headers in modern theme
|
||||
- Changed from `var(--primary-gradient)` (purple gradient) to simple light gray (#f0f0f0)
|
||||
- Updated text color to dark (#333333) for better readability
|
||||
- Clean, professional appearance matching standard themes
|
||||
- **File**: `src/styles-modern.css:445-449`
|
||||
|
||||
### 📥 Enhanced Import Capabilities
|
||||
|
||||
#### Comprehensive Format-to-Markdown Conversion
|
||||
Dramatically expanded the "Import Document" feature to support 30+ file formats:
|
||||
|
||||
**Supported Formats:**
|
||||
- **Documents**: DOCX, ODT, RTF, HTML, HTM, TEX, EPUB, PDF, TXT
|
||||
- **Presentations**: PPTX, ODP
|
||||
- **Markup Languages**: RST, Textile, MediaWiki, Org-mode, AsciiDoc, TWiki, OPML
|
||||
- **E-book Formats**: EPUB, FB2
|
||||
- **LaTeX Formats**: TEX, LATEX, LTX
|
||||
- **Web Formats**: HTML, HTM, XHTML
|
||||
- **Wiki Formats**: MediaWiki, DokuWiki, TikiWiki, TWiki
|
||||
- **Data Formats**: CSV, TSV, JSON
|
||||
|
||||
**Format-Specific Optimizations:**
|
||||
- PDF text extraction with XeLaTeX engine
|
||||
- CSV/TSV automatic table conversion
|
||||
- JSON structure handling
|
||||
- Improved error messages with format hints
|
||||
|
||||
**Access**: File → Import Document (Ctrl+I)
|
||||
**File**: `src/main.js:1933-1994`
|
||||
|
||||
### 🎨 Exhaustive ASCII Art Generator
|
||||
|
||||
#### 5 New Text Banner Styles
|
||||
Complete alphabet (A-Z) and numbers (0-9) support for all styles:
|
||||
|
||||
1. **Standard** - Classic ASCII art with slashes and underscores
|
||||
2. **Banner** - Large format using # characters (7-line height)
|
||||
3. **Block** - Modern Unicode block characters (█ ╔ ╗ ═ ║)
|
||||
4. **Bubble** - Circular bubble letters (Ⓐ Ⓑ Ⓒ)
|
||||
5. **Digital** - Digital display style (▄ ▀ ▐ ▌)
|
||||
|
||||
**File**: `src/renderer.js:3397-3537`
|
||||
|
||||
#### 19 Professional ASCII Templates
|
||||
Organized into 4 categories with expanded options:
|
||||
|
||||
**Arrows & Flow (4 templates):**
|
||||
- Arrow Right - Horizontal flow indicators
|
||||
- Arrow Down - Vertical flow indicators
|
||||
- Decision - Binary decision diagrams
|
||||
- Process Flow - Multi-step process visualization
|
||||
|
||||
**Diagrams & Charts (6 templates):**
|
||||
- Flowchart - Advanced flowchart with decision branches and loops
|
||||
- Sequence - Sequence diagrams for User-System-Database interactions
|
||||
- Network - Server-client network topology
|
||||
- Hierarchy - Organizational tree structures
|
||||
- Timeline - Milestone visualization with dates
|
||||
- Table Simple - Basic table template with borders
|
||||
|
||||
**Boxes & Containers (4 templates):**
|
||||
- Header - Section header with decorative borders
|
||||
- Note Box - Important notes with rounded corners (┏━━┓)
|
||||
- Warning Box - Warning messages with bold borders (╔═══╗)
|
||||
- Info Box - Information boxes with subtle styling (╭───╮)
|
||||
|
||||
**Decorative Elements (6 templates):**
|
||||
- Divider - Horizontal section separator (═══)
|
||||
- Separator Fancy - Elegant rounded divider
|
||||
- Brackets - Japanese-style brackets 【 】
|
||||
- Banner Stars - Star-bordered banners
|
||||
- Checklist - Task lists with ✓ checkmarks
|
||||
- Progress Bar - Visual progress indicators
|
||||
|
||||
**Features:**
|
||||
- All ASCII art automatically wrapped in code blocks for proper rendering
|
||||
- Preserved formatting in markdown preview and all export formats
|
||||
- Categorized template selection interface
|
||||
- Real-time preview generation
|
||||
|
||||
**Access**: Tools → ASCII Art Generator
|
||||
**Files**: `src/renderer.js:3513-3671`, `src/index.html:427-466`
|
||||
|
||||
### 📝 Technical Improvements
|
||||
|
||||
- Enhanced ASCII art detection in Word template exporter
|
||||
- Improved monospace font rendering across all export formats
|
||||
- Better code block preservation in PDF and Word exports
|
||||
- Optimized template categorization and organization
|
||||
|
||||
### 🔧 Files Modified
|
||||
|
||||
- `src/styles.css` - Preview popout button styling
|
||||
- `src/styles-modern.css` - Table header simplification
|
||||
- `src/main.js` - Enhanced import function, version update
|
||||
- `src/renderer.js` - ASCII art generator enhancements
|
||||
- `src/index.html` - ASCII template UI organization
|
||||
- `package.json` - Version bump to 2.1.0
|
||||
|
||||
---
|
||||
|
||||
## Version 2.0.0 (Previous Release)
|
||||
|
||||
### Major Features
|
||||
- Export Profiles - Save and reuse export configurations
|
||||
- Mermaid.js diagram support
|
||||
- Command Palette (Ctrl+Shift+P)
|
||||
- GitHub Light/Dark preview themes
|
||||
- Table Generator
|
||||
- ASCII Art Generator (basic)
|
||||
- Resizable Preview Pane
|
||||
- Pop-out Preview Window
|
||||
- Configurable page sizes (A3-A5, B4-B5, Letter, Legal, Tabloid, Custom)
|
||||
- Custom Headers & Footers for exports
|
||||
- Enhanced PDF and Word export with templates
|
||||
- 22 beautiful themes
|
||||
|
||||
### Core Capabilities
|
||||
- Cross-platform markdown editor with live preview
|
||||
- Universal document conversion (30+ formats)
|
||||
- PDF Editor (merge, split, compress, rotate, watermark, encrypt)
|
||||
- Batch file conversion
|
||||
- File association support
|
||||
- Advanced export options
|
||||
- Multi-tab interface
|
||||
|
||||
---
|
||||
|
||||
## Installation & Usage
|
||||
|
||||
### Prerequisites
|
||||
- **Pandoc** - Required for document conversion
|
||||
- **Optional**: LibreOffice, ImageMagick, FFmpeg for universal converter
|
||||
|
||||
### Download
|
||||
Get the latest release from: https://github.com/amitwh/pan-converter/releases
|
||||
|
||||
### Supported Platforms
|
||||
- Windows (x64)
|
||||
- Linux (AppImage, .deb, .snap)
|
||||
- macOS (planned)
|
||||
|
||||
---
|
||||
|
||||
## Contributing
|
||||
|
||||
Contributions are welcome! Please see [CLAUDE.md](CLAUDE.md) for development guidelines.
|
||||
|
||||
**Author**: Amit Haridas (amit.wh@gmail.com)
|
||||
**License**: MIT
|
||||
**Repository**: https://github.com/amitwh/pan-converter
|
||||
|
||||
+89
-89
@@ -1,89 +1,89 @@
|
||||
/**
|
||||
* ESLint Configuration for PanConverter
|
||||
* Uses flat config format (ESLint 9+)
|
||||
*/
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
// Global ignores
|
||||
ignores: [
|
||||
'node_modules/**',
|
||||
'dist/**',
|
||||
'coverage/**',
|
||||
'*.min.js'
|
||||
]
|
||||
},
|
||||
{
|
||||
// JavaScript files
|
||||
files: ['**/*.js'],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2022,
|
||||
sourceType: 'module',
|
||||
globals: {
|
||||
// Node.js
|
||||
require: 'readonly',
|
||||
module: 'readonly',
|
||||
exports: 'readonly',
|
||||
__dirname: 'readonly',
|
||||
__filename: 'readonly',
|
||||
process: 'readonly',
|
||||
Buffer: 'readonly',
|
||||
console: 'readonly',
|
||||
setTimeout: 'readonly',
|
||||
setInterval: 'readonly',
|
||||
clearTimeout: 'readonly',
|
||||
clearInterval: 'readonly',
|
||||
// Browser
|
||||
window: 'readonly',
|
||||
document: 'readonly',
|
||||
localStorage: 'readonly',
|
||||
alert: 'readonly',
|
||||
Event: 'readonly',
|
||||
CustomEvent: 'readonly',
|
||||
HTMLElement: 'readonly',
|
||||
MutationObserver: 'readonly',
|
||||
// Electron
|
||||
electronAPI: 'readonly',
|
||||
// Libraries
|
||||
marked: 'readonly',
|
||||
DOMPurify: 'readonly',
|
||||
hljs: 'readonly',
|
||||
mermaid: 'readonly',
|
||||
// Jest
|
||||
jest: 'readonly',
|
||||
describe: 'readonly',
|
||||
test: 'readonly',
|
||||
expect: 'readonly',
|
||||
beforeEach: 'readonly',
|
||||
afterEach: 'readonly',
|
||||
beforeAll: 'readonly',
|
||||
afterAll: 'readonly'
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
// Error prevention
|
||||
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
|
||||
'no-undef': 'error',
|
||||
'no-console': 'off', // Allow console for Electron apps
|
||||
|
||||
// Code quality
|
||||
'eqeqeq': ['warn', 'always'],
|
||||
'no-var': 'warn',
|
||||
'prefer-const': 'warn',
|
||||
|
||||
// Style (handled by Prettier)
|
||||
'semi': 'off',
|
||||
'quotes': 'off',
|
||||
'indent': 'off',
|
||||
|
||||
// Async handling
|
||||
'no-async-promise-executor': 'warn',
|
||||
'require-await': 'off',
|
||||
|
||||
// Security
|
||||
'no-eval': 'error',
|
||||
'no-implied-eval': 'error',
|
||||
'no-new-func': 'error'
|
||||
}
|
||||
}
|
||||
];
|
||||
/**
|
||||
* ESLint Configuration for PanConverter
|
||||
* Uses flat config format (ESLint 9+)
|
||||
*/
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
// Global ignores
|
||||
ignores: [
|
||||
'node_modules/**',
|
||||
'dist/**',
|
||||
'coverage/**',
|
||||
'*.min.js'
|
||||
]
|
||||
},
|
||||
{
|
||||
// JavaScript files
|
||||
files: ['**/*.js'],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2022,
|
||||
sourceType: 'module',
|
||||
globals: {
|
||||
// Node.js
|
||||
require: 'readonly',
|
||||
module: 'readonly',
|
||||
exports: 'readonly',
|
||||
__dirname: 'readonly',
|
||||
__filename: 'readonly',
|
||||
process: 'readonly',
|
||||
Buffer: 'readonly',
|
||||
console: 'readonly',
|
||||
setTimeout: 'readonly',
|
||||
setInterval: 'readonly',
|
||||
clearTimeout: 'readonly',
|
||||
clearInterval: 'readonly',
|
||||
// Browser
|
||||
window: 'readonly',
|
||||
document: 'readonly',
|
||||
localStorage: 'readonly',
|
||||
alert: 'readonly',
|
||||
Event: 'readonly',
|
||||
CustomEvent: 'readonly',
|
||||
HTMLElement: 'readonly',
|
||||
MutationObserver: 'readonly',
|
||||
// Electron
|
||||
electronAPI: 'readonly',
|
||||
// Libraries
|
||||
marked: 'readonly',
|
||||
DOMPurify: 'readonly',
|
||||
hljs: 'readonly',
|
||||
mermaid: 'readonly',
|
||||
// Jest
|
||||
jest: 'readonly',
|
||||
describe: 'readonly',
|
||||
test: 'readonly',
|
||||
expect: 'readonly',
|
||||
beforeEach: 'readonly',
|
||||
afterEach: 'readonly',
|
||||
beforeAll: 'readonly',
|
||||
afterAll: 'readonly'
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
// Error prevention
|
||||
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
|
||||
'no-undef': 'error',
|
||||
'no-console': 'off', // Allow console for Electron apps
|
||||
|
||||
// Code quality
|
||||
'eqeqeq': ['warn', 'always'],
|
||||
'no-var': 'warn',
|
||||
'prefer-const': 'warn',
|
||||
|
||||
// Style (handled by Prettier)
|
||||
'semi': 'off',
|
||||
'quotes': 'off',
|
||||
'indent': 'off',
|
||||
|
||||
// Async handling
|
||||
'no-async-promise-executor': 'warn',
|
||||
'require-await': 'off',
|
||||
|
||||
// Security
|
||||
'no-eval': 'error',
|
||||
'no-implied-eval': 'error',
|
||||
'no-new-func': 'error'
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
+59
-59
@@ -1,59 +1,59 @@
|
||||
/**
|
||||
* Jest Configuration for PanConverter
|
||||
* @version 2.2.0
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
// Test environment
|
||||
testEnvironment: 'jsdom',
|
||||
|
||||
// Root directory
|
||||
rootDir: '.',
|
||||
|
||||
// Test file patterns
|
||||
testMatch: [
|
||||
'**/tests/**/*.test.js',
|
||||
'**/tests/**/*.spec.js'
|
||||
],
|
||||
|
||||
// Coverage configuration
|
||||
collectCoverageFrom: [
|
||||
'src/**/*.js',
|
||||
'!src/main.js', // Main process needs electron-mock
|
||||
'!**/node_modules/**'
|
||||
],
|
||||
|
||||
// Coverage thresholds (start low, increase over time)
|
||||
coverageThreshold: {
|
||||
global: {
|
||||
branches: 10,
|
||||
functions: 10,
|
||||
lines: 10,
|
||||
statements: 10
|
||||
}
|
||||
},
|
||||
|
||||
// Transform settings (no transpilation needed for vanilla JS)
|
||||
transform: {},
|
||||
|
||||
// Module paths
|
||||
moduleDirectories: ['node_modules', 'src'],
|
||||
|
||||
// Setup files
|
||||
setupFilesAfterEnv: ['<rootDir>/tests/setup.js'],
|
||||
|
||||
// Ignore patterns
|
||||
testPathIgnorePatterns: [
|
||||
'/node_modules/',
|
||||
'/dist/'
|
||||
],
|
||||
|
||||
// Verbose output
|
||||
verbose: true,
|
||||
|
||||
// Clear mocks between tests
|
||||
clearMocks: true,
|
||||
|
||||
// Reset modules between tests
|
||||
resetModules: true
|
||||
};
|
||||
/**
|
||||
* Jest Configuration for PanConverter
|
||||
* @version 2.2.0
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
// Test environment
|
||||
testEnvironment: 'jsdom',
|
||||
|
||||
// Root directory
|
||||
rootDir: '.',
|
||||
|
||||
// Test file patterns
|
||||
testMatch: [
|
||||
'**/tests/**/*.test.js',
|
||||
'**/tests/**/*.spec.js'
|
||||
],
|
||||
|
||||
// Coverage configuration
|
||||
collectCoverageFrom: [
|
||||
'src/**/*.js',
|
||||
'!src/main.js', // Main process needs electron-mock
|
||||
'!**/node_modules/**'
|
||||
],
|
||||
|
||||
// Coverage thresholds (start low, increase over time)
|
||||
coverageThreshold: {
|
||||
global: {
|
||||
branches: 10,
|
||||
functions: 10,
|
||||
lines: 10,
|
||||
statements: 10
|
||||
}
|
||||
},
|
||||
|
||||
// Transform settings (no transpilation needed for vanilla JS)
|
||||
transform: {},
|
||||
|
||||
// Module paths
|
||||
moduleDirectories: ['node_modules', 'src'],
|
||||
|
||||
// Setup files
|
||||
setupFilesAfterEnv: ['<rootDir>/tests/setup.js'],
|
||||
|
||||
// Ignore patterns
|
||||
testPathIgnorePatterns: [
|
||||
'/node_modules/',
|
||||
'/dist/'
|
||||
],
|
||||
|
||||
// Verbose output
|
||||
verbose: true,
|
||||
|
||||
// Clear mocks between tests
|
||||
clearMocks: true,
|
||||
|
||||
// Reset modules between tests
|
||||
resetModules: true
|
||||
};
|
||||
|
||||
+181
-182
@@ -1,182 +1,181 @@
|
||||
{
|
||||
"name": "markdown-converter",
|
||||
"version": "3.0.0",
|
||||
"description": "Professional Markdown editor and universal file converter with PDF editing, batch processing, and syntax highlighting",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
"start": "electron .",
|
||||
"test": "jest",
|
||||
"test:watch": "jest --watch",
|
||||
"test:coverage": "jest --coverage",
|
||||
"lint": "eslint src tests",
|
||||
"lint:fix": "eslint src tests --fix",
|
||||
"format": "prettier --write src tests",
|
||||
"format:check": "prettier --check src tests",
|
||||
"build": "electron-builder",
|
||||
"build:win": "electron-builder --win",
|
||||
"build:win-signed": "cross-env CSC_LINK=code-signing-cert.pfx CSC_KEY_PASSWORD=%CSC_KEY_PASSWORD% electron-builder --win",
|
||||
"build:win-unsigned": "cross-env CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder --win",
|
||||
"build:mac": "electron-builder --mac",
|
||||
"build:linux": "electron-builder --linux",
|
||||
"dist": "electron-builder --publish=never",
|
||||
"dist:all": "electron-builder -mwl",
|
||||
"generate-icons": "node scripts/generate-icons.js"
|
||||
},
|
||||
"keywords": [
|
||||
"markdown",
|
||||
"pandoc",
|
||||
"converter",
|
||||
"editor",
|
||||
"pdf",
|
||||
"audio",
|
||||
"video",
|
||||
"image"
|
||||
],
|
||||
"author": "ConcreteInfo <amit.wh@gmail.com>",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/amitwh/markdown-converter"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@testing-library/dom": "^10.4.1",
|
||||
"cross-env": "^10.0.0",
|
||||
"electron": "^37.4.0",
|
||||
"electron-builder": "^26.0.12",
|
||||
"eslint": "^9.39.2",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-prettier": "^5.5.4",
|
||||
"jest": "^30.2.0",
|
||||
"jest-environment-jsdom": "^30.2.0",
|
||||
"prettier": "^3.7.4",
|
||||
"sharp": "^0.34.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"codemirror": "^6.0.2",
|
||||
"core-util-is": "^1.0.3",
|
||||
"docx": "^9.5.1",
|
||||
"docx4js": "^3.3.0",
|
||||
"dompurify": "^3.2.6",
|
||||
"electron-store": "^10.1.0",
|
||||
"highlight.js": "^11.11.1",
|
||||
"html2pdf.js": "^0.10.1",
|
||||
"marked": "^16.2.1",
|
||||
"pdf-lib": "^1.17.1",
|
||||
"pdfjs-dist": "^3.11.174",
|
||||
"pdfkit": "^0.14.0",
|
||||
"pizzip": "^3.2.0",
|
||||
"tslib": "^2.8.1",
|
||||
"xlsx": "^0.18.5"
|
||||
},
|
||||
"build": {
|
||||
"appId": "com.concreteinfo.markdownconverter",
|
||||
"productName": "MarkdownConverter",
|
||||
"directories": {
|
||||
"output": "dist"
|
||||
},
|
||||
"icon": "assets/icon",
|
||||
"files": [
|
||||
"src/**/*",
|
||||
"assets/**/*",
|
||||
"scripts/**/*",
|
||||
"node_modules/**/*",
|
||||
"package.json"
|
||||
],
|
||||
"fileAssociations": [
|
||||
{
|
||||
"ext": "md",
|
||||
"name": "Markdown Document",
|
||||
"description": "Markdown Document",
|
||||
"mimeType": "text/markdown",
|
||||
"role": "Editor"
|
||||
},
|
||||
{
|
||||
"ext": "markdown",
|
||||
"name": "Markdown Document",
|
||||
"description": "Markdown Document",
|
||||
"mimeType": "text/markdown",
|
||||
"role": "Editor"
|
||||
},
|
||||
{
|
||||
"ext": "pdf",
|
||||
"name": "PDF Document",
|
||||
"description": "PDF Document",
|
||||
"mimeType": "application/pdf",
|
||||
"role": "Editor"
|
||||
}
|
||||
],
|
||||
"mac": {
|
||||
"category": "public.app-category.productivity",
|
||||
"identity": null
|
||||
},
|
||||
"win": {
|
||||
"target": [
|
||||
{
|
||||
"target": "nsis",
|
||||
"arch": [
|
||||
"x64"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "portable",
|
||||
"arch": [
|
||||
"x64"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "zip",
|
||||
"arch": [
|
||||
"x64"
|
||||
]
|
||||
}
|
||||
],
|
||||
"artifactName": "${productName}-${version}-${arch}.${ext}",
|
||||
"requestedExecutionLevel": "asInvoker",
|
||||
"signAndEditExecutable": false
|
||||
},
|
||||
"nsis": {
|
||||
"oneClick": false,
|
||||
"perMachine": false,
|
||||
"allowToChangeInstallationDirectory": true,
|
||||
"displayLanguageSelector": true,
|
||||
"createDesktopShortcut": true,
|
||||
"createStartMenuShortcut": true,
|
||||
"shortcutName": "MarkdownConverter",
|
||||
"runAfterFinish": true,
|
||||
"menuCategory": "Productivity",
|
||||
"license": "LICENSE",
|
||||
"warningsAsErrors": false,
|
||||
"artifactName": "${productName}-Setup-${version}.${ext}",
|
||||
"deleteAppDataOnUninstall": false,
|
||||
"differentialPackage": true
|
||||
},
|
||||
"linux": {
|
||||
"target": [
|
||||
"deb",
|
||||
"AppImage",
|
||||
"snap",
|
||||
"rpm"
|
||||
],
|
||||
"category": "Utility",
|
||||
"maintainer": "ConcreteInfo <amit.wh@gmail.com>"
|
||||
},
|
||||
"deb": {
|
||||
"depends": [
|
||||
"pandoc",
|
||||
"ffmpeg",
|
||||
"imagemagick",
|
||||
"libreoffice-common"
|
||||
],
|
||||
"description": "Professional Markdown editor and universal file converter",
|
||||
"maintainer": "ConcreteInfo <amit.wh@gmail.com>"
|
||||
},
|
||||
"rpm": {
|
||||
"depends": [
|
||||
"pandoc",
|
||||
"ffmpeg",
|
||||
"ImageMagick",
|
||||
"libreoffice-core"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
"name": "markdown-converter",
|
||||
"version": "3.0.0",
|
||||
"description": "Professional Markdown editor and universal file converter with PDF editing, batch processing, and syntax highlighting",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
"start": "electron .",
|
||||
"test": "jest",
|
||||
"test:watch": "jest --watch",
|
||||
"test:coverage": "jest --coverage",
|
||||
"lint": "eslint src tests",
|
||||
"lint:fix": "eslint src tests --fix",
|
||||
"format": "prettier --write src tests",
|
||||
"format:check": "prettier --check src tests",
|
||||
"build": "electron-builder",
|
||||
"build:win": "electron-builder --win",
|
||||
"build:win-signed": "cross-env CSC_LINK=code-signing-cert.pfx CSC_KEY_PASSWORD=%CSC_KEY_PASSWORD% electron-builder --win",
|
||||
"build:win-unsigned": "cross-env CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder --win",
|
||||
"build:mac": "electron-builder --mac",
|
||||
"build:linux": "electron-builder --linux",
|
||||
"dist": "electron-builder --publish=never",
|
||||
"dist:all": "electron-builder -mwl",
|
||||
"generate-icons": "node scripts/generate-icons.js"
|
||||
},
|
||||
"keywords": [
|
||||
"markdown",
|
||||
"pandoc",
|
||||
"converter",
|
||||
"editor",
|
||||
"pdf",
|
||||
"audio",
|
||||
"video",
|
||||
"image"
|
||||
],
|
||||
"author": "ConcreteInfo <amit.wh@gmail.com>",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/amitwh/markdown-converter"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@testing-library/dom": "^10.4.1",
|
||||
"cross-env": "^10.0.0",
|
||||
"electron": "^37.4.0",
|
||||
"electron-builder": "^26.0.12",
|
||||
"eslint": "^9.39.2",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-prettier": "^5.5.4",
|
||||
"jest": "^30.2.0",
|
||||
"jest-environment-jsdom": "^30.2.0",
|
||||
"prettier": "^3.7.4",
|
||||
"sharp": "^0.34.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"codemirror": "^6.0.2",
|
||||
"core-util-is": "^1.0.3",
|
||||
"docx": "^9.5.1",
|
||||
"docx4js": "^3.3.0",
|
||||
"dompurify": "^3.2.6",
|
||||
"electron-store": "^10.1.0",
|
||||
"highlight.js": "^11.11.1",
|
||||
"html2pdf.js": "^0.10.1",
|
||||
"marked": "^16.2.1",
|
||||
"pdf-lib": "^1.17.1",
|
||||
"pdfjs-dist": "^3.11.174",
|
||||
"pdfkit": "^0.14.0",
|
||||
"pizzip": "^3.2.0",
|
||||
"tslib": "^2.8.1",
|
||||
"xlsx": "^0.18.5"
|
||||
},
|
||||
"build": {
|
||||
"appId": "com.concreteinfo.markdownconverter",
|
||||
"productName": "MarkdownConverter",
|
||||
"directories": {
|
||||
"output": "dist"
|
||||
},
|
||||
"icon": "assets/icon",
|
||||
"files": [
|
||||
"src/**/*",
|
||||
"assets/**/*",
|
||||
"scripts/**/*",
|
||||
"node_modules/**/*",
|
||||
"package.json"
|
||||
],
|
||||
"fileAssociations": [
|
||||
{
|
||||
"ext": "md",
|
||||
"name": "Markdown Document",
|
||||
"description": "Markdown Document",
|
||||
"mimeType": "text/markdown",
|
||||
"role": "Editor"
|
||||
},
|
||||
{
|
||||
"ext": "markdown",
|
||||
"name": "Markdown Document",
|
||||
"description": "Markdown Document",
|
||||
"mimeType": "text/markdown",
|
||||
"role": "Editor"
|
||||
},
|
||||
{
|
||||
"ext": "pdf",
|
||||
"name": "PDF Document",
|
||||
"description": "PDF Document",
|
||||
"mimeType": "application/pdf",
|
||||
"role": "Editor"
|
||||
}
|
||||
],
|
||||
"mac": {
|
||||
"category": "public.app-category.productivity",
|
||||
"identity": null
|
||||
},
|
||||
"win": {
|
||||
"target": [
|
||||
{
|
||||
"target": "nsis",
|
||||
"arch": [
|
||||
"x64"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "portable",
|
||||
"arch": [
|
||||
"x64"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "zip",
|
||||
"arch": [
|
||||
"x64"
|
||||
]
|
||||
}
|
||||
],
|
||||
"artifactName": "${productName}-${version}-${arch}.${ext}",
|
||||
"requestedExecutionLevel": "asInvoker",
|
||||
"signAndEditExecutable": false
|
||||
},
|
||||
"nsis": {
|
||||
"oneClick": false,
|
||||
"perMachine": false,
|
||||
"allowToChangeInstallationDirectory": true,
|
||||
"displayLanguageSelector": true,
|
||||
"createDesktopShortcut": true,
|
||||
"createStartMenuShortcut": true,
|
||||
"shortcutName": "MarkdownConverter",
|
||||
"runAfterFinish": true,
|
||||
"menuCategory": "Productivity",
|
||||
"license": "LICENSE",
|
||||
"warningsAsErrors": false,
|
||||
"artifactName": "${productName}-Setup-${version}.${ext}",
|
||||
"deleteAppDataOnUninstall": false,
|
||||
"differentialPackage": true
|
||||
},
|
||||
"linux": {
|
||||
"target": [
|
||||
"deb",
|
||||
"AppImage",
|
||||
"snap"
|
||||
],
|
||||
"category": "Utility",
|
||||
"maintainer": "ConcreteInfo <amit.wh@gmail.com>"
|
||||
},
|
||||
"deb": {
|
||||
"depends": [
|
||||
"pandoc",
|
||||
"ffmpeg",
|
||||
"imagemagick",
|
||||
"libreoffice-common"
|
||||
],
|
||||
"description": "Professional Markdown editor and universal file converter",
|
||||
"maintainer": "ConcreteInfo <amit.wh@gmail.com>"
|
||||
},
|
||||
"rpm": {
|
||||
"depends": [
|
||||
"pandoc",
|
||||
"ffmpeg",
|
||||
"ImageMagick",
|
||||
"libreoffice-core"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+82
-82
@@ -1,83 +1,83 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "=========================================="
|
||||
echo "Pan Converter - GitHub Push Helper"
|
||||
echo "=========================================="
|
||||
echo ""
|
||||
echo "Before running this script, please ensure:"
|
||||
echo "1. You have created a repository named 'pan-converter' on GitHub"
|
||||
echo "2. The repository is empty (no README, .gitignore, or license)"
|
||||
echo "3. You have set up authentication (SSH key or Personal Access Token)"
|
||||
echo ""
|
||||
read -p "Have you completed the above steps? (y/n): " -n 1 -r
|
||||
echo ""
|
||||
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||
echo "Please complete the setup first:"
|
||||
echo "1. Go to https://github.com/new"
|
||||
echo "2. Create a new repository named 'pan-converter'"
|
||||
echo "3. DO NOT initialize with README, .gitignore, or license"
|
||||
echo "4. Set up SSH key or Personal Access Token for authentication"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Choose authentication method:"
|
||||
echo "1. SSH (Recommended if you have SSH keys set up)"
|
||||
echo "2. HTTPS (Requires Personal Access Token)"
|
||||
read -p "Enter your choice (1 or 2): " AUTH_CHOICE
|
||||
|
||||
if [ "$AUTH_CHOICE" = "1" ]; then
|
||||
echo "Using SSH authentication..."
|
||||
git remote set-url origin git@github.com:amitwh/pan-converter.git
|
||||
elif [ "$AUTH_CHOICE" = "2" ]; then
|
||||
echo "Using HTTPS authentication..."
|
||||
echo "You'll need to enter your GitHub username and Personal Access Token"
|
||||
git remote set-url origin https://github.com/amitwh/pan-converter.git
|
||||
else
|
||||
echo "Invalid choice. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Pushing branches to GitHub..."
|
||||
echo "=============================="
|
||||
|
||||
# Push master branch with upstream tracking
|
||||
echo "Pushing master branch..."
|
||||
if git push -u origin master; then
|
||||
echo "✓ Master branch pushed successfully"
|
||||
else
|
||||
echo "✗ Failed to push master branch"
|
||||
echo "Please check your authentication and try again"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Push other branches
|
||||
echo "Pushing linux branch..."
|
||||
if git push origin linux; then
|
||||
echo "✓ Linux branch pushed successfully"
|
||||
else
|
||||
echo "✗ Failed to push linux branch"
|
||||
fi
|
||||
|
||||
echo "Pushing macos branch..."
|
||||
if git push origin macos; then
|
||||
echo "✓ macOS branch pushed successfully"
|
||||
else
|
||||
echo "✗ Failed to push macos branch"
|
||||
fi
|
||||
|
||||
echo "Pushing windows branch..."
|
||||
if git push origin windows; then
|
||||
echo "✓ Windows branch pushed successfully"
|
||||
else
|
||||
echo "✗ Failed to push windows branch"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "=========================================="
|
||||
echo "Push complete!"
|
||||
echo "Your repository is available at:"
|
||||
echo "https://github.com/amitwh/pan-converter"
|
||||
#!/bin/bash
|
||||
|
||||
echo "=========================================="
|
||||
echo "Pan Converter - GitHub Push Helper"
|
||||
echo "=========================================="
|
||||
echo ""
|
||||
echo "Before running this script, please ensure:"
|
||||
echo "1. You have created a repository named 'pan-converter' on GitHub"
|
||||
echo "2. The repository is empty (no README, .gitignore, or license)"
|
||||
echo "3. You have set up authentication (SSH key or Personal Access Token)"
|
||||
echo ""
|
||||
read -p "Have you completed the above steps? (y/n): " -n 1 -r
|
||||
echo ""
|
||||
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||
echo "Please complete the setup first:"
|
||||
echo "1. Go to https://github.com/new"
|
||||
echo "2. Create a new repository named 'pan-converter'"
|
||||
echo "3. DO NOT initialize with README, .gitignore, or license"
|
||||
echo "4. Set up SSH key or Personal Access Token for authentication"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Choose authentication method:"
|
||||
echo "1. SSH (Recommended if you have SSH keys set up)"
|
||||
echo "2. HTTPS (Requires Personal Access Token)"
|
||||
read -p "Enter your choice (1 or 2): " AUTH_CHOICE
|
||||
|
||||
if [ "$AUTH_CHOICE" = "1" ]; then
|
||||
echo "Using SSH authentication..."
|
||||
git remote set-url origin git@github.com:amitwh/pan-converter.git
|
||||
elif [ "$AUTH_CHOICE" = "2" ]; then
|
||||
echo "Using HTTPS authentication..."
|
||||
echo "You'll need to enter your GitHub username and Personal Access Token"
|
||||
git remote set-url origin https://github.com/amitwh/pan-converter.git
|
||||
else
|
||||
echo "Invalid choice. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Pushing branches to GitHub..."
|
||||
echo "=============================="
|
||||
|
||||
# Push master branch with upstream tracking
|
||||
echo "Pushing master branch..."
|
||||
if git push -u origin master; then
|
||||
echo "✓ Master branch pushed successfully"
|
||||
else
|
||||
echo "✗ Failed to push master branch"
|
||||
echo "Please check your authentication and try again"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Push other branches
|
||||
echo "Pushing linux branch..."
|
||||
if git push origin linux; then
|
||||
echo "✓ Linux branch pushed successfully"
|
||||
else
|
||||
echo "✗ Failed to push linux branch"
|
||||
fi
|
||||
|
||||
echo "Pushing macos branch..."
|
||||
if git push origin macos; then
|
||||
echo "✓ macOS branch pushed successfully"
|
||||
else
|
||||
echo "✗ Failed to push macos branch"
|
||||
fi
|
||||
|
||||
echo "Pushing windows branch..."
|
||||
if git push origin windows; then
|
||||
echo "✓ Windows branch pushed successfully"
|
||||
else
|
||||
echo "✗ Failed to push windows branch"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "=========================================="
|
||||
echo "Push complete!"
|
||||
echo "Your repository is available at:"
|
||||
echo "https://github.com/amitwh/pan-converter"
|
||||
echo "=========================================="
|
||||
+115
-115
@@ -1,116 +1,116 @@
|
||||
# PanConverter Windows Explorer Context Menu Integration
|
||||
|
||||
This directory contains scripts to add PanConverter to the Windows Explorer context menu, allowing you to right-click on files and convert them directly without opening the full application.
|
||||
|
||||
## Features
|
||||
|
||||
### Context Menu Options
|
||||
- **Convert with PanConverter**: Shows a format selection dialog for any supported file
|
||||
- **PanConverter > Convert to...**: Direct conversion options (for Markdown files)
|
||||
- PDF
|
||||
- HTML
|
||||
- DOCX
|
||||
- LaTeX
|
||||
- PowerPoint
|
||||
|
||||
### Supported File Types
|
||||
- **Markdown**: `.md`, `.markdown`
|
||||
- **HTML**: `.html`, `.htm`
|
||||
- **Documents**: `.docx`, `.odt`, `.rtf`
|
||||
- **LaTeX**: `.tex`
|
||||
- **PDF**: `.pdf`
|
||||
- **Presentations**: `.pptx`, `.ppt`, `.odp`
|
||||
|
||||
## Installation Methods
|
||||
|
||||
### Method 1: Automatic (During PanConverter Installation)
|
||||
When installing PanConverter using the Windows installer, you'll be prompted to install context menu integration automatically.
|
||||
|
||||
### Method 2: Manual Installation
|
||||
|
||||
#### Using PowerShell (Recommended)
|
||||
1. Right-click on `install-context-menu.ps1`
|
||||
2. Select "Run with PowerShell"
|
||||
3. Follow the prompts (will request administrator privileges)
|
||||
|
||||
#### Using Batch File
|
||||
1. Right-click on `install-context-menu.bat`
|
||||
2. Select "Run as administrator"
|
||||
3. Follow the prompts
|
||||
|
||||
#### Using Registry File Directly
|
||||
1. Right-click on `install-context-menu.reg`
|
||||
2. Select "Merge"
|
||||
3. Confirm the registry modification
|
||||
|
||||
## Uninstallation
|
||||
|
||||
### Using PowerShell
|
||||
```powershell
|
||||
.\install-context-menu.ps1 -Uninstall
|
||||
```
|
||||
|
||||
### Using Batch File
|
||||
Run `uninstall-context-menu.bat` as administrator
|
||||
|
||||
### Using Registry File
|
||||
Run `uninstall-context-menu.reg`
|
||||
|
||||
## How It Works
|
||||
|
||||
### Command Line Interface
|
||||
The context menu integration works by passing command line arguments to PanConverter:
|
||||
|
||||
- `--convert <file>`: Shows conversion dialog for the specified file
|
||||
- `--convert-to <format> <file>`: Directly converts to the specified format
|
||||
|
||||
### Examples
|
||||
```batch
|
||||
# Show conversion dialog
|
||||
PanConverter.exe --convert "document.md"
|
||||
|
||||
# Direct conversion to PDF
|
||||
PanConverter.exe --convert-to pdf "document.md"
|
||||
```
|
||||
|
||||
### Conversion Process
|
||||
1. PanConverter reads the input file
|
||||
2. Creates a temporary file if needed
|
||||
3. Uses Pandoc to convert to the target format
|
||||
4. Saves the output in the same directory as the input file
|
||||
5. Shows a Windows notification when complete
|
||||
|
||||
## Requirements
|
||||
|
||||
- PanConverter must be installed in the default location: `%LOCALAPPDATA%\Programs\PanConverter\`
|
||||
- Pandoc must be installed and accessible from the command line
|
||||
- Administrator privileges required for registry modifications
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Context Menu Not Appearing
|
||||
1. Ensure you ran the installation script as administrator
|
||||
2. Try logging out and back in, or restart Windows Explorer
|
||||
3. Check if PanConverter is installed in the expected location
|
||||
|
||||
### Conversion Failures
|
||||
1. Verify Pandoc is installed: `pandoc --version`
|
||||
2. Check if the input file is not corrupted or locked
|
||||
3. Ensure you have write permissions in the output directory
|
||||
|
||||
### Permission Errors
|
||||
- The installation scripts require administrator privileges to modify the registry
|
||||
- If you get permission errors, right-click and "Run as administrator"
|
||||
|
||||
## File Descriptions
|
||||
|
||||
- `install-context-menu.reg`: Registry entries for context menu
|
||||
- `uninstall-context-menu.reg`: Registry entries removal
|
||||
- `install-context-menu.ps1`: PowerShell installation script
|
||||
- `install-context-menu.bat`: Batch installation script
|
||||
- `uninstall-context-menu.bat`: Batch uninstallation script
|
||||
- `nsis-installer.nsh`: NSIS installer integration script
|
||||
|
||||
## Security Note
|
||||
|
||||
# PanConverter Windows Explorer Context Menu Integration
|
||||
|
||||
This directory contains scripts to add PanConverter to the Windows Explorer context menu, allowing you to right-click on files and convert them directly without opening the full application.
|
||||
|
||||
## Features
|
||||
|
||||
### Context Menu Options
|
||||
- **Convert with PanConverter**: Shows a format selection dialog for any supported file
|
||||
- **PanConverter > Convert to...**: Direct conversion options (for Markdown files)
|
||||
- PDF
|
||||
- HTML
|
||||
- DOCX
|
||||
- LaTeX
|
||||
- PowerPoint
|
||||
|
||||
### Supported File Types
|
||||
- **Markdown**: `.md`, `.markdown`
|
||||
- **HTML**: `.html`, `.htm`
|
||||
- **Documents**: `.docx`, `.odt`, `.rtf`
|
||||
- **LaTeX**: `.tex`
|
||||
- **PDF**: `.pdf`
|
||||
- **Presentations**: `.pptx`, `.ppt`, `.odp`
|
||||
|
||||
## Installation Methods
|
||||
|
||||
### Method 1: Automatic (During PanConverter Installation)
|
||||
When installing PanConverter using the Windows installer, you'll be prompted to install context menu integration automatically.
|
||||
|
||||
### Method 2: Manual Installation
|
||||
|
||||
#### Using PowerShell (Recommended)
|
||||
1. Right-click on `install-context-menu.ps1`
|
||||
2. Select "Run with PowerShell"
|
||||
3. Follow the prompts (will request administrator privileges)
|
||||
|
||||
#### Using Batch File
|
||||
1. Right-click on `install-context-menu.bat`
|
||||
2. Select "Run as administrator"
|
||||
3. Follow the prompts
|
||||
|
||||
#### Using Registry File Directly
|
||||
1. Right-click on `install-context-menu.reg`
|
||||
2. Select "Merge"
|
||||
3. Confirm the registry modification
|
||||
|
||||
## Uninstallation
|
||||
|
||||
### Using PowerShell
|
||||
```powershell
|
||||
.\install-context-menu.ps1 -Uninstall
|
||||
```
|
||||
|
||||
### Using Batch File
|
||||
Run `uninstall-context-menu.bat` as administrator
|
||||
|
||||
### Using Registry File
|
||||
Run `uninstall-context-menu.reg`
|
||||
|
||||
## How It Works
|
||||
|
||||
### Command Line Interface
|
||||
The context menu integration works by passing command line arguments to PanConverter:
|
||||
|
||||
- `--convert <file>`: Shows conversion dialog for the specified file
|
||||
- `--convert-to <format> <file>`: Directly converts to the specified format
|
||||
|
||||
### Examples
|
||||
```batch
|
||||
# Show conversion dialog
|
||||
PanConverter.exe --convert "document.md"
|
||||
|
||||
# Direct conversion to PDF
|
||||
PanConverter.exe --convert-to pdf "document.md"
|
||||
```
|
||||
|
||||
### Conversion Process
|
||||
1. PanConverter reads the input file
|
||||
2. Creates a temporary file if needed
|
||||
3. Uses Pandoc to convert to the target format
|
||||
4. Saves the output in the same directory as the input file
|
||||
5. Shows a Windows notification when complete
|
||||
|
||||
## Requirements
|
||||
|
||||
- PanConverter must be installed in the default location: `%LOCALAPPDATA%\Programs\PanConverter\`
|
||||
- Pandoc must be installed and accessible from the command line
|
||||
- Administrator privileges required for registry modifications
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Context Menu Not Appearing
|
||||
1. Ensure you ran the installation script as administrator
|
||||
2. Try logging out and back in, or restart Windows Explorer
|
||||
3. Check if PanConverter is installed in the expected location
|
||||
|
||||
### Conversion Failures
|
||||
1. Verify Pandoc is installed: `pandoc --version`
|
||||
2. Check if the input file is not corrupted or locked
|
||||
3. Ensure you have write permissions in the output directory
|
||||
|
||||
### Permission Errors
|
||||
- The installation scripts require administrator privileges to modify the registry
|
||||
- If you get permission errors, right-click and "Run as administrator"
|
||||
|
||||
## File Descriptions
|
||||
|
||||
- `install-context-menu.reg`: Registry entries for context menu
|
||||
- `uninstall-context-menu.reg`: Registry entries removal
|
||||
- `install-context-menu.ps1`: PowerShell installation script
|
||||
- `install-context-menu.bat`: Batch installation script
|
||||
- `uninstall-context-menu.bat`: Batch uninstallation script
|
||||
- `nsis-installer.nsh`: NSIS installer integration script
|
||||
|
||||
## Security Note
|
||||
|
||||
The scripts modify the Windows registry to add context menu entries. Only run these scripts if you trust the source and understand the changes being made to your system.
|
||||
+82
-82
@@ -1,82 +1,82 @@
|
||||
/**
|
||||
* Icon Generator for MarkdownConverter
|
||||
* Generates all required icon sizes from NewIcon.jpg
|
||||
*/
|
||||
|
||||
const sharp = require('sharp');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
// Source image
|
||||
const sourceImage = path.join(__dirname, '..', 'assets', 'docico1.png');
|
||||
const assetsDir = path.join(__dirname, '..', 'assets');
|
||||
|
||||
// Icon sizes needed for different platforms
|
||||
const iconSizes = [16, 24, 32, 48, 64, 128, 256, 512, 1024];
|
||||
|
||||
async function generateIcons() {
|
||||
console.log('Generating icons from docico1.png...');
|
||||
|
||||
// Check if source exists
|
||||
if (!fs.existsSync(sourceImage)) {
|
||||
console.error('Source image not found:', sourceImage);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
try {
|
||||
// Generate main icon.png (512x512)
|
||||
await sharp(sourceImage)
|
||||
.resize(512, 512, { fit: 'contain', background: { r: 255, g: 255, b: 255, alpha: 0 } })
|
||||
.png()
|
||||
.toFile(path.join(assetsDir, 'icon.png'));
|
||||
console.log('Generated icon.png (512x512)');
|
||||
|
||||
// Generate icon@2x.png (1024x1024)
|
||||
await sharp(sourceImage)
|
||||
.resize(1024, 1024, { fit: 'contain', background: { r: 255, g: 255, b: 255, alpha: 0 } })
|
||||
.png()
|
||||
.toFile(path.join(assetsDir, 'icon@2x.png'));
|
||||
console.log('Generated icon@2x.png (1024x1024)');
|
||||
|
||||
// Create icons directory for multi-size icons
|
||||
const iconsDir = path.join(assetsDir, 'icons');
|
||||
if (!fs.existsSync(iconsDir)) {
|
||||
fs.mkdirSync(iconsDir, { recursive: true });
|
||||
}
|
||||
|
||||
// Generate all sizes
|
||||
for (const size of iconSizes) {
|
||||
await sharp(sourceImage)
|
||||
.resize(size, size, { fit: 'contain', background: { r: 255, g: 255, b: 255, alpha: 0 } })
|
||||
.png()
|
||||
.toFile(path.join(iconsDir, `${size}x${size}.png`));
|
||||
console.log(`Generated icons/${size}x${size}.png`);
|
||||
}
|
||||
|
||||
// Generate favicon
|
||||
await sharp(sourceImage)
|
||||
.resize(32, 32, { fit: 'contain', background: { r: 255, g: 255, b: 255, alpha: 0 } })
|
||||
.png()
|
||||
.toFile(path.join(assetsDir, 'favicon.png'));
|
||||
console.log('Generated favicon.png (32x32)');
|
||||
|
||||
// Generate tray icon (smaller, for system tray)
|
||||
await sharp(sourceImage)
|
||||
.resize(24, 24, { fit: 'contain', background: { r: 255, g: 255, b: 255, alpha: 0 } })
|
||||
.png()
|
||||
.toFile(path.join(assetsDir, 'tray-icon.png'));
|
||||
console.log('Generated tray-icon.png (24x24)');
|
||||
|
||||
console.log('\nIcon generation complete!');
|
||||
console.log('\nFor Windows .ico file, use an online converter or:');
|
||||
console.log(' magick convert assets/icons/*.png assets/icon.ico');
|
||||
console.log('\nFor macOS .icns file, use:');
|
||||
console.log(' iconutil -c icns assets/icon.iconset -o assets/icon.icns');
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error generating icons:', error);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
generateIcons();
|
||||
/**
|
||||
* Icon Generator for MarkdownConverter
|
||||
* Generates all required icon sizes from NewIcon.jpg
|
||||
*/
|
||||
|
||||
const sharp = require('sharp');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
// Source image
|
||||
const sourceImage = path.join(__dirname, '..', 'assets', 'docico1.png');
|
||||
const assetsDir = path.join(__dirname, '..', 'assets');
|
||||
|
||||
// Icon sizes needed for different platforms
|
||||
const iconSizes = [16, 24, 32, 48, 64, 128, 256, 512, 1024];
|
||||
|
||||
async function generateIcons() {
|
||||
console.log('Generating icons from docico1.png...');
|
||||
|
||||
// Check if source exists
|
||||
if (!fs.existsSync(sourceImage)) {
|
||||
console.error('Source image not found:', sourceImage);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
try {
|
||||
// Generate main icon.png (512x512)
|
||||
await sharp(sourceImage)
|
||||
.resize(512, 512, { fit: 'contain', background: { r: 255, g: 255, b: 255, alpha: 0 } })
|
||||
.png()
|
||||
.toFile(path.join(assetsDir, 'icon.png'));
|
||||
console.log('Generated icon.png (512x512)');
|
||||
|
||||
// Generate icon@2x.png (1024x1024)
|
||||
await sharp(sourceImage)
|
||||
.resize(1024, 1024, { fit: 'contain', background: { r: 255, g: 255, b: 255, alpha: 0 } })
|
||||
.png()
|
||||
.toFile(path.join(assetsDir, 'icon@2x.png'));
|
||||
console.log('Generated icon@2x.png (1024x1024)');
|
||||
|
||||
// Create icons directory for multi-size icons
|
||||
const iconsDir = path.join(assetsDir, 'icons');
|
||||
if (!fs.existsSync(iconsDir)) {
|
||||
fs.mkdirSync(iconsDir, { recursive: true });
|
||||
}
|
||||
|
||||
// Generate all sizes
|
||||
for (const size of iconSizes) {
|
||||
await sharp(sourceImage)
|
||||
.resize(size, size, { fit: 'contain', background: { r: 255, g: 255, b: 255, alpha: 0 } })
|
||||
.png()
|
||||
.toFile(path.join(iconsDir, `${size}x${size}.png`));
|
||||
console.log(`Generated icons/${size}x${size}.png`);
|
||||
}
|
||||
|
||||
// Generate favicon
|
||||
await sharp(sourceImage)
|
||||
.resize(32, 32, { fit: 'contain', background: { r: 255, g: 255, b: 255, alpha: 0 } })
|
||||
.png()
|
||||
.toFile(path.join(assetsDir, 'favicon.png'));
|
||||
console.log('Generated favicon.png (32x32)');
|
||||
|
||||
// Generate tray icon (smaller, for system tray)
|
||||
await sharp(sourceImage)
|
||||
.resize(24, 24, { fit: 'contain', background: { r: 255, g: 255, b: 255, alpha: 0 } })
|
||||
.png()
|
||||
.toFile(path.join(assetsDir, 'tray-icon.png'));
|
||||
console.log('Generated tray-icon.png (24x24)');
|
||||
|
||||
console.log('\nIcon generation complete!');
|
||||
console.log('\nFor Windows .ico file, use an online converter or:');
|
||||
console.log(' magick convert assets/icons/*.png assets/icon.ico');
|
||||
console.log('\nFor macOS .icns file, use:');
|
||||
console.log(' iconutil -c icns assets/icon.iconset -o assets/icon.icns');
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error generating icons:', error);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
generateIcons();
|
||||
|
||||
@@ -1,48 +1,48 @@
|
||||
@echo off
|
||||
echo PanConverter Context Menu Installation
|
||||
echo =====================================
|
||||
echo.
|
||||
|
||||
REM Check for administrator privileges
|
||||
net session >nul 2>&1
|
||||
if %errorLevel% == 0 (
|
||||
echo Running with administrator privileges...
|
||||
) else (
|
||||
echo This script requires administrator privileges.
|
||||
echo Please right-click and select "Run as administrator"
|
||||
echo.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
REM Check if PanConverter is installed
|
||||
if not exist "%LOCALAPPDATA%\Programs\PanConverter\PanConverter.exe" (
|
||||
echo Warning: PanConverter not found at the expected location.
|
||||
echo Please ensure PanConverter is installed before continuing.
|
||||
echo Expected location: %LOCALAPPDATA%\Programs\PanConverter\PanConverter.exe
|
||||
echo.
|
||||
set /p continue="Continue anyway? (y/N): "
|
||||
if /i not "%continue%"=="y" exit /b 1
|
||||
)
|
||||
|
||||
echo Installing context menu entries...
|
||||
reg import "%~dp0install-context-menu.reg"
|
||||
|
||||
if %errorLevel% == 0 (
|
||||
echo.
|
||||
echo Context menu integration installed successfully!
|
||||
echo.
|
||||
echo You can now right-click on supported files and select:
|
||||
echo • "Convert with PanConverter" - Shows conversion dialog
|
||||
echo • "PanConverter > Convert to..." - Direct conversion ^(for Markdown^)
|
||||
echo.
|
||||
echo Supported file types:
|
||||
echo .md .markdown .html .htm .docx .odt .rtf .tex .pdf .pptx .ppt .odp
|
||||
) else (
|
||||
echo.
|
||||
echo Failed to install context menu entries.
|
||||
echo Please check that the registry file exists and try again.
|
||||
)
|
||||
|
||||
echo.
|
||||
@echo off
|
||||
echo PanConverter Context Menu Installation
|
||||
echo =====================================
|
||||
echo.
|
||||
|
||||
REM Check for administrator privileges
|
||||
net session >nul 2>&1
|
||||
if %errorLevel% == 0 (
|
||||
echo Running with administrator privileges...
|
||||
) else (
|
||||
echo This script requires administrator privileges.
|
||||
echo Please right-click and select "Run as administrator"
|
||||
echo.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
REM Check if PanConverter is installed
|
||||
if not exist "%LOCALAPPDATA%\Programs\PanConverter\PanConverter.exe" (
|
||||
echo Warning: PanConverter not found at the expected location.
|
||||
echo Please ensure PanConverter is installed before continuing.
|
||||
echo Expected location: %LOCALAPPDATA%\Programs\PanConverter\PanConverter.exe
|
||||
echo.
|
||||
set /p continue="Continue anyway? (y/N): "
|
||||
if /i not "%continue%"=="y" exit /b 1
|
||||
)
|
||||
|
||||
echo Installing context menu entries...
|
||||
reg import "%~dp0install-context-menu.reg"
|
||||
|
||||
if %errorLevel% == 0 (
|
||||
echo.
|
||||
echo Context menu integration installed successfully!
|
||||
echo.
|
||||
echo You can now right-click on supported files and select:
|
||||
echo • "Convert with PanConverter" - Shows conversion dialog
|
||||
echo • "PanConverter > Convert to..." - Direct conversion ^(for Markdown^)
|
||||
echo.
|
||||
echo Supported file types:
|
||||
echo .md .markdown .html .htm .docx .odt .rtf .tex .pdf .pptx .ppt .odp
|
||||
) else (
|
||||
echo.
|
||||
echo Failed to install context menu entries.
|
||||
echo Please check that the registry file exists and try again.
|
||||
)
|
||||
|
||||
echo.
|
||||
pause
|
||||
@@ -1,67 +1,67 @@
|
||||
# PanConverter Context Menu Installation Script
|
||||
# This script installs PanConverter context menu integration for Windows Explorer
|
||||
|
||||
param(
|
||||
[switch]$Uninstall = $false
|
||||
)
|
||||
|
||||
# Check if running as administrator
|
||||
if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
|
||||
Write-Host "This script requires Administrator privileges. Restarting with elevated permissions..." -ForegroundColor Yellow
|
||||
Start-Process PowerShell -Verb RunAs "-File `"$PSCommandPath`" $(if ($Uninstall) { '-Uninstall' })"
|
||||
exit
|
||||
}
|
||||
|
||||
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
$appPath = "${env:LOCALAPPDATA}\Programs\PanConverter\PanConverter.exe"
|
||||
|
||||
if ($Uninstall) {
|
||||
Write-Host "Uninstalling PanConverter context menu integration..." -ForegroundColor Yellow
|
||||
$regFile = Join-Path $scriptDir "uninstall-context-menu.reg"
|
||||
|
||||
if (Test-Path $regFile) {
|
||||
reg import $regFile
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "PanConverter context menu has been successfully removed!" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "Failed to remove context menu entries." -ForegroundColor Red
|
||||
}
|
||||
} else {
|
||||
Write-Host "Uninstall registry file not found: $regFile" -ForegroundColor Red
|
||||
}
|
||||
} else {
|
||||
Write-Host "Installing PanConverter context menu integration..." -ForegroundColor Yellow
|
||||
|
||||
# Check if PanConverter is installed
|
||||
if (-not (Test-Path $appPath)) {
|
||||
Write-Host "Warning: PanConverter executable not found at: $appPath" -ForegroundColor Yellow
|
||||
Write-Host "Please make sure PanConverter is installed before running this script." -ForegroundColor Yellow
|
||||
$continue = Read-Host "Continue anyway? (y/N)"
|
||||
if ($continue -ne 'y' -and $continue -ne 'Y') {
|
||||
exit
|
||||
}
|
||||
}
|
||||
|
||||
$regFile = Join-Path $scriptDir "install-context-menu.reg"
|
||||
|
||||
if (Test-Path $regFile) {
|
||||
reg import $regFile
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "PanConverter context menu has been successfully installed!" -ForegroundColor Green
|
||||
Write-Host ""
|
||||
Write-Host "You can now right-click on supported files (MD, HTML, DOCX, PDF, etc.) and select:" -ForegroundColor Cyan
|
||||
Write-Host "• 'Convert with PanConverter' - Shows conversion dialog" -ForegroundColor Cyan
|
||||
Write-Host "• 'PanConverter > Convert to...' - Direct conversion options (for Markdown files)" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
Write-Host "Supported file types: .md, .markdown, .html, .htm, .docx, .odt, .rtf, .tex, .pdf, .pptx, .ppt, .odp" -ForegroundColor Gray
|
||||
} else {
|
||||
Write-Host "Failed to install context menu entries." -ForegroundColor Red
|
||||
}
|
||||
} else {
|
||||
Write-Host "Install registry file not found: $regFile" -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Press any key to exit..."
|
||||
# PanConverter Context Menu Installation Script
|
||||
# This script installs PanConverter context menu integration for Windows Explorer
|
||||
|
||||
param(
|
||||
[switch]$Uninstall = $false
|
||||
)
|
||||
|
||||
# Check if running as administrator
|
||||
if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
|
||||
Write-Host "This script requires Administrator privileges. Restarting with elevated permissions..." -ForegroundColor Yellow
|
||||
Start-Process PowerShell -Verb RunAs "-File `"$PSCommandPath`" $(if ($Uninstall) { '-Uninstall' })"
|
||||
exit
|
||||
}
|
||||
|
||||
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
$appPath = "${env:LOCALAPPDATA}\Programs\PanConverter\PanConverter.exe"
|
||||
|
||||
if ($Uninstall) {
|
||||
Write-Host "Uninstalling PanConverter context menu integration..." -ForegroundColor Yellow
|
||||
$regFile = Join-Path $scriptDir "uninstall-context-menu.reg"
|
||||
|
||||
if (Test-Path $regFile) {
|
||||
reg import $regFile
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "PanConverter context menu has been successfully removed!" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "Failed to remove context menu entries." -ForegroundColor Red
|
||||
}
|
||||
} else {
|
||||
Write-Host "Uninstall registry file not found: $regFile" -ForegroundColor Red
|
||||
}
|
||||
} else {
|
||||
Write-Host "Installing PanConverter context menu integration..." -ForegroundColor Yellow
|
||||
|
||||
# Check if PanConverter is installed
|
||||
if (-not (Test-Path $appPath)) {
|
||||
Write-Host "Warning: PanConverter executable not found at: $appPath" -ForegroundColor Yellow
|
||||
Write-Host "Please make sure PanConverter is installed before running this script." -ForegroundColor Yellow
|
||||
$continue = Read-Host "Continue anyway? (y/N)"
|
||||
if ($continue -ne 'y' -and $continue -ne 'Y') {
|
||||
exit
|
||||
}
|
||||
}
|
||||
|
||||
$regFile = Join-Path $scriptDir "install-context-menu.reg"
|
||||
|
||||
if (Test-Path $regFile) {
|
||||
reg import $regFile
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "PanConverter context menu has been successfully installed!" -ForegroundColor Green
|
||||
Write-Host ""
|
||||
Write-Host "You can now right-click on supported files (MD, HTML, DOCX, PDF, etc.) and select:" -ForegroundColor Cyan
|
||||
Write-Host "• 'Convert with PanConverter' - Shows conversion dialog" -ForegroundColor Cyan
|
||||
Write-Host "• 'PanConverter > Convert to...' - Direct conversion options (for Markdown files)" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
Write-Host "Supported file types: .md, .markdown, .html, .htm, .docx, .odt, .rtf, .tex, .pdf, .pptx, .ppt, .odp" -ForegroundColor Gray
|
||||
} else {
|
||||
Write-Host "Failed to install context menu entries." -ForegroundColor Red
|
||||
}
|
||||
} else {
|
||||
Write-Host "Install registry file not found: $regFile" -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Press any key to exit..."
|
||||
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
|
||||
+133
-133
@@ -1,134 +1,134 @@
|
||||
Windows Registry Editor Version 5.00
|
||||
|
||||
; PanConverter Context Menu Integration
|
||||
; This registry file adds context menu options for converting files using PanConverter
|
||||
|
||||
; Add context menu for Markdown files (.md, .markdown)
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverter]
|
||||
@="Convert with PanConverter"
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverter\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert \"%1\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.markdown\shell\PanConverter]
|
||||
@="Convert with PanConverter"
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.markdown\shell\PanConverter\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert \"%1\""
|
||||
|
||||
; Add context menu for HTML files
|
||||
[HKEY_CLASSES_ROOT\.html\shell\PanConverter]
|
||||
@="Convert with PanConverter"
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.html\shell\PanConverter\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert \"%1\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.htm\shell\PanConverter]
|
||||
@="Convert with PanConverter"
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.htm\shell\PanConverter\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert \"%1\""
|
||||
|
||||
; Add context menu for DOCX files
|
||||
[HKEY_CLASSES_ROOT\.docx\shell\PanConverter]
|
||||
@="Convert with PanConverter"
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.docx\shell\PanConverter\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert \"%1\""
|
||||
|
||||
; Add context menu for ODT files
|
||||
[HKEY_CLASSES_ROOT\.odt\shell\PanConverter]
|
||||
@="Convert with PanConverter"
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.odt\shell\PanConverter\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert \"%1\""
|
||||
|
||||
; Add context menu for RTF files
|
||||
[HKEY_CLASSES_ROOT\.rtf\shell\PanConverter]
|
||||
@="Convert with PanConverter"
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.rtf\shell\PanConverter\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert \"%1\""
|
||||
|
||||
; Add context menu for LaTeX files
|
||||
[HKEY_CLASSES_ROOT\.tex\shell\PanConverter]
|
||||
@="Convert with PanConverter"
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.tex\shell\PanConverter\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert \"%1\""
|
||||
|
||||
; Add context menu for PDF files
|
||||
[HKEY_CLASSES_ROOT\.pdf\shell\PanConverter]
|
||||
@="Convert with PanConverter"
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.pdf\shell\PanConverter\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert \"%1\""
|
||||
|
||||
; Add context menu for PowerPoint files
|
||||
[HKEY_CLASSES_ROOT\.pptx\shell\PanConverter]
|
||||
@="Convert with PanConverter"
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.pptx\shell\PanConverter\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert \"%1\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.ppt\shell\PanConverter]
|
||||
@="Convert with PanConverter"
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.ppt\shell\PanConverter\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert \"%1\""
|
||||
|
||||
; Add context menu for OpenDocument Presentation files
|
||||
[HKEY_CLASSES_ROOT\.odp\shell\PanConverter]
|
||||
@="Convert with PanConverter"
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.odp\shell\PanConverter\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert \"%1\""
|
||||
|
||||
; Add submenu with specific conversion options for Markdown files
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverterMenu]
|
||||
@="PanConverter"
|
||||
"MUIVerb"="Convert to..."
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
"SubCommands"=""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverterMenu\shell\PDF]
|
||||
@="PDF"
|
||||
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverterMenu\shell\PDF\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert-to pdf \"%1\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverterMenu\shell\HTML]
|
||||
@="HTML"
|
||||
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverterMenu\shell\HTML\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert-to html \"%1\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverterMenu\shell\DOCX]
|
||||
@="DOCX"
|
||||
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverterMenu\shell\DOCX\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert-to docx \"%1\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverterMenu\shell\LaTeX]
|
||||
@="LaTeX"
|
||||
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverterMenu\shell\LaTeX\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert-to latex \"%1\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverterMenu\shell\PPTX]
|
||||
@="PowerPoint"
|
||||
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverterMenu\shell\PPTX\command]
|
||||
Windows Registry Editor Version 5.00
|
||||
|
||||
; PanConverter Context Menu Integration
|
||||
; This registry file adds context menu options for converting files using PanConverter
|
||||
|
||||
; Add context menu for Markdown files (.md, .markdown)
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverter]
|
||||
@="Convert with PanConverter"
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverter\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert \"%1\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.markdown\shell\PanConverter]
|
||||
@="Convert with PanConverter"
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.markdown\shell\PanConverter\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert \"%1\""
|
||||
|
||||
; Add context menu for HTML files
|
||||
[HKEY_CLASSES_ROOT\.html\shell\PanConverter]
|
||||
@="Convert with PanConverter"
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.html\shell\PanConverter\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert \"%1\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.htm\shell\PanConverter]
|
||||
@="Convert with PanConverter"
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.htm\shell\PanConverter\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert \"%1\""
|
||||
|
||||
; Add context menu for DOCX files
|
||||
[HKEY_CLASSES_ROOT\.docx\shell\PanConverter]
|
||||
@="Convert with PanConverter"
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.docx\shell\PanConverter\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert \"%1\""
|
||||
|
||||
; Add context menu for ODT files
|
||||
[HKEY_CLASSES_ROOT\.odt\shell\PanConverter]
|
||||
@="Convert with PanConverter"
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.odt\shell\PanConverter\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert \"%1\""
|
||||
|
||||
; Add context menu for RTF files
|
||||
[HKEY_CLASSES_ROOT\.rtf\shell\PanConverter]
|
||||
@="Convert with PanConverter"
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.rtf\shell\PanConverter\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert \"%1\""
|
||||
|
||||
; Add context menu for LaTeX files
|
||||
[HKEY_CLASSES_ROOT\.tex\shell\PanConverter]
|
||||
@="Convert with PanConverter"
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.tex\shell\PanConverter\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert \"%1\""
|
||||
|
||||
; Add context menu for PDF files
|
||||
[HKEY_CLASSES_ROOT\.pdf\shell\PanConverter]
|
||||
@="Convert with PanConverter"
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.pdf\shell\PanConverter\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert \"%1\""
|
||||
|
||||
; Add context menu for PowerPoint files
|
||||
[HKEY_CLASSES_ROOT\.pptx\shell\PanConverter]
|
||||
@="Convert with PanConverter"
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.pptx\shell\PanConverter\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert \"%1\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.ppt\shell\PanConverter]
|
||||
@="Convert with PanConverter"
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.ppt\shell\PanConverter\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert \"%1\""
|
||||
|
||||
; Add context menu for OpenDocument Presentation files
|
||||
[HKEY_CLASSES_ROOT\.odp\shell\PanConverter]
|
||||
@="Convert with PanConverter"
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.odp\shell\PanConverter\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert \"%1\""
|
||||
|
||||
; Add submenu with specific conversion options for Markdown files
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverterMenu]
|
||||
@="PanConverter"
|
||||
"MUIVerb"="Convert to..."
|
||||
"Icon"="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\""
|
||||
"SubCommands"=""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverterMenu\shell\PDF]
|
||||
@="PDF"
|
||||
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverterMenu\shell\PDF\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert-to pdf \"%1\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverterMenu\shell\HTML]
|
||||
@="HTML"
|
||||
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverterMenu\shell\HTML\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert-to html \"%1\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverterMenu\shell\DOCX]
|
||||
@="DOCX"
|
||||
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverterMenu\shell\DOCX\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert-to docx \"%1\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverterMenu\shell\LaTeX]
|
||||
@="LaTeX"
|
||||
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverterMenu\shell\LaTeX\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert-to latex \"%1\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverterMenu\shell\PPTX]
|
||||
@="PowerPoint"
|
||||
|
||||
[HKEY_CLASSES_ROOT\.md\shell\PanConverterMenu\shell\PPTX\command]
|
||||
@="\"%LOCALAPPDATA%\\Programs\\PanConverter\\PanConverter.exe\" --convert-to pptx \"%1\""
|
||||
+144
-144
@@ -1,145 +1,145 @@
|
||||
; PanConverter NSIS Installer Include File
|
||||
; Handles context menu installation and uninstallation
|
||||
|
||||
!include "LogicLib.nsh"
|
||||
!include "MUI2.nsh"
|
||||
|
||||
; Custom installation page for context menu option
|
||||
Var ContextMenuCheckbox
|
||||
Var ContextMenuState
|
||||
|
||||
Function ContextMenuPage
|
||||
!insertmacro MUI_HEADER_TEXT "Additional Options" "Choose additional installation options"
|
||||
|
||||
nsDialogs::Create 1018
|
||||
Pop $0
|
||||
|
||||
${If} $0 == error
|
||||
Abort
|
||||
${EndIf}
|
||||
|
||||
${NSD_CreateLabel} 0 0 100% 20u "Select additional features to install:"
|
||||
Pop $0
|
||||
|
||||
${NSD_CreateCheckbox} 20u 30u 280u 15u "Add PanConverter to Windows Explorer context menu"
|
||||
Pop $ContextMenuCheckbox
|
||||
${NSD_SetState} $ContextMenuCheckbox ${BST_CHECKED}
|
||||
|
||||
${NSD_CreateLabel} 20u 50u 280u 30u "This will allow you to right-click on supported files and convert them directly using PanConverter."
|
||||
Pop $0
|
||||
|
||||
nsDialogs::Show
|
||||
FunctionEnd
|
||||
|
||||
Function ContextMenuPageLeave
|
||||
${NSD_GetState} $ContextMenuCheckbox $ContextMenuState
|
||||
FunctionEnd
|
||||
|
||||
; Install context menu entries
|
||||
Function InstallContextMenu
|
||||
${If} $ContextMenuState == ${BST_CHECKED}
|
||||
DetailPrint "Installing context menu integration..."
|
||||
|
||||
; Create registry entries for context menu
|
||||
WriteRegStr HKCR ".md\shell\PanConverter" "" "Convert with PanConverter"
|
||||
WriteRegStr HKCR ".md\shell\PanConverter" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".md\shell\PanConverter\command" "" '"$INSTDIR\PanConverter.exe" --convert "%1"'
|
||||
|
||||
WriteRegStr HKCR ".markdown\shell\PanConverter" "" "Convert with PanConverter"
|
||||
WriteRegStr HKCR ".markdown\shell\PanConverter" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".markdown\shell\PanConverter\command" "" '"$INSTDIR\PanConverter.exe" --convert "%1"'
|
||||
|
||||
; Context menu for HTML files
|
||||
WriteRegStr HKCR ".html\shell\PanConverter" "" "Convert with PanConverter"
|
||||
WriteRegStr HKCR ".html\shell\PanConverter" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".html\shell\PanConverter\command" "" '"$INSTDIR\PanConverter.exe" --convert "%1"'
|
||||
|
||||
WriteRegStr HKCR ".htm\shell\PanConverter" "" "Convert with PanConverter"
|
||||
WriteRegStr HKCR ".htm\shell\PanConverter" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".htm\shell\PanConverter\command" "" '"$INSTDIR\PanConverter.exe" --convert "%1"'
|
||||
|
||||
; Context menu for DOCX files
|
||||
WriteRegStr HKCR ".docx\shell\PanConverter" "" "Convert with PanConverter"
|
||||
WriteRegStr HKCR ".docx\shell\PanConverter" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".docx\shell\PanConverter\command" "" '"$INSTDIR\PanConverter.exe" --convert "%1"'
|
||||
|
||||
; Context menu for ODT files
|
||||
WriteRegStr HKCR ".odt\shell\PanConverter" "" "Convert with PanConverter"
|
||||
WriteRegStr HKCR ".odt\shell\PanConverter" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".odt\shell\PanConverter\command" "" '"$INSTDIR\PanConverter.exe" --convert "%1"'
|
||||
|
||||
; Context menu for RTF files
|
||||
WriteRegStr HKCR ".rtf\shell\PanConverter" "" "Convert with PanConverter"
|
||||
WriteRegStr HKCR ".rtf\shell\PanConverter" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".rtf\shell\PanConverter\command" "" '"$INSTDIR\PanConverter.exe" --convert "%1"'
|
||||
|
||||
; Context menu for LaTeX files
|
||||
WriteRegStr HKCR ".tex\shell\PanConverter" "" "Convert with PanConverter"
|
||||
WriteRegStr HKCR ".tex\shell\PanConverter" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".tex\shell\PanConverter\command" "" '"$INSTDIR\PanConverter.exe" --convert "%1"'
|
||||
|
||||
; Context menu for PDF files
|
||||
WriteRegStr HKCR ".pdf\shell\PanConverter" "" "Convert with PanConverter"
|
||||
WriteRegStr HKCR ".pdf\shell\PanConverter" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".pdf\shell\PanConverter\command" "" '"$INSTDIR\PanConverter.exe" --convert "%1"'
|
||||
|
||||
; Context menu for PowerPoint files
|
||||
WriteRegStr HKCR ".pptx\shell\PanConverter" "" "Convert with PanConverter"
|
||||
WriteRegStr HKCR ".pptx\shell\PanConverter" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".pptx\shell\PanConverter\command" "" '"$INSTDIR\PanConverter.exe" --convert "%1"'
|
||||
|
||||
WriteRegStr HKCR ".ppt\shell\PanConverter" "" "Convert with PanConverter"
|
||||
WriteRegStr HKCR ".ppt\shell\PanConverter" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".ppt\shell\PanConverter\command" "" '"$INSTDIR\PanConverter.exe" --convert "%1"'
|
||||
|
||||
; Context menu for ODP files
|
||||
WriteRegStr HKCR ".odp\shell\PanConverter" "" "Convert with PanConverter"
|
||||
WriteRegStr HKCR ".odp\shell\PanConverter" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".odp\shell\PanConverter\command" "" '"$INSTDIR\PanConverter.exe" --convert "%1"'
|
||||
|
||||
; Submenu for Markdown files with direct conversion options
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu" "" "PanConverter"
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu" "MUIVerb" "Convert to..."
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu" "SubCommands" ""
|
||||
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu\shell\PDF" "" "PDF"
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu\shell\PDF\command" "" '"$INSTDIR\PanConverter.exe" --convert-to pdf "%1"'
|
||||
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu\shell\HTML" "" "HTML"
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu\shell\HTML\command" "" '"$INSTDIR\PanConverter.exe" --convert-to html "%1"'
|
||||
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu\shell\DOCX" "" "DOCX"
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu\shell\DOCX\command" "" '"$INSTDIR\PanConverter.exe" --convert-to docx "%1"'
|
||||
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu\shell\LaTeX" "" "LaTeX"
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu\shell\LaTeX\command" "" '"$INSTDIR\PanConverter.exe" --convert-to latex "%1"'
|
||||
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu\shell\PPTX" "" "PowerPoint"
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu\shell\PPTX\command" "" '"$INSTDIR\PanConverter.exe" --convert-to pptx "%1"'
|
||||
|
||||
DetailPrint "Context menu integration installed successfully!"
|
||||
${EndIf}
|
||||
FunctionEnd
|
||||
|
||||
; Uninstall context menu entries
|
||||
Function un.RemoveContextMenu
|
||||
DetailPrint "Removing context menu integration..."
|
||||
|
||||
; Remove context menu entries for all file types
|
||||
DeleteRegKey HKCR ".md\shell\PanConverter"
|
||||
DeleteRegKey HKCR ".md\shell\PanConverterMenu"
|
||||
DeleteRegKey HKCR ".markdown\shell\PanConverter"
|
||||
DeleteRegKey HKCR ".html\shell\PanConverter"
|
||||
DeleteRegKey HKCR ".htm\shell\PanConverter"
|
||||
DeleteRegKey HKCR ".docx\shell\PanConverter"
|
||||
DeleteRegKey HKCR ".odt\shell\PanConverter"
|
||||
DeleteRegKey HKCR ".rtf\shell\PanConverter"
|
||||
DeleteRegKey HKCR ".tex\shell\PanConverter"
|
||||
DeleteRegKey HKCR ".pdf\shell\PanConverter"
|
||||
DeleteRegKey HKCR ".pptx\shell\PanConverter"
|
||||
DeleteRegKey HKCR ".ppt\shell\PanConverter"
|
||||
DeleteRegKey HKCR ".odp\shell\PanConverter"
|
||||
|
||||
DetailPrint "Context menu integration removed successfully!"
|
||||
; PanConverter NSIS Installer Include File
|
||||
; Handles context menu installation and uninstallation
|
||||
|
||||
!include "LogicLib.nsh"
|
||||
!include "MUI2.nsh"
|
||||
|
||||
; Custom installation page for context menu option
|
||||
Var ContextMenuCheckbox
|
||||
Var ContextMenuState
|
||||
|
||||
Function ContextMenuPage
|
||||
!insertmacro MUI_HEADER_TEXT "Additional Options" "Choose additional installation options"
|
||||
|
||||
nsDialogs::Create 1018
|
||||
Pop $0
|
||||
|
||||
${If} $0 == error
|
||||
Abort
|
||||
${EndIf}
|
||||
|
||||
${NSD_CreateLabel} 0 0 100% 20u "Select additional features to install:"
|
||||
Pop $0
|
||||
|
||||
${NSD_CreateCheckbox} 20u 30u 280u 15u "Add PanConverter to Windows Explorer context menu"
|
||||
Pop $ContextMenuCheckbox
|
||||
${NSD_SetState} $ContextMenuCheckbox ${BST_CHECKED}
|
||||
|
||||
${NSD_CreateLabel} 20u 50u 280u 30u "This will allow you to right-click on supported files and convert them directly using PanConverter."
|
||||
Pop $0
|
||||
|
||||
nsDialogs::Show
|
||||
FunctionEnd
|
||||
|
||||
Function ContextMenuPageLeave
|
||||
${NSD_GetState} $ContextMenuCheckbox $ContextMenuState
|
||||
FunctionEnd
|
||||
|
||||
; Install context menu entries
|
||||
Function InstallContextMenu
|
||||
${If} $ContextMenuState == ${BST_CHECKED}
|
||||
DetailPrint "Installing context menu integration..."
|
||||
|
||||
; Create registry entries for context menu
|
||||
WriteRegStr HKCR ".md\shell\PanConverter" "" "Convert with PanConverter"
|
||||
WriteRegStr HKCR ".md\shell\PanConverter" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".md\shell\PanConverter\command" "" '"$INSTDIR\PanConverter.exe" --convert "%1"'
|
||||
|
||||
WriteRegStr HKCR ".markdown\shell\PanConverter" "" "Convert with PanConverter"
|
||||
WriteRegStr HKCR ".markdown\shell\PanConverter" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".markdown\shell\PanConverter\command" "" '"$INSTDIR\PanConverter.exe" --convert "%1"'
|
||||
|
||||
; Context menu for HTML files
|
||||
WriteRegStr HKCR ".html\shell\PanConverter" "" "Convert with PanConverter"
|
||||
WriteRegStr HKCR ".html\shell\PanConverter" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".html\shell\PanConverter\command" "" '"$INSTDIR\PanConverter.exe" --convert "%1"'
|
||||
|
||||
WriteRegStr HKCR ".htm\shell\PanConverter" "" "Convert with PanConverter"
|
||||
WriteRegStr HKCR ".htm\shell\PanConverter" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".htm\shell\PanConverter\command" "" '"$INSTDIR\PanConverter.exe" --convert "%1"'
|
||||
|
||||
; Context menu for DOCX files
|
||||
WriteRegStr HKCR ".docx\shell\PanConverter" "" "Convert with PanConverter"
|
||||
WriteRegStr HKCR ".docx\shell\PanConverter" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".docx\shell\PanConverter\command" "" '"$INSTDIR\PanConverter.exe" --convert "%1"'
|
||||
|
||||
; Context menu for ODT files
|
||||
WriteRegStr HKCR ".odt\shell\PanConverter" "" "Convert with PanConverter"
|
||||
WriteRegStr HKCR ".odt\shell\PanConverter" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".odt\shell\PanConverter\command" "" '"$INSTDIR\PanConverter.exe" --convert "%1"'
|
||||
|
||||
; Context menu for RTF files
|
||||
WriteRegStr HKCR ".rtf\shell\PanConverter" "" "Convert with PanConverter"
|
||||
WriteRegStr HKCR ".rtf\shell\PanConverter" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".rtf\shell\PanConverter\command" "" '"$INSTDIR\PanConverter.exe" --convert "%1"'
|
||||
|
||||
; Context menu for LaTeX files
|
||||
WriteRegStr HKCR ".tex\shell\PanConverter" "" "Convert with PanConverter"
|
||||
WriteRegStr HKCR ".tex\shell\PanConverter" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".tex\shell\PanConverter\command" "" '"$INSTDIR\PanConverter.exe" --convert "%1"'
|
||||
|
||||
; Context menu for PDF files
|
||||
WriteRegStr HKCR ".pdf\shell\PanConverter" "" "Convert with PanConverter"
|
||||
WriteRegStr HKCR ".pdf\shell\PanConverter" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".pdf\shell\PanConverter\command" "" '"$INSTDIR\PanConverter.exe" --convert "%1"'
|
||||
|
||||
; Context menu for PowerPoint files
|
||||
WriteRegStr HKCR ".pptx\shell\PanConverter" "" "Convert with PanConverter"
|
||||
WriteRegStr HKCR ".pptx\shell\PanConverter" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".pptx\shell\PanConverter\command" "" '"$INSTDIR\PanConverter.exe" --convert "%1"'
|
||||
|
||||
WriteRegStr HKCR ".ppt\shell\PanConverter" "" "Convert with PanConverter"
|
||||
WriteRegStr HKCR ".ppt\shell\PanConverter" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".ppt\shell\PanConverter\command" "" '"$INSTDIR\PanConverter.exe" --convert "%1"'
|
||||
|
||||
; Context menu for ODP files
|
||||
WriteRegStr HKCR ".odp\shell\PanConverter" "" "Convert with PanConverter"
|
||||
WriteRegStr HKCR ".odp\shell\PanConverter" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".odp\shell\PanConverter\command" "" '"$INSTDIR\PanConverter.exe" --convert "%1"'
|
||||
|
||||
; Submenu for Markdown files with direct conversion options
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu" "" "PanConverter"
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu" "MUIVerb" "Convert to..."
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu" "Icon" "$INSTDIR\PanConverter.exe"
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu" "SubCommands" ""
|
||||
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu\shell\PDF" "" "PDF"
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu\shell\PDF\command" "" '"$INSTDIR\PanConverter.exe" --convert-to pdf "%1"'
|
||||
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu\shell\HTML" "" "HTML"
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu\shell\HTML\command" "" '"$INSTDIR\PanConverter.exe" --convert-to html "%1"'
|
||||
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu\shell\DOCX" "" "DOCX"
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu\shell\DOCX\command" "" '"$INSTDIR\PanConverter.exe" --convert-to docx "%1"'
|
||||
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu\shell\LaTeX" "" "LaTeX"
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu\shell\LaTeX\command" "" '"$INSTDIR\PanConverter.exe" --convert-to latex "%1"'
|
||||
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu\shell\PPTX" "" "PowerPoint"
|
||||
WriteRegStr HKCR ".md\shell\PanConverterMenu\shell\PPTX\command" "" '"$INSTDIR\PanConverter.exe" --convert-to pptx "%1"'
|
||||
|
||||
DetailPrint "Context menu integration installed successfully!"
|
||||
${EndIf}
|
||||
FunctionEnd
|
||||
|
||||
; Uninstall context menu entries
|
||||
Function un.RemoveContextMenu
|
||||
DetailPrint "Removing context menu integration..."
|
||||
|
||||
; Remove context menu entries for all file types
|
||||
DeleteRegKey HKCR ".md\shell\PanConverter"
|
||||
DeleteRegKey HKCR ".md\shell\PanConverterMenu"
|
||||
DeleteRegKey HKCR ".markdown\shell\PanConverter"
|
||||
DeleteRegKey HKCR ".html\shell\PanConverter"
|
||||
DeleteRegKey HKCR ".htm\shell\PanConverter"
|
||||
DeleteRegKey HKCR ".docx\shell\PanConverter"
|
||||
DeleteRegKey HKCR ".odt\shell\PanConverter"
|
||||
DeleteRegKey HKCR ".rtf\shell\PanConverter"
|
||||
DeleteRegKey HKCR ".tex\shell\PanConverter"
|
||||
DeleteRegKey HKCR ".pdf\shell\PanConverter"
|
||||
DeleteRegKey HKCR ".pptx\shell\PanConverter"
|
||||
DeleteRegKey HKCR ".ppt\shell\PanConverter"
|
||||
DeleteRegKey HKCR ".odp\shell\PanConverter"
|
||||
|
||||
DetailPrint "Context menu integration removed successfully!"
|
||||
FunctionEnd
|
||||
@@ -1,32 +1,32 @@
|
||||
@echo off
|
||||
echo PanConverter Context Menu Uninstallation
|
||||
echo ========================================
|
||||
echo.
|
||||
|
||||
REM Check for administrator privileges
|
||||
net session >nul 2>&1
|
||||
if %errorLevel% == 0 (
|
||||
echo Running with administrator privileges...
|
||||
) else (
|
||||
echo This script requires administrator privileges.
|
||||
echo Please right-click and select "Run as administrator"
|
||||
echo.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo Removing context menu entries...
|
||||
reg import "%~dp0uninstall-context-menu.reg"
|
||||
|
||||
if %errorLevel% == 0 (
|
||||
echo.
|
||||
echo Context menu integration removed successfully!
|
||||
echo PanConverter entries have been removed from the Windows Explorer context menu.
|
||||
) else (
|
||||
echo.
|
||||
echo Failed to remove context menu entries.
|
||||
echo Please check that the registry file exists and try again.
|
||||
)
|
||||
|
||||
echo.
|
||||
@echo off
|
||||
echo PanConverter Context Menu Uninstallation
|
||||
echo ========================================
|
||||
echo.
|
||||
|
||||
REM Check for administrator privileges
|
||||
net session >nul 2>&1
|
||||
if %errorLevel% == 0 (
|
||||
echo Running with administrator privileges...
|
||||
) else (
|
||||
echo This script requires administrator privileges.
|
||||
echo Please right-click and select "Run as administrator"
|
||||
echo.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo Removing context menu entries...
|
||||
reg import "%~dp0uninstall-context-menu.reg"
|
||||
|
||||
if %errorLevel% == 0 (
|
||||
echo.
|
||||
echo Context menu integration removed successfully!
|
||||
echo PanConverter entries have been removed from the Windows Explorer context menu.
|
||||
) else (
|
||||
echo.
|
||||
echo Failed to remove context menu entries.
|
||||
echo Please check that the registry file exists and try again.
|
||||
)
|
||||
|
||||
echo.
|
||||
pause
|
||||
@@ -1,36 +1,36 @@
|
||||
Windows Registry Editor Version 5.00
|
||||
|
||||
; PanConverter Context Menu Uninstall Script
|
||||
; This registry file removes PanConverter context menu entries
|
||||
|
||||
; Remove context menu for Markdown files (.md, .markdown)
|
||||
[-HKEY_CLASSES_ROOT\.md\shell\PanConverter]
|
||||
[-HKEY_CLASSES_ROOT\.md\shell\PanConverterMenu]
|
||||
|
||||
[-HKEY_CLASSES_ROOT\.markdown\shell\PanConverter]
|
||||
|
||||
; Remove context menu for HTML files
|
||||
[-HKEY_CLASSES_ROOT\.html\shell\PanConverter]
|
||||
[-HKEY_CLASSES_ROOT\.htm\shell\PanConverter]
|
||||
|
||||
; Remove context menu for DOCX files
|
||||
[-HKEY_CLASSES_ROOT\.docx\shell\PanConverter]
|
||||
|
||||
; Remove context menu for ODT files
|
||||
[-HKEY_CLASSES_ROOT\.odt\shell\PanConverter]
|
||||
|
||||
; Remove context menu for RTF files
|
||||
[-HKEY_CLASSES_ROOT\.rtf\shell\PanConverter]
|
||||
|
||||
; Remove context menu for LaTeX files
|
||||
[-HKEY_CLASSES_ROOT\.tex\shell\PanConverter]
|
||||
|
||||
; Remove context menu for PDF files
|
||||
[-HKEY_CLASSES_ROOT\.pdf\shell\PanConverter]
|
||||
|
||||
; Remove context menu for PowerPoint files
|
||||
[-HKEY_CLASSES_ROOT\.pptx\shell\PanConverter]
|
||||
[-HKEY_CLASSES_ROOT\.ppt\shell\PanConverter]
|
||||
|
||||
; Remove context menu for OpenDocument Presentation files
|
||||
Windows Registry Editor Version 5.00
|
||||
|
||||
; PanConverter Context Menu Uninstall Script
|
||||
; This registry file removes PanConverter context menu entries
|
||||
|
||||
; Remove context menu for Markdown files (.md, .markdown)
|
||||
[-HKEY_CLASSES_ROOT\.md\shell\PanConverter]
|
||||
[-HKEY_CLASSES_ROOT\.md\shell\PanConverterMenu]
|
||||
|
||||
[-HKEY_CLASSES_ROOT\.markdown\shell\PanConverter]
|
||||
|
||||
; Remove context menu for HTML files
|
||||
[-HKEY_CLASSES_ROOT\.html\shell\PanConverter]
|
||||
[-HKEY_CLASSES_ROOT\.htm\shell\PanConverter]
|
||||
|
||||
; Remove context menu for DOCX files
|
||||
[-HKEY_CLASSES_ROOT\.docx\shell\PanConverter]
|
||||
|
||||
; Remove context menu for ODT files
|
||||
[-HKEY_CLASSES_ROOT\.odt\shell\PanConverter]
|
||||
|
||||
; Remove context menu for RTF files
|
||||
[-HKEY_CLASSES_ROOT\.rtf\shell\PanConverter]
|
||||
|
||||
; Remove context menu for LaTeX files
|
||||
[-HKEY_CLASSES_ROOT\.tex\shell\PanConverter]
|
||||
|
||||
; Remove context menu for PDF files
|
||||
[-HKEY_CLASSES_ROOT\.pdf\shell\PanConverter]
|
||||
|
||||
; Remove context menu for PowerPoint files
|
||||
[-HKEY_CLASSES_ROOT\.pptx\shell\PanConverter]
|
||||
[-HKEY_CLASSES_ROOT\.ppt\shell\PanConverter]
|
||||
|
||||
; Remove context menu for OpenDocument Presentation files
|
||||
[-HKEY_CLASSES_ROOT\.odp\shell\PanConverter]
|
||||
+37
-37
@@ -1,37 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Pan Converter - Git Remote Setup Script
|
||||
#
|
||||
# Instructions:
|
||||
# 1. Create a new repository on GitHub named "pan-converter"
|
||||
# 2. Replace YOUR_GITHUB_USERNAME with your actual GitHub username
|
||||
# 3. Run this script: bash setup-upstream.sh
|
||||
|
||||
GITHUB_USERNAME="amitwh"
|
||||
REPO_NAME="pan-converter"
|
||||
|
||||
echo "Setting up remote repository..."
|
||||
|
||||
# Add remote origin
|
||||
git remote add origin "https://github.com/$GITHUB_USERNAME/$REPO_NAME.git"
|
||||
|
||||
echo "Pushing all branches to remote..."
|
||||
|
||||
# Push master branch
|
||||
git push -u origin master
|
||||
|
||||
# Push platform-specific branches
|
||||
git push origin linux
|
||||
git push origin macos
|
||||
git push origin windows
|
||||
|
||||
echo "Repository setup complete!"
|
||||
echo ""
|
||||
echo "Your repository is now available at:"
|
||||
echo "https://github.com/$GITHUB_USERNAME/$REPO_NAME"
|
||||
echo ""
|
||||
echo "Branch structure:"
|
||||
echo " - master (main development)"
|
||||
echo " - linux (Linux-specific)"
|
||||
echo " - macos (macOS-specific)"
|
||||
echo " - windows (Windows-specific)"
|
||||
#!/bin/bash
|
||||
|
||||
# Pan Converter - Git Remote Setup Script
|
||||
#
|
||||
# Instructions:
|
||||
# 1. Create a new repository on GitHub named "pan-converter"
|
||||
# 2. Replace YOUR_GITHUB_USERNAME with your actual GitHub username
|
||||
# 3. Run this script: bash setup-upstream.sh
|
||||
|
||||
GITHUB_USERNAME="amitwh"
|
||||
REPO_NAME="pan-converter"
|
||||
|
||||
echo "Setting up remote repository..."
|
||||
|
||||
# Add remote origin
|
||||
git remote add origin "https://github.com/$GITHUB_USERNAME/$REPO_NAME.git"
|
||||
|
||||
echo "Pushing all branches to remote..."
|
||||
|
||||
# Push master branch
|
||||
git push -u origin master
|
||||
|
||||
# Push platform-specific branches
|
||||
git push origin linux
|
||||
git push origin macos
|
||||
git push origin windows
|
||||
|
||||
echo "Repository setup complete!"
|
||||
echo ""
|
||||
echo "Your repository is now available at:"
|
||||
echo "https://github.com/$GITHUB_USERNAME/$REPO_NAME"
|
||||
echo ""
|
||||
echo "Branch structure:"
|
||||
echo " - master (main development)"
|
||||
echo " - linux (Linux-specific)"
|
||||
echo " - macos (macOS-specific)"
|
||||
echo " - windows (Windows-specific)"
|
||||
|
||||
+601
-601
File diff suppressed because it is too large
Load Diff
+75
-75
@@ -1,75 +1,75 @@
|
||||
/* Local Font Definitions for MarkdownConverter */
|
||||
|
||||
/* Inter Font Family */
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
font-display: swap;
|
||||
src: url('../assets/fonts/Inter-Light.woff2') format('woff2');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url('../assets/fonts/Inter-Regular.woff2') format('woff2');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
font-display: swap;
|
||||
src: url('../assets/fonts/Inter-Medium.woff2') format('woff2');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
font-display: swap;
|
||||
src: url('../assets/fonts/Inter-SemiBold.woff2') format('woff2');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-display: swap;
|
||||
src: url('../assets/fonts/Inter-Bold.woff2') format('woff2');
|
||||
}
|
||||
|
||||
/* JetBrains Mono Font Family - For code, markdown editor, and ASCII art */
|
||||
@font-face {
|
||||
font-family: 'JetBrains Mono';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url('../assets/fonts/JetBrainsMono-Regular.woff2') format('woff2');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'JetBrains Mono';
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
font-display: swap;
|
||||
src: url('../assets/fonts/JetBrainsMono-Medium.woff2') format('woff2');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'JetBrains Mono';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
font-display: swap;
|
||||
src: url('../assets/fonts/JetBrainsMono-SemiBold.woff2') format('woff2');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'JetBrains Mono';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-display: swap;
|
||||
src: url('../assets/fonts/JetBrainsMono-Bold.woff2') format('woff2');
|
||||
}
|
||||
/* Local Font Definitions for MarkdownConverter */
|
||||
|
||||
/* Inter Font Family */
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
font-display: swap;
|
||||
src: url('../assets/fonts/Inter-Light.woff2') format('woff2');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url('../assets/fonts/Inter-Regular.woff2') format('woff2');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
font-display: swap;
|
||||
src: url('../assets/fonts/Inter-Medium.woff2') format('woff2');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
font-display: swap;
|
||||
src: url('../assets/fonts/Inter-SemiBold.woff2') format('woff2');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-display: swap;
|
||||
src: url('../assets/fonts/Inter-Bold.woff2') format('woff2');
|
||||
}
|
||||
|
||||
/* JetBrains Mono Font Family - For code, markdown editor, and ASCII art */
|
||||
@font-face {
|
||||
font-family: 'JetBrains Mono';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url('../assets/fonts/JetBrainsMono-Regular.woff2') format('woff2');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'JetBrains Mono';
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
font-display: swap;
|
||||
src: url('../assets/fonts/JetBrainsMono-Medium.woff2') format('woff2');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'JetBrains Mono';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
font-display: swap;
|
||||
src: url('../assets/fonts/JetBrainsMono-SemiBold.woff2') format('woff2');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'JetBrains Mono';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-display: swap;
|
||||
src: url('../assets/fonts/JetBrainsMono-Bold.woff2') format('woff2');
|
||||
}
|
||||
|
||||
+1413
-1413
File diff suppressed because it is too large
Load Diff
+3794
-3794
File diff suppressed because it is too large
Load Diff
+376
-376
@@ -1,376 +1,376 @@
|
||||
/**
|
||||
* Preload Script for PanConverter
|
||||
*
|
||||
* This script creates a secure bridge between the main process and renderer process.
|
||||
* It exposes only specific IPC channels, preventing direct Node.js access in the renderer.
|
||||
*
|
||||
* Security Benefits:
|
||||
* - No direct access to Node.js APIs (fs, path, child_process, etc.)
|
||||
* - All IPC channels are explicitly whitelisted
|
||||
* - Prevents XSS from escalating to full system access
|
||||
*
|
||||
* @version 2.2.0
|
||||
*/
|
||||
|
||||
const { contextBridge, ipcRenderer } = require('electron');
|
||||
|
||||
// Define allowed IPC channels for security
|
||||
const ALLOWED_SEND_CHANNELS = [
|
||||
// File operations
|
||||
'save-file',
|
||||
'save-current-file',
|
||||
'set-current-file',
|
||||
'save-recent-files',
|
||||
'clear-recent-files',
|
||||
'renderer-ready',
|
||||
|
||||
// Theme
|
||||
'get-theme',
|
||||
|
||||
// Print
|
||||
'do-print',
|
||||
|
||||
// Export
|
||||
'export-with-options',
|
||||
'export-spreadsheet',
|
||||
|
||||
// Batch conversion
|
||||
'batch-convert',
|
||||
'select-folder',
|
||||
|
||||
// Universal converter
|
||||
'universal-convert',
|
||||
'universal-convert-batch',
|
||||
|
||||
// Image converter
|
||||
'image-convert',
|
||||
'image-batch-convert',
|
||||
'image-resize',
|
||||
'image-compress',
|
||||
'image-rotate',
|
||||
|
||||
// Audio converter
|
||||
'audio-convert',
|
||||
'audio-batch-convert',
|
||||
'audio-extract',
|
||||
'audio-trim',
|
||||
'audio-merge',
|
||||
|
||||
// Video converter
|
||||
'video-convert',
|
||||
'video-batch-convert',
|
||||
'video-compress',
|
||||
'video-trim',
|
||||
'video-frames',
|
||||
'video-gif',
|
||||
|
||||
// Header/Footer
|
||||
'get-header-footer-settings',
|
||||
'save-header-footer-settings',
|
||||
'browse-header-footer-logo',
|
||||
'save-header-footer-logo',
|
||||
'clear-header-footer-logo',
|
||||
|
||||
// Page settings
|
||||
'get-page-settings',
|
||||
'update-page-settings',
|
||||
|
||||
// Template settings
|
||||
'set-custom-start-page',
|
||||
|
||||
// PDF operations
|
||||
'process-pdf-operation',
|
||||
'get-pdf-page-count',
|
||||
'select-pdf-folder',
|
||||
|
||||
// ASCII generator (separate window)
|
||||
'open-ascii-generator',
|
||||
|
||||
// Table generator (separate window)
|
||||
'open-table-generator',
|
||||
|
||||
// Insert generated content
|
||||
'insert-generated-content'
|
||||
];
|
||||
|
||||
const ALLOWED_RECEIVE_CHANNELS = [
|
||||
// File operations
|
||||
'file-new',
|
||||
'file-opened',
|
||||
'file-save',
|
||||
'get-content-for-save',
|
||||
'get-content-for-spreadsheet',
|
||||
'recent-files-cleared',
|
||||
|
||||
// UI toggles
|
||||
'toggle-preview',
|
||||
'toggle-find',
|
||||
|
||||
// Theme
|
||||
'theme-changed',
|
||||
'theme-data',
|
||||
|
||||
// Edit operations
|
||||
'undo',
|
||||
'redo',
|
||||
|
||||
// Font
|
||||
'adjust-font-size',
|
||||
|
||||
// Print
|
||||
'print-preview',
|
||||
'print-preview-styled',
|
||||
|
||||
// Export dialogs
|
||||
'show-export-dialog',
|
||||
'show-batch-dialog',
|
||||
'show-universal-converter-dialog',
|
||||
'show-table-generator',
|
||||
'show-pdf-editor-dialog',
|
||||
|
||||
// Converter dialogs
|
||||
'show-image-converter',
|
||||
'show-audio-converter',
|
||||
'show-video-converter',
|
||||
|
||||
// PDF viewer
|
||||
'open-pdf-viewer',
|
||||
|
||||
// Conversion status
|
||||
'conversion-status',
|
||||
'conversion-complete',
|
||||
'batch-progress',
|
||||
'image-conversion-complete',
|
||||
'audio-conversion-complete',
|
||||
'video-conversion-complete',
|
||||
|
||||
// Folder selection
|
||||
'folder-selected',
|
||||
'pdf-folder-selected',
|
||||
|
||||
// Header/Footer
|
||||
'header-footer-settings-data',
|
||||
'header-footer-logo-selected',
|
||||
'header-footer-logo-saved',
|
||||
|
||||
// Page settings
|
||||
'page-settings-data',
|
||||
|
||||
// PDF operations
|
||||
'pdf-page-count',
|
||||
'pdf-operation-complete',
|
||||
'pdf-operation-error',
|
||||
|
||||
// ASCII Art Generator
|
||||
'show-ascii-generator-window',
|
||||
'show-ascii-generator',
|
||||
|
||||
// Table Generator
|
||||
'show-table-generator-window',
|
||||
|
||||
// Header/Footer dialog
|
||||
'open-header-footer-dialog',
|
||||
'header-footer-logo-cleared',
|
||||
|
||||
// PDF operation progress
|
||||
'pdf-operation-progress',
|
||||
|
||||
// Insert content from generator windows
|
||||
'insert-content'
|
||||
];
|
||||
|
||||
/**
|
||||
* Secure API exposed to renderer process
|
||||
* Access via window.electronAPI in renderer
|
||||
*/
|
||||
contextBridge.exposeInMainWorld('electronAPI', {
|
||||
// ============================================
|
||||
// SEND METHODS (Renderer -> Main)
|
||||
// ============================================
|
||||
|
||||
/**
|
||||
* Send a message to the main process
|
||||
* @param {string} channel - IPC channel name
|
||||
* @param {any} data - Data to send
|
||||
*/
|
||||
send: (channel, data) => {
|
||||
if (ALLOWED_SEND_CHANNELS.includes(channel)) {
|
||||
ipcRenderer.send(channel, data);
|
||||
} else {
|
||||
console.warn(`[Preload] Blocked send to unauthorized channel: ${channel}`);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Invoke a main process handler and get a response
|
||||
* @param {string} channel - IPC channel name
|
||||
* @param {any} data - Data to send
|
||||
* @returns {Promise<any>} Response from main process
|
||||
*/
|
||||
invoke: async (channel, data) => {
|
||||
if (ALLOWED_SEND_CHANNELS.includes(channel)) {
|
||||
return await ipcRenderer.invoke(channel, data);
|
||||
} else {
|
||||
console.warn(`[Preload] Blocked invoke to unauthorized channel: ${channel}`);
|
||||
return null;
|
||||
}
|
||||
},
|
||||
|
||||
// ============================================
|
||||
// RECEIVE METHODS (Main -> Renderer)
|
||||
// ============================================
|
||||
|
||||
/**
|
||||
* Register a listener for messages from main process
|
||||
* @param {string} channel - IPC channel name
|
||||
* @param {Function} callback - Function to call with received data
|
||||
* @returns {Function} Cleanup function to remove listener
|
||||
*/
|
||||
on: (channel, callback) => {
|
||||
if (ALLOWED_RECEIVE_CHANNELS.includes(channel)) {
|
||||
const subscription = (event, ...args) => callback(...args);
|
||||
ipcRenderer.on(channel, subscription);
|
||||
|
||||
// Return cleanup function
|
||||
return () => {
|
||||
ipcRenderer.removeListener(channel, subscription);
|
||||
};
|
||||
} else {
|
||||
console.warn(`[Preload] Blocked listener for unauthorized channel: ${channel}`);
|
||||
return () => {}; // No-op cleanup
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Register a one-time listener for messages from main process
|
||||
* @param {string} channel - IPC channel name
|
||||
* @param {Function} callback - Function to call with received data
|
||||
*/
|
||||
once: (channel, callback) => {
|
||||
if (ALLOWED_RECEIVE_CHANNELS.includes(channel)) {
|
||||
ipcRenderer.once(channel, (event, ...args) => callback(...args));
|
||||
} else {
|
||||
console.warn(`[Preload] Blocked once listener for unauthorized channel: ${channel}`);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Remove all listeners for a channel
|
||||
* @param {string} channel - IPC channel name
|
||||
*/
|
||||
removeAllListeners: (channel) => {
|
||||
if (ALLOWED_RECEIVE_CHANNELS.includes(channel)) {
|
||||
ipcRenderer.removeAllListeners(channel);
|
||||
}
|
||||
},
|
||||
|
||||
// ============================================
|
||||
// CONVENIENCE METHODS
|
||||
// ============================================
|
||||
|
||||
// File Operations
|
||||
file: {
|
||||
save: (filePath, content) => ipcRenderer.send('save-file', { path: filePath, content }),
|
||||
saveCurrent: (content) => ipcRenderer.send('save-current-file', content),
|
||||
setCurrent: (filePath) => ipcRenderer.send('set-current-file', filePath),
|
||||
saveRecent: (recentFiles) => ipcRenderer.send('save-recent-files', recentFiles),
|
||||
clearRecent: () => ipcRenderer.send('clear-recent-files'),
|
||||
rendererReady: () => ipcRenderer.send('renderer-ready')
|
||||
},
|
||||
|
||||
// Theme Operations
|
||||
theme: {
|
||||
get: () => ipcRenderer.send('get-theme')
|
||||
},
|
||||
|
||||
// Print Operations
|
||||
print: {
|
||||
doPrint: (options) => ipcRenderer.send('do-print', options)
|
||||
},
|
||||
|
||||
// Export Operations
|
||||
export: {
|
||||
withOptions: (format, options) => ipcRenderer.send('export-with-options', { format, options }),
|
||||
spreadsheet: (content, format) => ipcRenderer.send('export-spreadsheet', { content, format })
|
||||
},
|
||||
|
||||
// Batch Conversion
|
||||
batch: {
|
||||
convert: (inputFolder, outputFolder, format, options) => {
|
||||
ipcRenderer.send('batch-convert', { inputFolder, outputFolder, format, options });
|
||||
},
|
||||
selectFolder: (type) => ipcRenderer.send('select-folder', type)
|
||||
},
|
||||
|
||||
// Universal Converter
|
||||
converter: {
|
||||
convert: (tool, fromFormat, toFormat, filePath) => {
|
||||
ipcRenderer.send('universal-convert', { tool, fromFormat, toFormat, filePath });
|
||||
},
|
||||
convertBatch: (tool, fromFormat, toFormat, inputFolder, outputFolder) => {
|
||||
ipcRenderer.send('universal-convert-batch', { tool, fromFormat, toFormat, inputFolder, outputFolder });
|
||||
}
|
||||
},
|
||||
|
||||
// Header/Footer Operations
|
||||
headerFooter: {
|
||||
getSettings: () => ipcRenderer.send('get-header-footer-settings'),
|
||||
saveSettings: (settings) => ipcRenderer.send('save-header-footer-settings', settings),
|
||||
browseLogo: (position) => ipcRenderer.send('browse-header-footer-logo', position),
|
||||
saveLogo: (position, filePath) => ipcRenderer.send('save-header-footer-logo', { position, filePath }),
|
||||
clearLogo: (position) => ipcRenderer.send('clear-header-footer-logo', position)
|
||||
},
|
||||
|
||||
// Page Settings
|
||||
page: {
|
||||
getSettings: () => ipcRenderer.send('get-page-settings'),
|
||||
updateSettings: (settings) => ipcRenderer.send('update-page-settings', settings),
|
||||
setCustomStartPage: (pageNumber) => ipcRenderer.send('set-custom-start-page', pageNumber)
|
||||
},
|
||||
|
||||
// PDF Operations
|
||||
pdf: {
|
||||
processOperation: (data) => ipcRenderer.send('process-pdf-operation', data),
|
||||
getPageCount: (filePath) => ipcRenderer.send('get-pdf-page-count', filePath),
|
||||
selectFolder: (inputId) => ipcRenderer.send('select-pdf-folder', inputId)
|
||||
},
|
||||
|
||||
// Image Converter Operations
|
||||
image: {
|
||||
convert: (data) => ipcRenderer.send('image-convert', data),
|
||||
batchConvert: (data) => ipcRenderer.send('image-batch-convert', data),
|
||||
resize: (data) => ipcRenderer.send('image-resize', data),
|
||||
compress: (data) => ipcRenderer.send('image-compress', data),
|
||||
rotate: (data) => ipcRenderer.send('image-rotate', data)
|
||||
},
|
||||
|
||||
// Audio Converter Operations
|
||||
audio: {
|
||||
convert: (data) => ipcRenderer.send('audio-convert', data),
|
||||
batchConvert: (data) => ipcRenderer.send('audio-batch-convert', data),
|
||||
extract: (data) => ipcRenderer.send('audio-extract', data),
|
||||
trim: (data) => ipcRenderer.send('audio-trim', data),
|
||||
merge: (data) => ipcRenderer.send('audio-merge', data)
|
||||
},
|
||||
|
||||
// Video Converter Operations
|
||||
video: {
|
||||
convert: (data) => ipcRenderer.send('video-convert', data),
|
||||
batchConvert: (data) => ipcRenderer.send('video-batch-convert', data),
|
||||
compress: (data) => ipcRenderer.send('video-compress', data),
|
||||
trim: (data) => ipcRenderer.send('video-trim', data),
|
||||
extractFrames: (data) => ipcRenderer.send('video-frames', data),
|
||||
toGif: (data) => ipcRenderer.send('video-gif', data)
|
||||
},
|
||||
|
||||
// Generator Windows
|
||||
generators: {
|
||||
openAscii: () => ipcRenderer.send('open-ascii-generator'),
|
||||
openTable: () => ipcRenderer.send('open-table-generator')
|
||||
}
|
||||
});
|
||||
|
||||
// Log successful preload initialization
|
||||
console.log('[Preload] Secure IPC bridge initialized');
|
||||
console.log('[Preload] Allowed send channels:', ALLOWED_SEND_CHANNELS.length);
|
||||
console.log('[Preload] Allowed receive channels:', ALLOWED_RECEIVE_CHANNELS.length);
|
||||
/**
|
||||
* Preload Script for PanConverter
|
||||
*
|
||||
* This script creates a secure bridge between the main process and renderer process.
|
||||
* It exposes only specific IPC channels, preventing direct Node.js access in the renderer.
|
||||
*
|
||||
* Security Benefits:
|
||||
* - No direct access to Node.js APIs (fs, path, child_process, etc.)
|
||||
* - All IPC channels are explicitly whitelisted
|
||||
* - Prevents XSS from escalating to full system access
|
||||
*
|
||||
* @version 2.2.0
|
||||
*/
|
||||
|
||||
const { contextBridge, ipcRenderer } = require('electron');
|
||||
|
||||
// Define allowed IPC channels for security
|
||||
const ALLOWED_SEND_CHANNELS = [
|
||||
// File operations
|
||||
'save-file',
|
||||
'save-current-file',
|
||||
'set-current-file',
|
||||
'save-recent-files',
|
||||
'clear-recent-files',
|
||||
'renderer-ready',
|
||||
|
||||
// Theme
|
||||
'get-theme',
|
||||
|
||||
// Print
|
||||
'do-print',
|
||||
|
||||
// Export
|
||||
'export-with-options',
|
||||
'export-spreadsheet',
|
||||
|
||||
// Batch conversion
|
||||
'batch-convert',
|
||||
'select-folder',
|
||||
|
||||
// Universal converter
|
||||
'universal-convert',
|
||||
'universal-convert-batch',
|
||||
|
||||
// Image converter
|
||||
'image-convert',
|
||||
'image-batch-convert',
|
||||
'image-resize',
|
||||
'image-compress',
|
||||
'image-rotate',
|
||||
|
||||
// Audio converter
|
||||
'audio-convert',
|
||||
'audio-batch-convert',
|
||||
'audio-extract',
|
||||
'audio-trim',
|
||||
'audio-merge',
|
||||
|
||||
// Video converter
|
||||
'video-convert',
|
||||
'video-batch-convert',
|
||||
'video-compress',
|
||||
'video-trim',
|
||||
'video-frames',
|
||||
'video-gif',
|
||||
|
||||
// Header/Footer
|
||||
'get-header-footer-settings',
|
||||
'save-header-footer-settings',
|
||||
'browse-header-footer-logo',
|
||||
'save-header-footer-logo',
|
||||
'clear-header-footer-logo',
|
||||
|
||||
// Page settings
|
||||
'get-page-settings',
|
||||
'update-page-settings',
|
||||
|
||||
// Template settings
|
||||
'set-custom-start-page',
|
||||
|
||||
// PDF operations
|
||||
'process-pdf-operation',
|
||||
'get-pdf-page-count',
|
||||
'select-pdf-folder',
|
||||
|
||||
// ASCII generator (separate window)
|
||||
'open-ascii-generator',
|
||||
|
||||
// Table generator (separate window)
|
||||
'open-table-generator',
|
||||
|
||||
// Insert generated content
|
||||
'insert-generated-content'
|
||||
];
|
||||
|
||||
const ALLOWED_RECEIVE_CHANNELS = [
|
||||
// File operations
|
||||
'file-new',
|
||||
'file-opened',
|
||||
'file-save',
|
||||
'get-content-for-save',
|
||||
'get-content-for-spreadsheet',
|
||||
'recent-files-cleared',
|
||||
|
||||
// UI toggles
|
||||
'toggle-preview',
|
||||
'toggle-find',
|
||||
|
||||
// Theme
|
||||
'theme-changed',
|
||||
'theme-data',
|
||||
|
||||
// Edit operations
|
||||
'undo',
|
||||
'redo',
|
||||
|
||||
// Font
|
||||
'adjust-font-size',
|
||||
|
||||
// Print
|
||||
'print-preview',
|
||||
'print-preview-styled',
|
||||
|
||||
// Export dialogs
|
||||
'show-export-dialog',
|
||||
'show-batch-dialog',
|
||||
'show-universal-converter-dialog',
|
||||
'show-table-generator',
|
||||
'show-pdf-editor-dialog',
|
||||
|
||||
// Converter dialogs
|
||||
'show-image-converter',
|
||||
'show-audio-converter',
|
||||
'show-video-converter',
|
||||
|
||||
// PDF viewer
|
||||
'open-pdf-viewer',
|
||||
|
||||
// Conversion status
|
||||
'conversion-status',
|
||||
'conversion-complete',
|
||||
'batch-progress',
|
||||
'image-conversion-complete',
|
||||
'audio-conversion-complete',
|
||||
'video-conversion-complete',
|
||||
|
||||
// Folder selection
|
||||
'folder-selected',
|
||||
'pdf-folder-selected',
|
||||
|
||||
// Header/Footer
|
||||
'header-footer-settings-data',
|
||||
'header-footer-logo-selected',
|
||||
'header-footer-logo-saved',
|
||||
|
||||
// Page settings
|
||||
'page-settings-data',
|
||||
|
||||
// PDF operations
|
||||
'pdf-page-count',
|
||||
'pdf-operation-complete',
|
||||
'pdf-operation-error',
|
||||
|
||||
// ASCII Art Generator
|
||||
'show-ascii-generator-window',
|
||||
'show-ascii-generator',
|
||||
|
||||
// Table Generator
|
||||
'show-table-generator-window',
|
||||
|
||||
// Header/Footer dialog
|
||||
'open-header-footer-dialog',
|
||||
'header-footer-logo-cleared',
|
||||
|
||||
// PDF operation progress
|
||||
'pdf-operation-progress',
|
||||
|
||||
// Insert content from generator windows
|
||||
'insert-content'
|
||||
];
|
||||
|
||||
/**
|
||||
* Secure API exposed to renderer process
|
||||
* Access via window.electronAPI in renderer
|
||||
*/
|
||||
contextBridge.exposeInMainWorld('electronAPI', {
|
||||
// ============================================
|
||||
// SEND METHODS (Renderer -> Main)
|
||||
// ============================================
|
||||
|
||||
/**
|
||||
* Send a message to the main process
|
||||
* @param {string} channel - IPC channel name
|
||||
* @param {any} data - Data to send
|
||||
*/
|
||||
send: (channel, data) => {
|
||||
if (ALLOWED_SEND_CHANNELS.includes(channel)) {
|
||||
ipcRenderer.send(channel, data);
|
||||
} else {
|
||||
console.warn(`[Preload] Blocked send to unauthorized channel: ${channel}`);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Invoke a main process handler and get a response
|
||||
* @param {string} channel - IPC channel name
|
||||
* @param {any} data - Data to send
|
||||
* @returns {Promise<any>} Response from main process
|
||||
*/
|
||||
invoke: async (channel, data) => {
|
||||
if (ALLOWED_SEND_CHANNELS.includes(channel)) {
|
||||
return await ipcRenderer.invoke(channel, data);
|
||||
} else {
|
||||
console.warn(`[Preload] Blocked invoke to unauthorized channel: ${channel}`);
|
||||
return null;
|
||||
}
|
||||
},
|
||||
|
||||
// ============================================
|
||||
// RECEIVE METHODS (Main -> Renderer)
|
||||
// ============================================
|
||||
|
||||
/**
|
||||
* Register a listener for messages from main process
|
||||
* @param {string} channel - IPC channel name
|
||||
* @param {Function} callback - Function to call with received data
|
||||
* @returns {Function} Cleanup function to remove listener
|
||||
*/
|
||||
on: (channel, callback) => {
|
||||
if (ALLOWED_RECEIVE_CHANNELS.includes(channel)) {
|
||||
const subscription = (event, ...args) => callback(...args);
|
||||
ipcRenderer.on(channel, subscription);
|
||||
|
||||
// Return cleanup function
|
||||
return () => {
|
||||
ipcRenderer.removeListener(channel, subscription);
|
||||
};
|
||||
} else {
|
||||
console.warn(`[Preload] Blocked listener for unauthorized channel: ${channel}`);
|
||||
return () => {}; // No-op cleanup
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Register a one-time listener for messages from main process
|
||||
* @param {string} channel - IPC channel name
|
||||
* @param {Function} callback - Function to call with received data
|
||||
*/
|
||||
once: (channel, callback) => {
|
||||
if (ALLOWED_RECEIVE_CHANNELS.includes(channel)) {
|
||||
ipcRenderer.once(channel, (event, ...args) => callback(...args));
|
||||
} else {
|
||||
console.warn(`[Preload] Blocked once listener for unauthorized channel: ${channel}`);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Remove all listeners for a channel
|
||||
* @param {string} channel - IPC channel name
|
||||
*/
|
||||
removeAllListeners: (channel) => {
|
||||
if (ALLOWED_RECEIVE_CHANNELS.includes(channel)) {
|
||||
ipcRenderer.removeAllListeners(channel);
|
||||
}
|
||||
},
|
||||
|
||||
// ============================================
|
||||
// CONVENIENCE METHODS
|
||||
// ============================================
|
||||
|
||||
// File Operations
|
||||
file: {
|
||||
save: (filePath, content) => ipcRenderer.send('save-file', { path: filePath, content }),
|
||||
saveCurrent: (content) => ipcRenderer.send('save-current-file', content),
|
||||
setCurrent: (filePath) => ipcRenderer.send('set-current-file', filePath),
|
||||
saveRecent: (recentFiles) => ipcRenderer.send('save-recent-files', recentFiles),
|
||||
clearRecent: () => ipcRenderer.send('clear-recent-files'),
|
||||
rendererReady: () => ipcRenderer.send('renderer-ready')
|
||||
},
|
||||
|
||||
// Theme Operations
|
||||
theme: {
|
||||
get: () => ipcRenderer.send('get-theme')
|
||||
},
|
||||
|
||||
// Print Operations
|
||||
print: {
|
||||
doPrint: (options) => ipcRenderer.send('do-print', options)
|
||||
},
|
||||
|
||||
// Export Operations
|
||||
export: {
|
||||
withOptions: (format, options) => ipcRenderer.send('export-with-options', { format, options }),
|
||||
spreadsheet: (content, format) => ipcRenderer.send('export-spreadsheet', { content, format })
|
||||
},
|
||||
|
||||
// Batch Conversion
|
||||
batch: {
|
||||
convert: (inputFolder, outputFolder, format, options) => {
|
||||
ipcRenderer.send('batch-convert', { inputFolder, outputFolder, format, options });
|
||||
},
|
||||
selectFolder: (type) => ipcRenderer.send('select-folder', type)
|
||||
},
|
||||
|
||||
// Universal Converter
|
||||
converter: {
|
||||
convert: (tool, fromFormat, toFormat, filePath) => {
|
||||
ipcRenderer.send('universal-convert', { tool, fromFormat, toFormat, filePath });
|
||||
},
|
||||
convertBatch: (tool, fromFormat, toFormat, inputFolder, outputFolder) => {
|
||||
ipcRenderer.send('universal-convert-batch', { tool, fromFormat, toFormat, inputFolder, outputFolder });
|
||||
}
|
||||
},
|
||||
|
||||
// Header/Footer Operations
|
||||
headerFooter: {
|
||||
getSettings: () => ipcRenderer.send('get-header-footer-settings'),
|
||||
saveSettings: (settings) => ipcRenderer.send('save-header-footer-settings', settings),
|
||||
browseLogo: (position) => ipcRenderer.send('browse-header-footer-logo', position),
|
||||
saveLogo: (position, filePath) => ipcRenderer.send('save-header-footer-logo', { position, filePath }),
|
||||
clearLogo: (position) => ipcRenderer.send('clear-header-footer-logo', position)
|
||||
},
|
||||
|
||||
// Page Settings
|
||||
page: {
|
||||
getSettings: () => ipcRenderer.send('get-page-settings'),
|
||||
updateSettings: (settings) => ipcRenderer.send('update-page-settings', settings),
|
||||
setCustomStartPage: (pageNumber) => ipcRenderer.send('set-custom-start-page', pageNumber)
|
||||
},
|
||||
|
||||
// PDF Operations
|
||||
pdf: {
|
||||
processOperation: (data) => ipcRenderer.send('process-pdf-operation', data),
|
||||
getPageCount: (filePath) => ipcRenderer.send('get-pdf-page-count', filePath),
|
||||
selectFolder: (inputId) => ipcRenderer.send('select-pdf-folder', inputId)
|
||||
},
|
||||
|
||||
// Image Converter Operations
|
||||
image: {
|
||||
convert: (data) => ipcRenderer.send('image-convert', data),
|
||||
batchConvert: (data) => ipcRenderer.send('image-batch-convert', data),
|
||||
resize: (data) => ipcRenderer.send('image-resize', data),
|
||||
compress: (data) => ipcRenderer.send('image-compress', data),
|
||||
rotate: (data) => ipcRenderer.send('image-rotate', data)
|
||||
},
|
||||
|
||||
// Audio Converter Operations
|
||||
audio: {
|
||||
convert: (data) => ipcRenderer.send('audio-convert', data),
|
||||
batchConvert: (data) => ipcRenderer.send('audio-batch-convert', data),
|
||||
extract: (data) => ipcRenderer.send('audio-extract', data),
|
||||
trim: (data) => ipcRenderer.send('audio-trim', data),
|
||||
merge: (data) => ipcRenderer.send('audio-merge', data)
|
||||
},
|
||||
|
||||
// Video Converter Operations
|
||||
video: {
|
||||
convert: (data) => ipcRenderer.send('video-convert', data),
|
||||
batchConvert: (data) => ipcRenderer.send('video-batch-convert', data),
|
||||
compress: (data) => ipcRenderer.send('video-compress', data),
|
||||
trim: (data) => ipcRenderer.send('video-trim', data),
|
||||
extractFrames: (data) => ipcRenderer.send('video-frames', data),
|
||||
toGif: (data) => ipcRenderer.send('video-gif', data)
|
||||
},
|
||||
|
||||
// Generator Windows
|
||||
generators: {
|
||||
openAscii: () => ipcRenderer.send('open-ascii-generator'),
|
||||
openTable: () => ipcRenderer.send('open-table-generator')
|
||||
}
|
||||
});
|
||||
|
||||
// Log successful preload initialization
|
||||
console.log('[Preload] Secure IPC bridge initialized');
|
||||
console.log('[Preload] Allowed send channels:', ALLOWED_SEND_CHANNELS.length);
|
||||
console.log('[Preload] Allowed receive channels:', ALLOWED_RECEIVE_CHANNELS.length);
|
||||
|
||||
+4514
-4514
File diff suppressed because it is too large
Load Diff
+969
-969
File diff suppressed because it is too large
Load Diff
+2113
-2113
File diff suppressed because it is too large
Load Diff
+4080
-4080
File diff suppressed because it is too large
Load Diff
+545
-545
File diff suppressed because it is too large
Load Diff
+743
-743
File diff suppressed because it is too large
Load Diff
+12
-12
@@ -1,12 +1,12 @@
|
||||
# Test Double-Click File Opening
|
||||
|
||||
This is a test file to verify double-click functionality.
|
||||
|
||||
## Features to Test
|
||||
- File should load automatically
|
||||
- Content should display in editor
|
||||
- Tab should show filename
|
||||
- Preview should render markdown
|
||||
|
||||
**This text should be bold**
|
||||
*This text should be italic*
|
||||
# Test Double-Click File Opening
|
||||
|
||||
This is a test file to verify double-click functionality.
|
||||
|
||||
## Features to Test
|
||||
- File should load automatically
|
||||
- Content should display in editor
|
||||
- Tab should show filename
|
||||
- Preview should render markdown
|
||||
|
||||
**This text should be bold**
|
||||
*This text should be italic*
|
||||
|
||||
@@ -1,49 +1,49 @@
|
||||
// Test script to verify export functionality
|
||||
const { exec } = require('child_process');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
console.log('Testing export functionality...');
|
||||
|
||||
// Test 1: Check if pandoc is available
|
||||
console.log('\n1. Checking Pandoc availability...');
|
||||
exec('pandoc --version', (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
console.log('❌ Pandoc not available:', error.message);
|
||||
console.log('✅ Built-in HTML and PDF export should work');
|
||||
} else {
|
||||
console.log('✅ Pandoc is available');
|
||||
console.log(' Version info:', stdout.split('\n')[0]);
|
||||
}
|
||||
});
|
||||
|
||||
// Test 2: Check if test markdown file exists
|
||||
console.log('\n2. Checking test file...');
|
||||
const testFile = path.join(__dirname, 'test-export.md');
|
||||
if (fs.existsSync(testFile)) {
|
||||
console.log('✅ Test markdown file exists:', testFile);
|
||||
const content = fs.readFileSync(testFile, 'utf8');
|
||||
console.log(' File size:', content.length, 'characters');
|
||||
} else {
|
||||
console.log('❌ Test markdown file not found');
|
||||
}
|
||||
|
||||
// Test 3: Check marked library
|
||||
console.log('\n3. Testing marked library...');
|
||||
try {
|
||||
const marked = require('marked');
|
||||
const testMarkdown = '# Test\nThis is a **test** markdown.';
|
||||
const html = marked.parse(testMarkdown);
|
||||
console.log('✅ Marked library working');
|
||||
console.log(' Sample output:', html.substring(0, 50) + '...');
|
||||
} catch (error) {
|
||||
console.log('❌ Marked library error:', error.message);
|
||||
}
|
||||
|
||||
console.log('\n✅ Export functionality test completed!');
|
||||
console.log('\nHow to test exports:');
|
||||
console.log('1. Open the application');
|
||||
console.log('2. Open test-export.md file');
|
||||
console.log('3. Try exporting to HTML (should work without Pandoc)');
|
||||
console.log('4. Try exporting to PDF (should work without Pandoc)');
|
||||
// Test script to verify export functionality
|
||||
const { exec } = require('child_process');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
console.log('Testing export functionality...');
|
||||
|
||||
// Test 1: Check if pandoc is available
|
||||
console.log('\n1. Checking Pandoc availability...');
|
||||
exec('pandoc --version', (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
console.log('❌ Pandoc not available:', error.message);
|
||||
console.log('✅ Built-in HTML and PDF export should work');
|
||||
} else {
|
||||
console.log('✅ Pandoc is available');
|
||||
console.log(' Version info:', stdout.split('\n')[0]);
|
||||
}
|
||||
});
|
||||
|
||||
// Test 2: Check if test markdown file exists
|
||||
console.log('\n2. Checking test file...');
|
||||
const testFile = path.join(__dirname, 'test-export.md');
|
||||
if (fs.existsSync(testFile)) {
|
||||
console.log('✅ Test markdown file exists:', testFile);
|
||||
const content = fs.readFileSync(testFile, 'utf8');
|
||||
console.log(' File size:', content.length, 'characters');
|
||||
} else {
|
||||
console.log('❌ Test markdown file not found');
|
||||
}
|
||||
|
||||
// Test 3: Check marked library
|
||||
console.log('\n3. Testing marked library...');
|
||||
try {
|
||||
const marked = require('marked');
|
||||
const testMarkdown = '# Test\nThis is a **test** markdown.';
|
||||
const html = marked.parse(testMarkdown);
|
||||
console.log('✅ Marked library working');
|
||||
console.log(' Sample output:', html.substring(0, 50) + '...');
|
||||
} catch (error) {
|
||||
console.log('❌ Marked library error:', error.message);
|
||||
}
|
||||
|
||||
console.log('\n✅ Export functionality test completed!');
|
||||
console.log('\nHow to test exports:');
|
||||
console.log('1. Open the application');
|
||||
console.log('2. Open test-export.md file');
|
||||
console.log('3. Try exporting to HTML (should work without Pandoc)');
|
||||
console.log('4. Try exporting to PDF (should work without Pandoc)');
|
||||
console.log('5. Try exporting to DOCX (requires Pandoc)');
|
||||
+25
-25
@@ -1,26 +1,26 @@
|
||||
# Test Document
|
||||
|
||||
This is a test markdown document for export testing.
|
||||
|
||||
## Features
|
||||
|
||||
- **Bold text**
|
||||
- *Italic text*
|
||||
- [Links](https://example.com)
|
||||
|
||||
## Code Example
|
||||
|
||||
```javascript
|
||||
function hello() {
|
||||
console.log("Hello World!");
|
||||
}
|
||||
```
|
||||
|
||||
## Table
|
||||
|
||||
| Column 1 | Column 2 | Column 3 |
|
||||
|----------|----------|----------|
|
||||
| Value 1 | Value 2 | Value 3 |
|
||||
| Value 4 | Value 5 | Value 6 |
|
||||
|
||||
# Test Document
|
||||
|
||||
This is a test markdown document for export testing.
|
||||
|
||||
## Features
|
||||
|
||||
- **Bold text**
|
||||
- *Italic text*
|
||||
- [Links](https://example.com)
|
||||
|
||||
## Code Example
|
||||
|
||||
```javascript
|
||||
function hello() {
|
||||
console.log("Hello World!");
|
||||
}
|
||||
```
|
||||
|
||||
## Table
|
||||
|
||||
| Column 1 | Column 2 | Column 3 |
|
||||
|----------|----------|----------|
|
||||
| Value 1 | Value 2 | Value 3 |
|
||||
| Value 4 | Value 5 | Value 6 |
|
||||
|
||||
This is a test document to verify export functionality.
|
||||
+14
-14
@@ -1,14 +1,14 @@
|
||||
# Test File Opening
|
||||
|
||||
This is a test file to verify that double-click file opening works correctly.
|
||||
|
||||
## Features
|
||||
- **Bold text**
|
||||
- *Italic text*
|
||||
- `Code`
|
||||
|
||||
```javascript
|
||||
console.log("Hello World");
|
||||
```
|
||||
|
||||
This should appear when you double-click to open the file!
|
||||
# Test File Opening
|
||||
|
||||
This is a test file to verify that double-click file opening works correctly.
|
||||
|
||||
## Features
|
||||
- **Bold text**
|
||||
- *Italic text*
|
||||
- `Code`
|
||||
|
||||
```javascript
|
||||
console.log("Hello World");
|
||||
```
|
||||
|
||||
This should appear when you double-click to open the file!
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
# Test Document
|
||||
|
||||
This is a **test** markdown document.
|
||||
|
||||
## Features
|
||||
|
||||
- Item 1
|
||||
- Item 2
|
||||
- Item 3
|
||||
|
||||
### Code Example
|
||||
|
||||
```javascript
|
||||
console.log("Hello World");
|
||||
```
|
||||
|
||||
> Tqweqweqweqweqweqweqeweqweqweqwe
|
||||
dfe
|
||||
|
||||
qwe
|
||||
qwe
|
||||
qwe
|
||||
# Test Document
|
||||
|
||||
This is a **test** markdown document.
|
||||
|
||||
## Features
|
||||
|
||||
- Item 1
|
||||
- Item 2
|
||||
- Item 3
|
||||
|
||||
### Code Example
|
||||
|
||||
```javascript
|
||||
console.log("Hello World");
|
||||
```
|
||||
|
||||
> Tqweqweqweqweqweqweqeweqweqweqwe
|
||||
dfe
|
||||
|
||||
qwe
|
||||
qwe
|
||||
qwe
|
||||
qwe
|
||||
+121
-121
@@ -1,121 +1,121 @@
|
||||
/**
|
||||
* Tests for Preload Script Security
|
||||
* Verifies that the IPC bridge is properly configured
|
||||
*/
|
||||
|
||||
describe('Preload Security', () => {
|
||||
describe('Allowed Channels', () => {
|
||||
const EXPECTED_SEND_CHANNELS = [
|
||||
'save-file',
|
||||
'save-current-file',
|
||||
'set-current-file',
|
||||
'save-recent-files',
|
||||
'clear-recent-files',
|
||||
'renderer-ready',
|
||||
'get-theme',
|
||||
'do-print',
|
||||
'export-with-options',
|
||||
'export-spreadsheet',
|
||||
'batch-convert',
|
||||
'select-folder',
|
||||
'universal-convert',
|
||||
'universal-convert-batch',
|
||||
'get-header-footer-settings',
|
||||
'save-header-footer-settings',
|
||||
'browse-header-footer-logo',
|
||||
'save-header-footer-logo',
|
||||
'clear-header-footer-logo',
|
||||
'get-page-settings',
|
||||
'update-page-settings',
|
||||
'set-custom-start-page',
|
||||
'process-pdf-operation',
|
||||
'get-pdf-page-count',
|
||||
'select-pdf-folder'
|
||||
];
|
||||
|
||||
const EXPECTED_RECEIVE_CHANNELS = [
|
||||
'file-new',
|
||||
'file-opened',
|
||||
'file-save',
|
||||
'get-content-for-save',
|
||||
'get-content-for-spreadsheet',
|
||||
'recent-files-cleared',
|
||||
'toggle-preview',
|
||||
'toggle-find',
|
||||
'theme-changed',
|
||||
'theme-data',
|
||||
'undo',
|
||||
'redo',
|
||||
'adjust-font-size',
|
||||
'print-preview',
|
||||
'print-preview-styled',
|
||||
'show-export-dialog',
|
||||
'show-batch-dialog',
|
||||
'show-universal-converter-dialog',
|
||||
'show-table-generator',
|
||||
'show-pdf-editor-dialog',
|
||||
'conversion-status',
|
||||
'conversion-complete',
|
||||
'batch-progress',
|
||||
'folder-selected',
|
||||
'pdf-folder-selected',
|
||||
'header-footer-settings-data',
|
||||
'header-footer-logo-selected',
|
||||
'header-footer-logo-saved',
|
||||
'page-settings-data',
|
||||
'pdf-page-count',
|
||||
'pdf-operation-complete',
|
||||
'pdf-operation-error'
|
||||
];
|
||||
|
||||
test('should define all expected send channels', () => {
|
||||
// This test documents expected channels
|
||||
expect(EXPECTED_SEND_CHANNELS.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
test('should define all expected receive channels', () => {
|
||||
// This test documents expected channels
|
||||
expect(EXPECTED_RECEIVE_CHANNELS.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('electronAPI Interface', () => {
|
||||
test('should expose send method', () => {
|
||||
expect(window.electronAPI.send).toBeDefined();
|
||||
expect(typeof window.electronAPI.send).toBe('function');
|
||||
});
|
||||
|
||||
test('should expose on method', () => {
|
||||
expect(window.electronAPI.on).toBeDefined();
|
||||
expect(typeof window.electronAPI.on).toBe('function');
|
||||
});
|
||||
|
||||
test('should expose once method', () => {
|
||||
expect(window.electronAPI.once).toBeDefined();
|
||||
expect(typeof window.electronAPI.once).toBe('function');
|
||||
});
|
||||
|
||||
test('should expose invoke method', () => {
|
||||
expect(window.electronAPI.invoke).toBeDefined();
|
||||
expect(typeof window.electronAPI.invoke).toBe('function');
|
||||
});
|
||||
|
||||
test('should expose file convenience methods', () => {
|
||||
expect(window.electronAPI.file).toBeDefined();
|
||||
expect(window.electronAPI.file.save).toBeDefined();
|
||||
expect(window.electronAPI.file.saveCurrent).toBeDefined();
|
||||
expect(window.electronAPI.file.setCurrent).toBeDefined();
|
||||
});
|
||||
|
||||
test('should expose theme convenience methods', () => {
|
||||
expect(window.electronAPI.theme).toBeDefined();
|
||||
expect(window.electronAPI.theme.get).toBeDefined();
|
||||
});
|
||||
|
||||
test('should expose pdf convenience methods', () => {
|
||||
expect(window.electronAPI.pdf).toBeDefined();
|
||||
expect(window.electronAPI.pdf.processOperation).toBeDefined();
|
||||
expect(window.electronAPI.pdf.getPageCount).toBeDefined();
|
||||
});
|
||||
});
|
||||
});
|
||||
/**
|
||||
* Tests for Preload Script Security
|
||||
* Verifies that the IPC bridge is properly configured
|
||||
*/
|
||||
|
||||
describe('Preload Security', () => {
|
||||
describe('Allowed Channels', () => {
|
||||
const EXPECTED_SEND_CHANNELS = [
|
||||
'save-file',
|
||||
'save-current-file',
|
||||
'set-current-file',
|
||||
'save-recent-files',
|
||||
'clear-recent-files',
|
||||
'renderer-ready',
|
||||
'get-theme',
|
||||
'do-print',
|
||||
'export-with-options',
|
||||
'export-spreadsheet',
|
||||
'batch-convert',
|
||||
'select-folder',
|
||||
'universal-convert',
|
||||
'universal-convert-batch',
|
||||
'get-header-footer-settings',
|
||||
'save-header-footer-settings',
|
||||
'browse-header-footer-logo',
|
||||
'save-header-footer-logo',
|
||||
'clear-header-footer-logo',
|
||||
'get-page-settings',
|
||||
'update-page-settings',
|
||||
'set-custom-start-page',
|
||||
'process-pdf-operation',
|
||||
'get-pdf-page-count',
|
||||
'select-pdf-folder'
|
||||
];
|
||||
|
||||
const EXPECTED_RECEIVE_CHANNELS = [
|
||||
'file-new',
|
||||
'file-opened',
|
||||
'file-save',
|
||||
'get-content-for-save',
|
||||
'get-content-for-spreadsheet',
|
||||
'recent-files-cleared',
|
||||
'toggle-preview',
|
||||
'toggle-find',
|
||||
'theme-changed',
|
||||
'theme-data',
|
||||
'undo',
|
||||
'redo',
|
||||
'adjust-font-size',
|
||||
'print-preview',
|
||||
'print-preview-styled',
|
||||
'show-export-dialog',
|
||||
'show-batch-dialog',
|
||||
'show-universal-converter-dialog',
|
||||
'show-table-generator',
|
||||
'show-pdf-editor-dialog',
|
||||
'conversion-status',
|
||||
'conversion-complete',
|
||||
'batch-progress',
|
||||
'folder-selected',
|
||||
'pdf-folder-selected',
|
||||
'header-footer-settings-data',
|
||||
'header-footer-logo-selected',
|
||||
'header-footer-logo-saved',
|
||||
'page-settings-data',
|
||||
'pdf-page-count',
|
||||
'pdf-operation-complete',
|
||||
'pdf-operation-error'
|
||||
];
|
||||
|
||||
test('should define all expected send channels', () => {
|
||||
// This test documents expected channels
|
||||
expect(EXPECTED_SEND_CHANNELS.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
test('should define all expected receive channels', () => {
|
||||
// This test documents expected channels
|
||||
expect(EXPECTED_RECEIVE_CHANNELS.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('electronAPI Interface', () => {
|
||||
test('should expose send method', () => {
|
||||
expect(window.electronAPI.send).toBeDefined();
|
||||
expect(typeof window.electronAPI.send).toBe('function');
|
||||
});
|
||||
|
||||
test('should expose on method', () => {
|
||||
expect(window.electronAPI.on).toBeDefined();
|
||||
expect(typeof window.electronAPI.on).toBe('function');
|
||||
});
|
||||
|
||||
test('should expose once method', () => {
|
||||
expect(window.electronAPI.once).toBeDefined();
|
||||
expect(typeof window.electronAPI.once).toBe('function');
|
||||
});
|
||||
|
||||
test('should expose invoke method', () => {
|
||||
expect(window.electronAPI.invoke).toBeDefined();
|
||||
expect(typeof window.electronAPI.invoke).toBe('function');
|
||||
});
|
||||
|
||||
test('should expose file convenience methods', () => {
|
||||
expect(window.electronAPI.file).toBeDefined();
|
||||
expect(window.electronAPI.file.save).toBeDefined();
|
||||
expect(window.electronAPI.file.saveCurrent).toBeDefined();
|
||||
expect(window.electronAPI.file.setCurrent).toBeDefined();
|
||||
});
|
||||
|
||||
test('should expose theme convenience methods', () => {
|
||||
expect(window.electronAPI.theme).toBeDefined();
|
||||
expect(window.electronAPI.theme.get).toBeDefined();
|
||||
});
|
||||
|
||||
test('should expose pdf convenience methods', () => {
|
||||
expect(window.electronAPI.pdf).toBeDefined();
|
||||
expect(window.electronAPI.pdf.processOperation).toBeDefined();
|
||||
expect(window.electronAPI.pdf.getPageCount).toBeDefined();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
+100
-100
@@ -1,100 +1,100 @@
|
||||
/**
|
||||
* Jest Test Setup
|
||||
* Provides mocks and utilities for PanConverter tests
|
||||
*/
|
||||
|
||||
// Mock window.electronAPI for renderer tests
|
||||
global.window = global.window || {};
|
||||
global.window.electronAPI = {
|
||||
send: jest.fn(),
|
||||
on: jest.fn(() => jest.fn()), // Returns cleanup function
|
||||
once: jest.fn(),
|
||||
invoke: jest.fn(() => Promise.resolve(null)),
|
||||
removeAllListeners: jest.fn(),
|
||||
file: {
|
||||
save: jest.fn(),
|
||||
saveCurrent: jest.fn(),
|
||||
setCurrent: jest.fn(),
|
||||
saveRecent: jest.fn(),
|
||||
clearRecent: jest.fn(),
|
||||
rendererReady: jest.fn()
|
||||
},
|
||||
theme: {
|
||||
get: jest.fn()
|
||||
},
|
||||
print: {
|
||||
doPrint: jest.fn()
|
||||
},
|
||||
export: {
|
||||
withOptions: jest.fn(),
|
||||
spreadsheet: jest.fn()
|
||||
},
|
||||
batch: {
|
||||
convert: jest.fn(),
|
||||
selectFolder: jest.fn()
|
||||
},
|
||||
converter: {
|
||||
convert: jest.fn(),
|
||||
convertBatch: jest.fn()
|
||||
},
|
||||
headerFooter: {
|
||||
getSettings: jest.fn(),
|
||||
saveSettings: jest.fn(),
|
||||
browseLogo: jest.fn(),
|
||||
saveLogo: jest.fn(),
|
||||
clearLogo: jest.fn()
|
||||
},
|
||||
page: {
|
||||
getSettings: jest.fn(),
|
||||
updateSettings: jest.fn(),
|
||||
setCustomStartPage: jest.fn()
|
||||
},
|
||||
pdf: {
|
||||
processOperation: jest.fn(),
|
||||
getPageCount: jest.fn(),
|
||||
selectFolder: jest.fn()
|
||||
}
|
||||
};
|
||||
|
||||
// Mock marked library
|
||||
global.window.marked = {
|
||||
parse: jest.fn((text) => `<p>${text}</p>`),
|
||||
setOptions: jest.fn()
|
||||
};
|
||||
|
||||
// Mock DOMPurify
|
||||
global.window.DOMPurify = {
|
||||
sanitize: jest.fn((html) => html)
|
||||
};
|
||||
|
||||
// Mock highlight.js
|
||||
global.window.hljs = {
|
||||
highlight: jest.fn((code, options) => ({ value: code })),
|
||||
highlightAuto: jest.fn((code) => ({ value: code })),
|
||||
getLanguage: jest.fn(() => true)
|
||||
};
|
||||
|
||||
// Mock localStorage
|
||||
const localStorageMock = {
|
||||
getItem: jest.fn(),
|
||||
setItem: jest.fn(),
|
||||
removeItem: jest.fn(),
|
||||
clear: jest.fn()
|
||||
};
|
||||
global.localStorage = localStorageMock;
|
||||
|
||||
// Console spy to catch unintended console logs in tests
|
||||
const originalConsoleError = console.error;
|
||||
console.error = (...args) => {
|
||||
// Allow certain expected errors
|
||||
const message = args[0]?.toString() || '';
|
||||
if (message.includes('Warning:') || message.includes('React')) {
|
||||
return;
|
||||
}
|
||||
originalConsoleError.apply(console, args);
|
||||
};
|
||||
|
||||
// Cleanup after each test
|
||||
afterEach(() => {
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
/**
|
||||
* Jest Test Setup
|
||||
* Provides mocks and utilities for PanConverter tests
|
||||
*/
|
||||
|
||||
// Mock window.electronAPI for renderer tests
|
||||
global.window = global.window || {};
|
||||
global.window.electronAPI = {
|
||||
send: jest.fn(),
|
||||
on: jest.fn(() => jest.fn()), // Returns cleanup function
|
||||
once: jest.fn(),
|
||||
invoke: jest.fn(() => Promise.resolve(null)),
|
||||
removeAllListeners: jest.fn(),
|
||||
file: {
|
||||
save: jest.fn(),
|
||||
saveCurrent: jest.fn(),
|
||||
setCurrent: jest.fn(),
|
||||
saveRecent: jest.fn(),
|
||||
clearRecent: jest.fn(),
|
||||
rendererReady: jest.fn()
|
||||
},
|
||||
theme: {
|
||||
get: jest.fn()
|
||||
},
|
||||
print: {
|
||||
doPrint: jest.fn()
|
||||
},
|
||||
export: {
|
||||
withOptions: jest.fn(),
|
||||
spreadsheet: jest.fn()
|
||||
},
|
||||
batch: {
|
||||
convert: jest.fn(),
|
||||
selectFolder: jest.fn()
|
||||
},
|
||||
converter: {
|
||||
convert: jest.fn(),
|
||||
convertBatch: jest.fn()
|
||||
},
|
||||
headerFooter: {
|
||||
getSettings: jest.fn(),
|
||||
saveSettings: jest.fn(),
|
||||
browseLogo: jest.fn(),
|
||||
saveLogo: jest.fn(),
|
||||
clearLogo: jest.fn()
|
||||
},
|
||||
page: {
|
||||
getSettings: jest.fn(),
|
||||
updateSettings: jest.fn(),
|
||||
setCustomStartPage: jest.fn()
|
||||
},
|
||||
pdf: {
|
||||
processOperation: jest.fn(),
|
||||
getPageCount: jest.fn(),
|
||||
selectFolder: jest.fn()
|
||||
}
|
||||
};
|
||||
|
||||
// Mock marked library
|
||||
global.window.marked = {
|
||||
parse: jest.fn((text) => `<p>${text}</p>`),
|
||||
setOptions: jest.fn()
|
||||
};
|
||||
|
||||
// Mock DOMPurify
|
||||
global.window.DOMPurify = {
|
||||
sanitize: jest.fn((html) => html)
|
||||
};
|
||||
|
||||
// Mock highlight.js
|
||||
global.window.hljs = {
|
||||
highlight: jest.fn((code, options) => ({ value: code })),
|
||||
highlightAuto: jest.fn((code) => ({ value: code })),
|
||||
getLanguage: jest.fn(() => true)
|
||||
};
|
||||
|
||||
// Mock localStorage
|
||||
const localStorageMock = {
|
||||
getItem: jest.fn(),
|
||||
setItem: jest.fn(),
|
||||
removeItem: jest.fn(),
|
||||
clear: jest.fn()
|
||||
};
|
||||
global.localStorage = localStorageMock;
|
||||
|
||||
// Console spy to catch unintended console logs in tests
|
||||
const originalConsoleError = console.error;
|
||||
console.error = (...args) => {
|
||||
// Allow certain expected errors
|
||||
const message = args[0]?.toString() || '';
|
||||
if (message.includes('Warning:') || message.includes('React')) {
|
||||
return;
|
||||
}
|
||||
originalConsoleError.apply(console, args);
|
||||
};
|
||||
|
||||
// Cleanup after each test
|
||||
afterEach(() => {
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
+137
-137
@@ -1,137 +1,137 @@
|
||||
/**
|
||||
* Tests for Utility Functions
|
||||
* Tests helper functions that can be extracted and tested
|
||||
*/
|
||||
|
||||
describe('Utility Functions', () => {
|
||||
describe('parseCommand', () => {
|
||||
// This function parses command strings into command and args
|
||||
function parseCommand(cmdString) {
|
||||
const parts = [];
|
||||
let current = '';
|
||||
let inQuotes = false;
|
||||
let quoteChar = '';
|
||||
|
||||
for (let i = 0; i < cmdString.length; i++) {
|
||||
const char = cmdString[i];
|
||||
if ((char === '"' || char === "'") && !inQuotes) {
|
||||
inQuotes = true;
|
||||
quoteChar = char;
|
||||
} else if (char === quoteChar && inQuotes) {
|
||||
inQuotes = false;
|
||||
quoteChar = '';
|
||||
} else if (char === ' ' && !inQuotes) {
|
||||
if (current) {
|
||||
parts.push(current);
|
||||
current = '';
|
||||
}
|
||||
} else {
|
||||
current += char;
|
||||
}
|
||||
}
|
||||
if (current) {
|
||||
parts.push(current);
|
||||
}
|
||||
|
||||
return {
|
||||
command: parts[0],
|
||||
args: parts.slice(1)
|
||||
};
|
||||
}
|
||||
|
||||
test('should parse simple command', () => {
|
||||
const result = parseCommand('pandoc input.md -o output.pdf');
|
||||
expect(result.command).toBe('pandoc');
|
||||
expect(result.args).toEqual(['input.md', '-o', 'output.pdf']);
|
||||
});
|
||||
|
||||
test('should handle double-quoted paths', () => {
|
||||
const result = parseCommand('pandoc "C:/path with spaces/file.md" -o output.pdf');
|
||||
expect(result.command).toBe('pandoc');
|
||||
expect(result.args).toEqual(['C:/path with spaces/file.md', '-o', 'output.pdf']);
|
||||
});
|
||||
|
||||
test('should handle single-quoted paths', () => {
|
||||
const result = parseCommand("pandoc 'file name.md' -o output.pdf");
|
||||
expect(result.command).toBe('pandoc');
|
||||
expect(result.args).toEqual(['file name.md', '-o', 'output.pdf']);
|
||||
});
|
||||
|
||||
test('should handle multiple options', () => {
|
||||
const result = parseCommand('pandoc input.md --pdf-engine=xelatex -V geometry:margin=1in -o output.pdf');
|
||||
expect(result.command).toBe('pandoc');
|
||||
expect(result.args).toContain('--pdf-engine=xelatex');
|
||||
expect(result.args).toContain('-V');
|
||||
});
|
||||
|
||||
test('should handle empty command', () => {
|
||||
const result = parseCommand('');
|
||||
expect(result.command).toBeUndefined();
|
||||
expect(result.args).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('hexToRgb', () => {
|
||||
// This function converts hex colors to RGB
|
||||
function hexToRgb(hex) {
|
||||
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
||||
return result ? {
|
||||
r: parseInt(result[1], 16) / 255,
|
||||
g: parseInt(result[2], 16) / 255,
|
||||
b: parseInt(result[3], 16) / 255
|
||||
} : null;
|
||||
}
|
||||
|
||||
test('should convert black hex to RGB', () => {
|
||||
const result = hexToRgb('#000000');
|
||||
expect(result).toEqual({ r: 0, g: 0, b: 0 });
|
||||
});
|
||||
|
||||
test('should convert white hex to RGB', () => {
|
||||
const result = hexToRgb('#ffffff');
|
||||
expect(result).toEqual({ r: 1, g: 1, b: 1 });
|
||||
});
|
||||
|
||||
test('should convert red hex to RGB', () => {
|
||||
const result = hexToRgb('#ff0000');
|
||||
expect(result.r).toBeCloseTo(1);
|
||||
expect(result.g).toBeCloseTo(0);
|
||||
expect(result.b).toBeCloseTo(0);
|
||||
});
|
||||
|
||||
test('should handle hex without hash', () => {
|
||||
const result = hexToRgb('00ff00');
|
||||
expect(result.r).toBeCloseTo(0);
|
||||
expect(result.g).toBeCloseTo(1);
|
||||
expect(result.b).toBeCloseTo(0);
|
||||
});
|
||||
|
||||
test('should return null for invalid hex', () => {
|
||||
expect(hexToRgb('invalid')).toBeNull();
|
||||
expect(hexToRgb('#xyz')).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe('File Path Utilities', () => {
|
||||
test('should extract file extension', () => {
|
||||
const getExtension = (filepath) => {
|
||||
const match = filepath.match(/\.([^/.]+)$/);
|
||||
return match ? match[1].toLowerCase() : '';
|
||||
};
|
||||
|
||||
expect(getExtension('file.md')).toBe('md');
|
||||
expect(getExtension('document.PDF')).toBe('pdf');
|
||||
expect(getExtension('path/to/file.docx')).toBe('docx');
|
||||
expect(getExtension('noextension')).toBe('');
|
||||
});
|
||||
|
||||
test('should replace file extension', () => {
|
||||
const replaceExtension = (filepath, newExt) => {
|
||||
return filepath.replace(/\.[^/.]+$/, `.${newExt}`);
|
||||
};
|
||||
|
||||
expect(replaceExtension('file.md', 'pdf')).toBe('file.pdf');
|
||||
expect(replaceExtension('path/to/doc.docx', 'html')).toBe('path/to/doc.html');
|
||||
});
|
||||
});
|
||||
});
|
||||
/**
|
||||
* Tests for Utility Functions
|
||||
* Tests helper functions that can be extracted and tested
|
||||
*/
|
||||
|
||||
describe('Utility Functions', () => {
|
||||
describe('parseCommand', () => {
|
||||
// This function parses command strings into command and args
|
||||
function parseCommand(cmdString) {
|
||||
const parts = [];
|
||||
let current = '';
|
||||
let inQuotes = false;
|
||||
let quoteChar = '';
|
||||
|
||||
for (let i = 0; i < cmdString.length; i++) {
|
||||
const char = cmdString[i];
|
||||
if ((char === '"' || char === "'") && !inQuotes) {
|
||||
inQuotes = true;
|
||||
quoteChar = char;
|
||||
} else if (char === quoteChar && inQuotes) {
|
||||
inQuotes = false;
|
||||
quoteChar = '';
|
||||
} else if (char === ' ' && !inQuotes) {
|
||||
if (current) {
|
||||
parts.push(current);
|
||||
current = '';
|
||||
}
|
||||
} else {
|
||||
current += char;
|
||||
}
|
||||
}
|
||||
if (current) {
|
||||
parts.push(current);
|
||||
}
|
||||
|
||||
return {
|
||||
command: parts[0],
|
||||
args: parts.slice(1)
|
||||
};
|
||||
}
|
||||
|
||||
test('should parse simple command', () => {
|
||||
const result = parseCommand('pandoc input.md -o output.pdf');
|
||||
expect(result.command).toBe('pandoc');
|
||||
expect(result.args).toEqual(['input.md', '-o', 'output.pdf']);
|
||||
});
|
||||
|
||||
test('should handle double-quoted paths', () => {
|
||||
const result = parseCommand('pandoc "C:/path with spaces/file.md" -o output.pdf');
|
||||
expect(result.command).toBe('pandoc');
|
||||
expect(result.args).toEqual(['C:/path with spaces/file.md', '-o', 'output.pdf']);
|
||||
});
|
||||
|
||||
test('should handle single-quoted paths', () => {
|
||||
const result = parseCommand("pandoc 'file name.md' -o output.pdf");
|
||||
expect(result.command).toBe('pandoc');
|
||||
expect(result.args).toEqual(['file name.md', '-o', 'output.pdf']);
|
||||
});
|
||||
|
||||
test('should handle multiple options', () => {
|
||||
const result = parseCommand('pandoc input.md --pdf-engine=xelatex -V geometry:margin=1in -o output.pdf');
|
||||
expect(result.command).toBe('pandoc');
|
||||
expect(result.args).toContain('--pdf-engine=xelatex');
|
||||
expect(result.args).toContain('-V');
|
||||
});
|
||||
|
||||
test('should handle empty command', () => {
|
||||
const result = parseCommand('');
|
||||
expect(result.command).toBeUndefined();
|
||||
expect(result.args).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('hexToRgb', () => {
|
||||
// This function converts hex colors to RGB
|
||||
function hexToRgb(hex) {
|
||||
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
||||
return result ? {
|
||||
r: parseInt(result[1], 16) / 255,
|
||||
g: parseInt(result[2], 16) / 255,
|
||||
b: parseInt(result[3], 16) / 255
|
||||
} : null;
|
||||
}
|
||||
|
||||
test('should convert black hex to RGB', () => {
|
||||
const result = hexToRgb('#000000');
|
||||
expect(result).toEqual({ r: 0, g: 0, b: 0 });
|
||||
});
|
||||
|
||||
test('should convert white hex to RGB', () => {
|
||||
const result = hexToRgb('#ffffff');
|
||||
expect(result).toEqual({ r: 1, g: 1, b: 1 });
|
||||
});
|
||||
|
||||
test('should convert red hex to RGB', () => {
|
||||
const result = hexToRgb('#ff0000');
|
||||
expect(result.r).toBeCloseTo(1);
|
||||
expect(result.g).toBeCloseTo(0);
|
||||
expect(result.b).toBeCloseTo(0);
|
||||
});
|
||||
|
||||
test('should handle hex without hash', () => {
|
||||
const result = hexToRgb('00ff00');
|
||||
expect(result.r).toBeCloseTo(0);
|
||||
expect(result.g).toBeCloseTo(1);
|
||||
expect(result.b).toBeCloseTo(0);
|
||||
});
|
||||
|
||||
test('should return null for invalid hex', () => {
|
||||
expect(hexToRgb('invalid')).toBeNull();
|
||||
expect(hexToRgb('#xyz')).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe('File Path Utilities', () => {
|
||||
test('should extract file extension', () => {
|
||||
const getExtension = (filepath) => {
|
||||
const match = filepath.match(/\.([^/.]+)$/);
|
||||
return match ? match[1].toLowerCase() : '';
|
||||
};
|
||||
|
||||
expect(getExtension('file.md')).toBe('md');
|
||||
expect(getExtension('document.PDF')).toBe('pdf');
|
||||
expect(getExtension('path/to/file.docx')).toBe('docx');
|
||||
expect(getExtension('noextension')).toBe('');
|
||||
});
|
||||
|
||||
test('should replace file extension', () => {
|
||||
const replaceExtension = (filepath, newExt) => {
|
||||
return filepath.replace(/\.[^/.]+$/, `.${newExt}`);
|
||||
};
|
||||
|
||||
expect(replaceExtension('file.md', 'pdf')).toBe('file.pdf');
|
||||
expect(replaceExtension('path/to/doc.docx', 'html')).toBe('path/to/doc.html');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user