mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 11:56:01 +01:00
unified export dialog, WIP
This commit is contained in:
@@ -9,14 +9,15 @@ const repository = require("../../services/repository");
|
||||
async function exportNote(req, res) {
|
||||
// entityId maybe either noteId or branchId depending on format
|
||||
const entityId = req.params.entityId;
|
||||
const type = req.params.type;
|
||||
const format = req.params.format;
|
||||
|
||||
if (format === 'native-tar') {
|
||||
await nativeTarExportService.exportToTar(await repository.getBranch(entityId), res);
|
||||
}
|
||||
else if (format === 'markdown-tar') {
|
||||
await markdownTarExportService.exportToMarkdown(await repository.getBranch(entityId), res);
|
||||
if (type === 'tar') {
|
||||
await nativeTarExportService.exportToTar(await repository.getBranch(entityId), format, res);
|
||||
}
|
||||
// else if (format === 'tar') {
|
||||
// await markdownTarExportService.exportToMarkdown(await repository.getBranch(entityId), res);
|
||||
// }
|
||||
// export single note without subtree
|
||||
else if (format === 'markdown-single') {
|
||||
await markdownSingleExportService.exportSingleMarkdown(await repository.getNote(entityId), res);
|
||||
|
||||
Reference in New Issue
Block a user