document-generator

acornsoft 的头像作者 acornsoft

将Markdown文档转换为专业、品牌化的格式(包括PPTX、DOCX、PPT、DOC、PDF、HTML)及处理Mermaid图表的专业技能。当需要从Markdown生成品牌化客户文档时使用。

📖 中文导读:将Markdown文档转换为专业、品牌化的格式(包括PPTX、DOCX、PPT、DOC、PDF、HTML)及处理Mermaid图表的专业技能。当需要从Markdown生成品牌化客户文档时使用。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

name: document-generator description: Specialized skill for converting Markdown documents into professional, branded formats includingPPTX, DOCX, PPT, DOC, PDF, HTML and processing Mermaid diagrams. Use this when asked to generate branded client documents from Markdown.

Document Generator Skill

Overview

The Document Generator is a specialized skill for converting Markdown documents into professional, branded formats including DOCX, PDF, HTML, and processing Mermaid diagrams. It leverages PowerShell scripting and Custom Office Templates to produce client-ready deliverables.

Purpose

  • Convert Markdown to multiple formats (DOCX, PDF, HTML)
  • Apply client/partner branding via templates
  • Process Mermaid diagrams into images
  • Generate final-form documents for sharing

Scope

  • Input: Markdown files with optional Mermaid diagrams
  • Output: Branded documents in requested formats
  • Templates: Custom Office Templates for branding
  • Integration: PowerShell-based conversion with Pandoc

Key Features

  1. Multi-Format Conversion: PPTX, DOCX, PPT, DOC, PDF, HTML outputs
  2. Mermaid Processing: Automatic diagram-to-image conversion
  3. Template Support: Client/partner-specific branding
  4. Resource Management: Image and resource path handling
  5. TOC Generation: Optional table of contents

Inputs

  • Markdown file path
  • Output formats (array)
  • Partner/Client for template selection
  • Resource path for images
  • Optional: TOC depth, title

Outputs

  • Generated documents in specified formats
  • Processed images/diagrams
  • Success/failure status

Process Flow

  1. Validate input Markdown file
  2. Select appropriate template (client > partner priority)
  3. Process Mermaid diagrams if present
  4. Convert using Pandoc with template
  5. Handle resource paths and images
  6. Generate output files

Template Management

  • Defaults: Templates stored in $env:USERPROFILE\Documents\Custom Office Templates (user profile)
  • Priority: Client templates > Partner templates > Defaults
  • Override: Use -TemplateDir parameter for custom locations (e.g., shared dreamcatcher templates)
  • Augmentation: Clients can add subfolders (e.g., ecolab/template.docx) to override defaults

Usage

Invoke during Implement phase to create branded client documents. Output folder is automatically determined: uses ~/project-root/docs/Analysis/outputs if it exists, otherwise the input file's directory.

Example:

.\Convert-Document.ps1 -InputFile 'report.md' -Formats 'docx','pdf' -Client 'ecolab' -IncludeToc

Or specify custom output:

.\Convert-Document.ps1 -InputFile 'report.md' -Formats 'docx','pdf' -OutputFolder 'custom' -Client 'ecolab' -IncludeToc

Dependencies

  • Pandoc installed
  • PowerShell execution
  • Custom Office Templates directory
  • Mermaid CLI (optional for diagram processing)