Skip to content

Add skipIfExists and crash-safe failure logging for large conversions#190

Open
mavgit1 wants to merge 1 commit into
theohbrothers:masterfrom
mavgit1:feature/resume-and-skip-existing
Open

Add skipIfExists and crash-safe failure logging for large conversions#190
mavgit1 wants to merge 1 commit into
theohbrothers:masterfrom
mavgit1:feature/resume-and-skip-existing

Conversation

@mavgit1

@mavgit1 mavgit1 commented Jun 3, 2026

Copy link
Copy Markdown

Summary

Re-running large notebooks (5k+ pages) after a crash is way too slow. Even with 'usedocx=2', the script still pings the OneNote API for every single page and forces a .docx to Markdown conversion via Pandoc, even if the final .md file is already sitting there completed.

This PR fixes that by checking 'skipIfExists' first, completely bypassing the OneNote API call and the Pandoc conversion loop if the output file exists. On my 5,719-page notebook, this cut the resume time by about 95%.

Also, instead of letting a single corrupt page crash the entire run, the script now gracefully logs or ignores the error and moves to the next note.

Also added:

  • A 'conversion-failures.jsonl' log to track broken pages.
  • Updated docs in the README and config file.

Test plan

  • Pester tests pass locally
  • Tested on a 5,719-page notebook with skipIfExists=2

Defer OneNote page content fetch until after skip checks so re-runs can resume without RPC during config build. Add optional jsonl failure export and document resume workflow with skipIfExists.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant