The Story
To manage a large, multi-generational fictional universe, I needed an automated way to convert my primary writing files from Microsoft Word into a structured set of Markdown files suitable for my Obsidian vault and for web publishing. This script is the engine that powers that workflow.
Key Features
- Processes single files or entire directories of .docx files.
- Automatically creates a nested folder structure based on Heading 1, 2, and 3 styles (Book/Chapter/Part).
- Parses YAML frontmatter from the source Word document and preserves it.
- Intelligently generates 'previous' and 'next' navigation links in the frontmatter of each chapter.
- Includes robust command-line parameters for configuration (-Padding, -PurgeOutputFolder) and a full help screen.
The Script
The complete PowerShell script is displayed below, live from the project's GitHub repository.