mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 18:10:18 +05:30
Release v1.2.0: Major feature additions
- Add PowerPoint export (PPTX/ODP) with slide-level formatting - Add comprehensive document conversion menu with import/export - Add interactive table creation helper in markdown editor - Update documentation with all new features and version history - Improve menu organization for better user experience 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
# Pan Converter
|
||||
# PanConverter
|
||||
|
||||
## Overview
|
||||
Pan Converter is a cross-platform desktop application for editing and converting Markdown files using Pandoc. It features a rich markdown editor with live preview, multiple themes, and support for exporting to various formats.
|
||||
PanConverter is a cross-platform desktop application for editing and converting Markdown files using Pandoc. It features a rich markdown editor with live preview, multiple themes, and comprehensive support for exporting to various document formats.
|
||||
|
||||
## Features
|
||||
- **Markdown Editor**: Full-featured editor with syntax highlighting
|
||||
- **Markdown Editor**: Full-featured editor with syntax highlighting and toolbar
|
||||
- **Live Preview**: Real-time preview of your markdown content
|
||||
- **Multiple Themes**: Light, Dark, Solarized, Monokai, and GitHub themes
|
||||
- **Format Conversion**: Export to HTML, PDF, DOCX, LaTeX, RTF, ODT, and EPUB using Pandoc
|
||||
- **Document Export**: Export to HTML, PDF, DOCX, LaTeX, RTF, ODT, EPUB, PowerPoint (PPTX), and OpenDocument Presentation (ODP)
|
||||
- **Spreadsheet Export**: Export markdown tables to Excel (XLSX/XLS) and OpenDocument Spreadsheet (ODS) formats
|
||||
- **Document Import & Conversion**: Import various document formats and convert between formats via Pandoc
|
||||
- **Table Creation Helper**: Built-in table generator for easy markdown table creation
|
||||
- **Cross-Platform**: Runs on Windows, macOS, and Linux
|
||||
- **Auto-Save**: Automatic saving every 30 seconds
|
||||
|
||||
@@ -102,8 +105,9 @@ pan-converter/
|
||||
- **marked**: Markdown parsing
|
||||
- **highlight.js**: Syntax highlighting
|
||||
- **DOMPurify**: HTML sanitization
|
||||
- **electron-store**: Persistent storage
|
||||
- **XLSX**: Spreadsheet generation for Excel/ODS export
|
||||
- **electron-builder**: Application packaging
|
||||
- **Custom Storage**: File-based storage system for settings persistence
|
||||
|
||||
## Features Implementation
|
||||
|
||||
@@ -126,11 +130,27 @@ pan-converter/
|
||||
- Five built-in themes
|
||||
|
||||
### Export System
|
||||
- Uses Pandoc command-line tool
|
||||
- Supports multiple output formats
|
||||
- Uses Pandoc command-line tool for document exports
|
||||
- Supports multiple output formats (HTML, PDF, DOCX, LaTeX, RTF, ODT, EPUB, PPTX, ODP)
|
||||
- Spreadsheet export using XLSX library for table data
|
||||
- Import functionality for converting documents to markdown
|
||||
- Maintains original file structure
|
||||
- Shows error messages if Pandoc not installed
|
||||
|
||||
### Table Creation Helper
|
||||
- Interactive table generator in toolbar
|
||||
- Prompts for row and column count
|
||||
- Generates properly formatted markdown tables
|
||||
- Includes headers and separator rows
|
||||
- Automatically inserts at cursor position
|
||||
|
||||
### Document Conversion Menu
|
||||
- Separate Convert menu for cross-format operations
|
||||
- Import documents from various formats to markdown
|
||||
- Convert current file to different formats
|
||||
- Supports presentations with proper slide-level formatting
|
||||
- Error handling for missing Pandoc installation
|
||||
|
||||
## Platform-Specific Branches
|
||||
|
||||
The repository maintains separate branches for platform-specific customizations:
|
||||
@@ -156,11 +176,13 @@ The generated `.deb` file will:
|
||||
|
||||
### Manual Testing
|
||||
1. File Operations: New, Open, Save, Save As
|
||||
2. Editor Features: Bold, Italic, Headings, Links, Code, Lists, Quotes
|
||||
2. Editor Features: Bold, Italic, Headings, Links, Code, Lists, Quotes, Table Creation
|
||||
3. Preview Toggle: Show/hide preview pane
|
||||
4. Theme Switching: Test all five themes
|
||||
5. Export Functions: Test each export format
|
||||
6. Auto-save: Verify 30-second auto-save works
|
||||
5. Export Functions: Test each export format including PowerPoint and spreadsheets
|
||||
6. Import/Conversion: Test document import and format conversion
|
||||
7. Table Helper: Test table generation with different row/column counts
|
||||
8. Auto-save: Verify 30-second auto-save works
|
||||
|
||||
### Platform Testing
|
||||
Test on:
|
||||
@@ -170,8 +192,15 @@ Test on:
|
||||
|
||||
## Known Issues
|
||||
- ICO and ICNS icons need manual conversion from PNG
|
||||
- Pandoc must be installed separately
|
||||
- Pandoc must be installed separately for all export functionality
|
||||
- Large files may cause performance issues
|
||||
- AppImage requires --no-sandbox flag on some systems
|
||||
- Windows/Mac builds require platform-specific build environments
|
||||
|
||||
## Version History
|
||||
- **v1.2.0**: Added PowerPoint export, document conversion menu, table creation helper, spreadsheet export
|
||||
- **v1.1.0**: Added Excel/ODS spreadsheet export, updated author information, renamed to PanConverter
|
||||
- **v1.0.0**: Initial release with basic markdown editing, themes, and Pandoc export
|
||||
|
||||
## Future Enhancements
|
||||
- [ ] Add spell checking
|
||||
@@ -181,6 +210,7 @@ Test on:
|
||||
- [ ] Plugin system for custom exporters
|
||||
- [ ] Cloud sync capabilities
|
||||
- [ ] Collaborative editing
|
||||
- [ ] Improved table editing interface
|
||||
|
||||
## License
|
||||
MIT License
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pan-converter",
|
||||
"version": "1.1.0",
|
||||
"version": "1.2.0",
|
||||
"description": "Cross-platform Markdown editor and converter using Pandoc",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -59,6 +59,15 @@
|
||||
<path d="M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z"></path>
|
||||
</svg>
|
||||
</button>
|
||||
<button id="btn-table" title="Insert Table">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
|
||||
<line x1="3" y1="9" x2="21" y2="9"></line>
|
||||
<line x1="3" y1="15" x2="21" y2="15"></line>
|
||||
<line x1="9" y1="3" x2="9" y2="21"></line>
|
||||
<line x1="15" y1="3" x2="15" y2="21"></line>
|
||||
</svg>
|
||||
</button>
|
||||
<div class="toolbar-separator"></div>
|
||||
<button id="btn-preview-toggle" title="Toggle Preview">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||
|
||||
+101
@@ -87,6 +87,9 @@ function createMenu() {
|
||||
{ label: 'ODT', click: () => exportFile('odt') },
|
||||
{ label: 'EPUB', click: () => exportFile('epub') },
|
||||
{ type: 'separator' },
|
||||
{ label: 'PowerPoint (PPTX)', click: () => exportFile('pptx') },
|
||||
{ label: 'OpenDocument Presentation (ODP)', click: () => exportFile('odp') },
|
||||
{ type: 'separator' },
|
||||
{ label: 'Excel (XLSX)', click: () => exportSpreadsheet('xlsx') },
|
||||
{ label: 'Excel Legacy (XLS)', click: () => exportSpreadsheet('xls') },
|
||||
{ label: 'OpenDocument Spreadsheet (ODS)', click: () => exportSpreadsheet('ods') }
|
||||
@@ -112,6 +115,32 @@ function createMenu() {
|
||||
{ label: 'Select All', accelerator: 'CmdOrCtrl+A', role: 'selectAll' }
|
||||
]
|
||||
},
|
||||
{
|
||||
label: 'Convert',
|
||||
submenu: [
|
||||
{
|
||||
label: 'Import Document...',
|
||||
accelerator: 'CmdOrCtrl+I',
|
||||
click: importDocument
|
||||
},
|
||||
{ type: 'separator' },
|
||||
{
|
||||
label: 'Convert Current File',
|
||||
submenu: [
|
||||
{ label: 'To Markdown', click: () => convertToFormat('md') },
|
||||
{ label: 'To HTML', click: () => convertToFormat('html') },
|
||||
{ label: 'To PDF', click: () => convertToFormat('pdf') },
|
||||
{ label: 'To DOCX', click: () => convertToFormat('docx') },
|
||||
{ label: 'To LaTeX', click: () => convertToFormat('latex') },
|
||||
{ label: 'To RTF', click: () => convertToFormat('rtf') },
|
||||
{ label: 'To ODT', click: () => convertToFormat('odt') },
|
||||
{ label: 'To EPUB', click: () => convertToFormat('epub') },
|
||||
{ label: 'To PPTX', click: () => convertToFormat('pptx') },
|
||||
{ label: 'To ODP', click: () => convertToFormat('odp') }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: 'View',
|
||||
submenu: [
|
||||
@@ -238,6 +267,78 @@ function exportSpreadsheet(format) {
|
||||
mainWindow.webContents.send('get-content-for-spreadsheet', format);
|
||||
}
|
||||
|
||||
function importDocument() {
|
||||
const files = dialog.showOpenDialogSync(mainWindow, {
|
||||
properties: ['openFile'],
|
||||
filters: [
|
||||
{ name: 'Documents', extensions: ['docx', 'odt', 'rtf', 'html', 'tex', 'epub', 'pdf'] },
|
||||
{ name: 'Presentations', extensions: ['pptx', 'odp'] },
|
||||
{ name: 'All Files', extensions: ['*'] }
|
||||
]
|
||||
});
|
||||
|
||||
if (files && files[0]) {
|
||||
const inputFile = files[0];
|
||||
const outputFile = inputFile.replace(/\.[^/.]+$/, '.md');
|
||||
|
||||
// Convert to markdown using pandoc
|
||||
const pandocCmd = `pandoc "${inputFile}" -t markdown -o "${outputFile}"`;
|
||||
|
||||
exec(pandocCmd, (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
dialog.showErrorBox('Import Error', `Failed to import: ${error.message}\n\nMake sure Pandoc is installed.`);
|
||||
} else {
|
||||
// Open the converted markdown file
|
||||
currentFile = outputFile;
|
||||
const content = fs.readFileSync(outputFile, 'utf-8');
|
||||
mainWindow.webContents.send('file-opened', { path: outputFile, content });
|
||||
|
||||
dialog.showMessageBox(mainWindow, {
|
||||
type: 'info',
|
||||
title: 'Import Complete',
|
||||
message: `Document imported successfully as ${outputFile}`,
|
||||
buttons: ['OK']
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function convertToFormat(format) {
|
||||
if (!currentFile) {
|
||||
dialog.showErrorBox('Error', 'Please save or open a file first');
|
||||
return;
|
||||
}
|
||||
|
||||
const outputFile = dialog.showSaveDialogSync(mainWindow, {
|
||||
defaultPath: currentFile.replace(/\.[^/.]+$/, `.${format}`),
|
||||
filters: [
|
||||
{ name: format.toUpperCase(), extensions: [format] }
|
||||
]
|
||||
});
|
||||
|
||||
if (outputFile) {
|
||||
// For presentations, add slide level for better conversion
|
||||
let pandocCmd = `pandoc "${currentFile}" -o "${outputFile}"`;
|
||||
if (format === 'pptx' || format === 'odp') {
|
||||
pandocCmd = `pandoc "${currentFile}" --slide-level=2 -o "${outputFile}"`;
|
||||
}
|
||||
|
||||
exec(pandocCmd, (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
dialog.showErrorBox('Conversion Error', `Failed to convert: ${error.message}\n\nMake sure Pandoc is installed.`);
|
||||
} else {
|
||||
dialog.showMessageBox(mainWindow, {
|
||||
type: 'info',
|
||||
title: 'Conversion Complete',
|
||||
message: `File converted successfully to ${outputFile}`,
|
||||
buttons: ['OK']
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function setTheme(theme) {
|
||||
store.set('theme', theme);
|
||||
mainWindow.webContents.send('theme-changed', theme);
|
||||
|
||||
@@ -60,8 +60,64 @@ document.getElementById('btn-link').addEventListener('click', () => insertMarkdo
|
||||
document.getElementById('btn-code').addEventListener('click', () => insertMarkdown('`', '`'));
|
||||
document.getElementById('btn-list').addEventListener('click', () => insertMarkdown('- ', ''));
|
||||
document.getElementById('btn-quote').addEventListener('click', () => insertMarkdown('> ', ''));
|
||||
document.getElementById('btn-table').addEventListener('click', insertTable);
|
||||
document.getElementById('btn-preview-toggle').addEventListener('click', togglePreview);
|
||||
|
||||
// Table insertion function
|
||||
function insertTable() {
|
||||
const rows = prompt('Number of rows:', '3');
|
||||
const cols = prompt('Number of columns:', '3');
|
||||
|
||||
if (!rows || !cols) return;
|
||||
|
||||
const numRows = parseInt(rows);
|
||||
const numCols = parseInt(cols);
|
||||
|
||||
if (isNaN(numRows) || isNaN(numCols) || numRows < 1 || numCols < 1) {
|
||||
alert('Please enter valid numbers for rows and columns');
|
||||
return;
|
||||
}
|
||||
|
||||
let table = '\n';
|
||||
|
||||
// Header row
|
||||
table += '|';
|
||||
for (let j = 0; j < numCols; j++) {
|
||||
table += ` Header ${j + 1} |`;
|
||||
}
|
||||
table += '\n';
|
||||
|
||||
// Separator row
|
||||
table += '|';
|
||||
for (let j = 0; j < numCols; j++) {
|
||||
table += ' --- |';
|
||||
}
|
||||
table += '\n';
|
||||
|
||||
// Data rows
|
||||
for (let i = 0; i < numRows; i++) {
|
||||
table += '|';
|
||||
for (let j = 0; j < numCols; j++) {
|
||||
table += ` Cell ${i + 1}-${j + 1} |`;
|
||||
}
|
||||
table += '\n';
|
||||
}
|
||||
table += '\n';
|
||||
|
||||
// Insert table at cursor position
|
||||
const start = editor.selectionStart;
|
||||
const end = editor.selectionEnd;
|
||||
|
||||
editor.value = editor.value.substring(0, start) + table + editor.value.substring(end);
|
||||
|
||||
// Set cursor after the table
|
||||
editor.selectionStart = editor.selectionEnd = start + table.length;
|
||||
editor.focus();
|
||||
|
||||
// Trigger input event
|
||||
editor.dispatchEvent(new Event('input'));
|
||||
}
|
||||
|
||||
// Markdown insertion helper
|
||||
function insertMarkdown(before, after) {
|
||||
const start = editor.selectionStart;
|
||||
|
||||
Reference in New Issue
Block a user