How to Write in Markdown but Deliver in Word. A Senior Architect's Workflow.

How to Write in Markdown but Deliver in Word. A Senior Architect's Workflow.

Source: Dev.to

The Conflict: Engineering vs. Management ## The Tool: Pandoc with Reference Docs ## The Workflow ## Tutorial: Setup Your Factory ## Step 1: Install Pandoc ## Step 2: Create the "Reference Dog" (The Template) ## Step 3: Write in Markdown ## Step 4: The Build Command ## Why This is a Career Hack There is a fundamental conflict in corporate IT: As a Senior Architect, I refuse to spend my "Deep Work" hours fighting with Microsoft Word margins or table alignments. But I also know that sending a raw .md file to a stakeholder is unprofessional. The solution is not to surrender to Word. The solution is to compile to Word. Pandoc is a command-line tool that converts text formats. But its "killer feature" for corporate environments is the --reference-doc flag. This feature allows you to map your plain Markdown text onto a strictly formatted corporate Word template. Here is how I set up a "Documentation Factory" in 5 minutes. macOS: brew install pandoc Windows: choco install pandoc This is the most important step. You don't create styles in Pandoc. You "steal" them from a Word doc. Open your IDE (VS Code / IntelliJ). Write your specs using standard Markdown. Run this simple command in your terminal: What just happened? Pandoc took your text from input.md and "poured" it into the styles defined in reference.docx. Work smart, not hard. Let the CLI handle the formatting. Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse COMMAND_BLOCK: # Architectural Decision Record 001 ## Context We need to migrate the Monolith to AWS. ## Decision We will use AWS Lambda and Spring Boot SnapStart. ## Consequences * Cost reduction by 40% * Cold starts handled by SnapStart Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: # Architectural Decision Record 001 ## Context We need to migrate the Monolith to AWS. ## Decision We will use AWS Lambda and Spring Boot SnapStart. ## Consequences * Cost reduction by 40% * Cold starts handled by SnapStart COMMAND_BLOCK: # Architectural Decision Record 001 ## Context We need to migrate the Monolith to AWS. ## Decision We will use AWS Lambda and Spring Boot SnapStart. ## Consequences * Cost reduction by 40% * Cold starts handled by SnapStart CODE_BLOCK: pandoc input.md -o Final_Report.docx --reference-doc=reference.docx Enter fullscreen mode Exit fullscreen mode CODE_BLOCK: pandoc input.md -o Final_Report.docx --reference-doc=reference.docx CODE_BLOCK: pandoc input.md -o Final_Report.docx --reference-doc=reference.docx - Engineers want to write documentation like code (Markdown, in IDE, versioned in Git). - Management/Clients want "professional" documents (Word, neatly formatted, with logos). - Take an existing, well-formatted document from your company (one with the correct headers, fonts, and footer logo). - Delete all the content, leaving just one dummy header and one paragraph. - Save it as reference.docx. - Your # Header 1 became the company's official blue, size 16 font. - Your lists are perfectly indented. - The company logo is already in the header/footer. - Speed: You write 3x faster in Markdown than in Word. - Version Control: You can track changes in Git. Try doing a "Code Review" on a binary .docx file—it's impossible. With this method, you review the Markdown, merge it, and generate the Word doc as a build artifact. - Professionalism: You deliver documents that look exactly like the business expects, without ever opening Office 365.