Skip to content

Commit 2ef2b03

Browse files
committed
feat(RenderLog): Show render progress log for syncing and publishing.
1 parent 5a41ba2 commit 2ef2b03

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/exporter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export const publishFiles = async (
100100
success: true,
101101
}
102102
}
103-
await HTMLGenerator.beginBatch(allFiles);
103+
// await HTMLGenerator.beginBatch(allFiles);
104104
RenderLog.progress(0, allFiles.length, "Exporting Docs", "...", "var(--color-accent)");
105105
let externalFiles: Downloadable[] = [];
106106
let toUploads: any[] = [];

src/main.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ import { SizesConflictModal } from "./syncSizesConflictNotice";
5959
import { publishFiles, unpublishFile } from './exporter'
6060
import { AssetHandler } from './html-generation/asset-handler';
6161
import { Path } from './utils/path';
62+
import { HTMLGenerator } from './html-generation/html-generator';
63+
import { RenderLog } from './html-generation/render-log';
6264
import icon, { UsingIconNames, getIconSvg, addIconForconflictFile } from './utils/icon';
6365
const { iconNameSyncWait, iconNameSyncPending, iconNameSyncRunning, iconNameLogs, iconNameSyncLogo } = UsingIconNames;
6466

@@ -311,6 +313,10 @@ export default class InvioPlugin extends Plugin {
311313
return;
312314
}
313315

316+
let allFiles = this.app.vault.getMarkdownFiles();
317+
await HTMLGenerator.beginBatch(allFiles);
318+
RenderLog.progress(1, 6, "Syncing Docs", "...", "var(--color-accent)");
319+
314320
// The operations above are almost read only and kind of safe.
315321
// The operations below begins to write or delete (!!!) something.
316322
await insertSyncPlanRecordByVault(this.db, plan, this.vaultRandomID);
@@ -352,6 +358,7 @@ export default class InvioPlugin extends Plugin {
352358
self.setCurrSyncMsg(i, totalCount, pathName, decision);
353359

354360
log.info('syncing ', pathName, decision);
361+
RenderLog.progress(i, totalCount, "Syncing Docs", "Syncing: " + pathName, "var(--color-accent)");
355362
if (touchedFileMap?.pathName) {
356363
touchedFileMap.pathName.syncStatus = 'syncing';
357364
}
@@ -393,7 +400,7 @@ export default class InvioPlugin extends Plugin {
393400

394401
const basePath = new Path(this.settings.localWatchDir);
395402
// get files to export
396-
let allFiles = this.app.vault.getMarkdownFiles();
403+
// let allFiles = this.app.vault.getMarkdownFiles();
397404
// if we are at the root path export all files, otherwise only export files in the folder we are exporting
398405
allFiles = allFiles.filter((file: TFile) => new Path(file.path).directory.asString.startsWith(basePath.asString) && (file.extension === "md") && (!file.name.endsWith('.conflict.md')));
399406
await publishFiles(client, this.app.vault, pubPathList, allFiles, '', this.settings, triggerSource, (pathName: string, status: string) => {

0 commit comments

Comments
 (0)