mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-03 02:11:07 +05:30
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d5e552741 | ||
|
|
58314efc7a |
@@ -138,6 +138,8 @@ npm run dist:all
|
|||||||
|
|
||||||
## Version History
|
## Version History
|
||||||
|
|
||||||
|
- **v1.8.0** - Added enhanced Word export with template support to batch converter
|
||||||
|
- **v1.7.9** - Enhanced Word Export with Template Support: Template-based DOCX generation with custom templates, table styling, ASCII art support, and red-colored flowchart arrows
|
||||||
- **v1.5.6** - (Your release notes here)
|
- **v1.5.6** - (Your release notes here)
|
||||||
- **v1.5.5** - Refactored PDF export, simplified Pandoc pathing, and removed XLSX dependency.
|
- **v1.5.5** - Refactored PDF export, simplified Pandoc pathing, and removed XLSX dependency.
|
||||||
- **v1.3.1** - Bug fixes: Fixed file associations for double-clicking .md files, corrected 50/50 layout alignment for editor/preview panes
|
- **v1.3.1** - Bug fixes: Fixed file associations for double-clicking .md files, corrected 50/50 layout alignment for editor/preview panes
|
||||||
|
|||||||
+2
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "pan-converter",
|
"name": "pan-converter",
|
||||||
"version": "1.7.9",
|
"version": "1.8.1",
|
||||||
"description": "Cross-platform Markdown editor and converter using Pandoc",
|
"description": "Cross-platform Markdown editor and converter using Pandoc",
|
||||||
"main": "src/main.js",
|
"main": "src/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -31,6 +31,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"codemirror": "^6.0.2",
|
"codemirror": "^6.0.2",
|
||||||
|
"core-util-is": "^1.0.3",
|
||||||
"docx": "^9.5.1",
|
"docx": "^9.5.1",
|
||||||
"docx4js": "^3.3.0",
|
"docx4js": "^3.3.0",
|
||||||
"dompurify": "^3.2.6",
|
"dompurify": "^3.2.6",
|
||||||
|
|||||||
+3
-2
@@ -516,6 +516,7 @@
|
|||||||
<option value="html">HTML</option>
|
<option value="html">HTML</option>
|
||||||
<option value="pdf">PDF</option>
|
<option value="pdf">PDF</option>
|
||||||
<option value="docx">DOCX</option>
|
<option value="docx">DOCX</option>
|
||||||
|
<option value="docx-enhanced">DOCX (Enhanced)</option>
|
||||||
<option value="latex">LaTeX</option>
|
<option value="latex">LaTeX</option>
|
||||||
<option value="rtf">RTF</option>
|
<option value="rtf">RTF</option>
|
||||||
<option value="odt">ODT</option>
|
<option value="odt">ODT</option>
|
||||||
@@ -555,12 +556,12 @@
|
|||||||
|
|
||||||
<!-- PDF Editor Dialog -->
|
<!-- PDF Editor Dialog -->
|
||||||
<div id="pdf-editor-dialog" class="export-dialog hidden">
|
<div id="pdf-editor-dialog" class="export-dialog hidden">
|
||||||
<div class="export-dialog-content">
|
<div class="export-dialog-content pdf-editor-content">
|
||||||
<div class="export-dialog-header">
|
<div class="export-dialog-header">
|
||||||
<h3 id="pdf-editor-title">PDF Editor</h3>
|
<h3 id="pdf-editor-title">PDF Editor</h3>
|
||||||
<button id="pdf-editor-dialog-close" title="Close">×</button>
|
<button id="pdf-editor-dialog-close" title="Close">×</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="export-dialog-body">
|
<div class="export-dialog-body pdf-editor-body">
|
||||||
<!-- Merge PDFs Section -->
|
<!-- Merge PDFs Section -->
|
||||||
<div id="pdf-merge-section" class="pdf-operation-section hidden">
|
<div id="pdf-merge-section" class="pdf-operation-section hidden">
|
||||||
<div class="export-section">
|
<div class="export-section">
|
||||||
|
|||||||
+39
-4
@@ -475,7 +475,7 @@ function createMenu() {
|
|||||||
type: 'info',
|
type: 'info',
|
||||||
title: 'About PanConverter',
|
title: 'About PanConverter',
|
||||||
message: 'PanConverter',
|
message: 'PanConverter',
|
||||||
detail: 'A cross-platform Markdown editor and converter using Pandoc.\n\nVersion: 1.7.9\nAuthor: Amit Haridas\nEmail: amit.wh@gmail.com\nLicense: MIT\n\nFeatures:\n• Modern glassmorphism UI with gradient backgrounds\n• Comprehensive PDF Editor (merge, split, compress, rotate, watermark, encrypt)\n• Universal File Converter (LibreOffice, ImageMagick, FFmpeg, Pandoc)\n• Windows Explorer context menu integration\n• Tabbed interface for multiple files\n• Advanced markdown editing with live preview\n• Real-time preview updates while typing\n• Full toolbar markdown editing functions\n• Enhanced PDF export with built-in Electron fallback\n• File association support for .md files\n• Command-line interface for batch conversion\n• Advanced export options with templates and metadata\n• Batch file conversion with progress tracking\n• Improved preview typography and spacing\n• Adjustable font sizes via menu (Ctrl+Shift+Plus/Minus)\n• Complete theme support including Monokai fixes\n• Find & replace with match highlighting\n• Line numbers and auto-indentation\n• Export to multiple formats via Pandoc\n• PowerPoint & presentation export\n• Export tables to Excel/ODS spreadsheets\n• Document import & conversion\n• Table creation helper\n• 22 beautiful themes (including Dracula, Nord, Tokyo Night, Gruvbox, Ayu, Concrete, and more)\n• Undo/redo functionality\n• Live word count and statistics',
|
detail: 'A cross-platform Markdown editor and converter using Pandoc.\n\nVersion: 1.8.1\nAuthor: Amit Haridas\nEmail: amit.wh@gmail.com\nLicense: MIT\n\nFeatures:\n• Modern glassmorphism UI with gradient backgrounds\n• Streamlined PDF Editor UI (merge, split, compress, rotate, watermark, encrypt)\n• Universal File Converter (LibreOffice, ImageMagick, FFmpeg, Pandoc)\n• Windows Explorer context menu integration\n• Tabbed interface for multiple files\n• Advanced markdown editing with live preview\n• Real-time preview updates while typing\n• Full toolbar markdown editing functions\n• Enhanced PDF export with built-in Electron fallback\n• Enhanced Word export with template support (single file & batch)\n• File association support for .md files\n• Command-line interface for batch conversion\n• Advanced export options with templates and metadata\n• Batch file conversion with progress tracking\n• Improved preview typography and spacing\n• Adjustable font sizes via menu (Ctrl+Shift+Plus/Minus)\n• Complete theme support including Monokai fixes\n• Find & replace with match highlighting\n• Line numbers and auto-indentation\n• Export to multiple formats via Pandoc\n• PowerPoint & presentation export\n• Export tables to Excel/ODS spreadsheets\n• Document import & conversion\n• Table creation helper\n• 22 beautiful themes (including Dracula, Nord, Tokyo Night, Gruvbox, Ayu, Concrete, and more)\n• Undo/redo functionality\n• Live word count and statistics',
|
||||||
buttons: ['OK']
|
buttons: ['OK']
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1432,7 +1432,7 @@ function performBatchConversion(inputFolder, outputFolder, format, options) {
|
|||||||
const totalCount = markdownFiles.length;
|
const totalCount = markdownFiles.length;
|
||||||
|
|
||||||
// Process each file
|
// Process each file
|
||||||
const processNextFile = (index) => {
|
const processNextFile = async (index) => {
|
||||||
if (index >= markdownFiles.length) {
|
if (index >= markdownFiles.length) {
|
||||||
// All files processed
|
// All files processed
|
||||||
dialog.showMessageBox(mainWindow, {
|
dialog.showMessageBox(mainWindow, {
|
||||||
@@ -1447,7 +1447,8 @@ function performBatchConversion(inputFolder, outputFolder, format, options) {
|
|||||||
const inputFile = markdownFiles[index];
|
const inputFile = markdownFiles[index];
|
||||||
const relativePath = path.relative(inputFolder, inputFile);
|
const relativePath = path.relative(inputFolder, inputFile);
|
||||||
const baseName = path.basename(relativePath, path.extname(relativePath));
|
const baseName = path.basename(relativePath, path.extname(relativePath));
|
||||||
const outputFile = path.join(outputFolder, relativePath.replace(/\.(md|markdown)$/i, `.${format}`));
|
const outputExtension = format === 'docx-enhanced' ? 'docx' : format;
|
||||||
|
const outputFile = path.join(outputFolder, relativePath.replace(/\.(md|markdown)$/i, `.${outputExtension}`));
|
||||||
|
|
||||||
// Create subdirectories in output folder if needed
|
// Create subdirectories in output folder if needed
|
||||||
const outputDir = path.dirname(outputFile);
|
const outputDir = path.dirname(outputFile);
|
||||||
@@ -1455,7 +1456,41 @@ function performBatchConversion(inputFolder, outputFolder, format, options) {
|
|||||||
fs.mkdirSync(outputDir, { recursive: true });
|
fs.mkdirSync(outputDir, { recursive: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build pandoc command
|
// Handle DOCX Enhanced format with WordTemplateExporter
|
||||||
|
if (format === 'docx-enhanced') {
|
||||||
|
try {
|
||||||
|
const content = fs.readFileSync(inputFile, 'utf-8');
|
||||||
|
const exporter = new WordTemplateExporter(wordTemplatePath);
|
||||||
|
await exporter.convert(content, outputFile);
|
||||||
|
|
||||||
|
completedCount++;
|
||||||
|
|
||||||
|
// Update progress
|
||||||
|
mainWindow.webContents.send('batch-progress', {
|
||||||
|
completed: index + 1,
|
||||||
|
total: totalCount,
|
||||||
|
currentFile: path.basename(inputFile),
|
||||||
|
success: true
|
||||||
|
});
|
||||||
|
|
||||||
|
// Process next file
|
||||||
|
processNextFile(index + 1);
|
||||||
|
} catch (error) {
|
||||||
|
// Update progress with error
|
||||||
|
mainWindow.webContents.send('batch-progress', {
|
||||||
|
completed: index + 1,
|
||||||
|
total: totalCount,
|
||||||
|
currentFile: path.basename(inputFile),
|
||||||
|
success: false
|
||||||
|
});
|
||||||
|
|
||||||
|
// Process next file even if this one failed
|
||||||
|
processNextFile(index + 1);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build pandoc command for other formats
|
||||||
let pandocCmd = `${getPandocPath()} "${inputFile}" -o "${outputFile}"`;
|
let pandocCmd = `${getPandocPath()} "${inputFile}" -o "${outputFile}"`;
|
||||||
|
|
||||||
// Add template if specified
|
// Add template if specified
|
||||||
|
|||||||
+111
@@ -1098,6 +1098,117 @@ body.theme-dark #add-metadata-field {
|
|||||||
color: #f0f0f0;
|
color: #f0f0f0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* PDF Editor Specific Styles */
|
||||||
|
.pdf-editor-content {
|
||||||
|
max-width: 600px !important;
|
||||||
|
max-height: 85vh;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pdf-editor-body {
|
||||||
|
min-height: 200px;
|
||||||
|
max-height: calc(85vh - 150px);
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pdf-operation-section {
|
||||||
|
animation: fadeIn 0.3s ease-in;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fadeIn {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(-10px);
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.pdf-operation-section.hidden {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Make PDF Editor sections more compact */
|
||||||
|
.pdf-operation-section .export-section {
|
||||||
|
margin-bottom: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pdf-operation-section .export-section:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* File list styling for merge operation */
|
||||||
|
.file-list {
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 10px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
min-height: 100px;
|
||||||
|
max-height: 200px;
|
||||||
|
overflow-y: auto;
|
||||||
|
background: #fafafa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-entry {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 8px;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
background: white;
|
||||||
|
border: 1px solid #e0e0e0;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-entry:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-name {
|
||||||
|
flex: 1;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
margin-right: 10px;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.remove-file {
|
||||||
|
padding: 4px 10px;
|
||||||
|
background: #dc3545;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.remove-file:hover {
|
||||||
|
background: #c82333;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Theme support for PDF Editor */
|
||||||
|
body.theme-dark .file-list {
|
||||||
|
background: #1a1a1a;
|
||||||
|
border-color: #555;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.theme-dark .file-entry {
|
||||||
|
background: #2d2d2d;
|
||||||
|
border-color: #444;
|
||||||
|
color: #f0f0f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.theme-dark .pdf-editor-content {
|
||||||
|
background: #2d2d2d;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.theme-dark .pdf-editor-body {
|
||||||
|
background: #2d2d2d;
|
||||||
|
}
|
||||||
|
|
||||||
body.theme-dark .form-row button:hover,
|
body.theme-dark .form-row button:hover,
|
||||||
body.theme-dark #add-metadata-field:hover {
|
body.theme-dark #add-metadata-field:hover {
|
||||||
background: #333;
|
background: #333;
|
||||||
|
|||||||
Reference in New Issue
Block a user