Doc Generator
An automated operation and maintenance document construction system that supports combining and outputting Markdown document modules into Word or PDF format to customize documents for different customers/projects.
- ** Modular document **: Split the operation and maintenance document into independent modules (architecture, daily operation and maintenance, fault handling, etc.) - ** Multi-customer support **: Configure unique document combinations and metadata for different customers - ** Automated construction **: Generate Word or PDF documents with one click through the Web interface - **PDF output **: Support PDF format output, including code highlighting, cover, catalog and other professional typesetting - **Web interface **: Provides a visual interface, which can be generated by selecting customer and document type Note: The application has a built-in template for testing. In fact, it can be modified accordingly according to the user manual. PDF examples can be used for pdf output testing. Please use word output testing for the rest. ### Step 1: Start it for the first time The following directories are automatically initialized when the app is first launched: - `/app/src` -Document source file (Markdown format) - `/app/clients` -customer configuration directory - `/app/templates` - Word Template Directory - `/app/build` -Output directory The initialization process takes about 10-30 seconds, please wait patiently. ### Step 2: Access the Web interface Open a browser to access the application Web interface features: - Select customer and document type - Select output format (Word/PDF) - Generate and download documents with one click - Create a new customer configuration ### Step 3: Add custom documents 1. ** Add a document module **: Put the Markdown file into the `src/` directory 2. ** Create customer configuration **: Create a customer folder in the `clients/` directory and add configuration files 3. ** Configuration metadata **: Modify `metadata.yaml` to set customer information ### Step 4: Download the generated document The generated documents are saved in the `build/` directory and can be downloaded directly through the Web interface. --- ##Directory structure ``` /app/ ├── src/ #Document source file (Markdown) │ ├── metadata.yaml #Global metadata │ ├── images/ #Picture Resources │ 丨 ── 01-Overview.md │ 丨 ── 02-System Architecture.md │ └── ... ├── clients/ #Customer Configuration │ ├── default/ #Default Configuration │ ── Standard Document/ #Customize customers │ ├── metadata.yaml #Customer metadata (covering global) │ 丨 ── Operation and maintenance manual.yaml #Document Type Configuration │ └── ... ├── templates/ # Word Template │ └── default.docx └── build/ #Output directory --- ##Detailed description of the folder ###`src/` -Document source file directory Store all document modules in Markdown format. ** Document requirements: ** - File format: `.md` (Markdown) - Naming convention: Use digit prefixes such as `01-` and `02-` to control sorting - Code: UTF-8 - Image quote: use relative path `images/xxx.png` ** Directory structure: ** ``` src/ ├── metadata.yaml # [Required] Global metadata (title, author, version, etc.) ├── images/ # [Optional] Picture Resource Directory │ └── logo.png 丨 ── 01-Overview.md #Document Module 丨 ── 02-System Architecture.md 丨 ── 03-Daily operation and maintenance.md └── ... ``` **metadata.yaml example: ** ```yaml --- title: "XX System Operation and Maintenance Manual" author: "Operation and maintenance team" date: "January 2026" version: "v1.0" --- ``` --- ###`clients/` -customer configuration directory Define document combinations and metadata overrides for different customers/projects. ** Directory structure: ** ``` clients/ 丨 ── Standard Document/ #Customer name (displayed in Web interface) │ ├── metadata.yaml # [Optional] Customer metadata override │ 丨 ── Operation and maintenance manual.yaml #Document Type Configuration │ 丨 ── Deployment Manual.yaml │ ── PDF example.yaml ── Other customers/ └── ... ``` ** Document type configuration file example (`Operation and Maintenance Manual.yaml`): ** ```yaml client_name: "Standard Document" template: "default.docx" #Select the document modules to include modules: - src/metadata.yaml - src/01-Overview.md - src/02-System Architecture.md - src/03-Daily operation and maintenance.md #Output file name pattern output_pattern: "{client}_{title}_{date}.docx" # PDF output options (optional) pdf_options: mainfont: "Noto Sans CJK SC" CJKmainfont: "Noto Sans CJK SC" monofont: "DejaVu Sans Mono" titlepage: true titlepage-color: "2C3E50" toc: true toc-depth: 3 ``` ** Customer metadata override (`metadata.yaml`): ** ```yaml --- title: "XX System Operation and Maintenance Manual" Subtitle: "Custom Edition" client: name: "XX Company" contact: "Zhang Gong" --- ``` --- ###`templates/` - Word template directory Store Word document templates (in.docx format). ** Document requirements: ** - Format: `.docx` (Word 2007+) - Recommendation: Use Pandoc-compatible template styles ** Usage: ** 1. Place custom templates in this directory 2. Reference in customer configuration: `template: "custom.docx"` --- ###`build/` -Output directory The generated document is saved in a location that supports downloading through the Web interface. ** Description: ** - Generated Word file: `{Customer Name}_{Document Type}_{Date}.docx` - Generated PDF file: `{Customer Name}_{Document Type}_{Date}.pdf` - Recommended mounting to persistent storage






