mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 18:10:18 +05:30
feat: add document templates library with 10 templates
This commit is contained in:
+11
@@ -3880,6 +3880,17 @@ ipcMain.on('open-table-generator', () => {
|
||||
openTableGenerator();
|
||||
});
|
||||
|
||||
// IPC Handler for loading document templates
|
||||
ipcMain.handle('load-template', async (event, filename) => {
|
||||
try {
|
||||
const templatePath = path.join(__dirname, 'templates', filename);
|
||||
return fs.readFileSync(templatePath, 'utf-8');
|
||||
} catch (err) {
|
||||
console.error('Failed to load template:', err);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
// IPC Handler for saving pasted/dropped images
|
||||
ipcMain.handle('save-pasted-image', async (event, { base64, ext }) => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user