Toolpal

@toolpal/markdown-to-doc

public

v2.0published 1 download this weekMIT

Converts Markdown (inline or .md/.txt file) or structured JSON/sheets locally into a formatted Word (.docx), PDF (.pdf), or Excel (.xlsx) file. Supports headings, bold/italic/code, links, lists, code blocks, blockquotes, and tables. Offline, no API key needed.

manifest.json4.2 KBRaw
{
  "manifestVersion": 1,
  "name": "@toolpal/markdown-to-doc",
  "version": "1.0",
  "description": "Converts Markdown (inline or .md/.txt file) or structured JSON/sheets locally into a formatted Word (.docx), PDF (.pdf), or Excel (.xlsx) file. Supports headings, bold/italic/code, links, lists, code blocks, blockquotes, and tables. Offline, no API key needed.",
  "license": "MIT",
  "keywords": [
    "markdown",
    "docx",
    "pdf",
    "xlsx",
    "word",
    "excel",
    "convert",
    "document"
  ],
  "entry": "dist/tool.mjs",
  "sdk": "0.1.0",
  "engines": {
    "node": ">=22.15.0"
  },
  "inputSchema": {
    "type": "object",
    "required": [
      "format"
    ],
    "properties": {
      "format": {
        "anyOf": [
          {
            "type": "string",
            "const": "docx"
          },
          {
            "type": "string",
            "const": "pdf"
          },
          {
            "type": "string",
            "const": "xlsx"
          }
        ],
        "description": "Target output format: docx, pdf, or xlsx"
      },
      "markdown": {
        "type": "string",
        "maxLength": 500000,
        "description": "Markdown text to render"
      },
      "file": {
        "type": "string",
        "description": "Input .md, .txt, or .json file (alternative to inline markdown/sheets)",
        "x-toolpal-file": true
      },
      "sheets": {
        "type": "array",
        "items": {
          "type": "object",
          "required": [
            "name",
            "rows"
          ],
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 60
            },
            "columns": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "maxItems": 100
            },
            "rows": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {}
                  },
                  {
                    "type": "object",
                    "patternProperties": {
                      "^.*$": {}
                    }
                  }
                ]
              },
              "maxItems": 50000
            }
          }
        },
        "minItems": 1,
        "maxItems": 20,
        "description": "Structured worksheet data (ideal for format: xlsx, also renders as tables in docx/pdf)"
      },
      "title": {
        "type": "string",
        "maxLength": 200,
        "description": "Document title (docx/pdf)"
      },
      "subtitle": {
        "type": "string",
        "maxLength": 300,
        "description": "Subtitle, author, or date line (docx/pdf)"
      },
      "filename": {
        "type": "string",
        "maxLength": 80,
        "description": "Output filename without extension"
      },
      "pageSize": {
        "anyOf": [
          {
            "type": "string",
            "const": "letter"
          },
          {
            "type": "string",
            "const": "a4"
          }
        ],
        "description": "Page size for docx/pdf; letter by default"
      }
    }
  },
  "outputSchema": {
    "type": "object",
    "required": [
      "file",
      "format",
      "bytes"
    ],
    "properties": {
      "file": {
        "type": "string",
        "description": "Generated .docx, .pdf, or .xlsx file",
        "x-toolpal-file": true
      },
      "format": {
        "type": "string"
      },
      "bytes": {
        "type": "integer"
      },
      "pages": {
        "type": "integer",
        "description": "Page count (for PDF output)"
      },
      "sheets": {
        "type": "integer",
        "description": "Worksheet count (for XLSX output)"
      },
      "blocks": {
        "type": "integer",
        "description": "Parsed block count (for DOCX/PDF output)"
      }
    }
  },
  "permissions": {
    "net": false,
    "env": [],
    "tmp": true
  },
  "limits": {
    "timeoutMs": 30000,
    "memoryMb": 256
  },
  "build": {
    "toolpal": "0.1.0",
    "esbuild": "0.28.2",
    "options": "sha256-tMpkndD8HsDUvZadrPbEAMGGIGK7nvmTGxMMlUxy9Fo="
  }
}