Skip to main content

Openai Document

@dougschaefer/openai-documentv2026.05.27.2· 7d agoMODELS
01README

OpenAI-powered document and webpage generation — analyze and enhance .pptx/.docx, design PDFs from natural language, compose decks from outlines using your own theme template, and generate self-contained HTML/CSS pages from reference designs via vision. Vault-based API key, headless Chromium for rendering.

02Models1
@dougschaefer/openai-documentv2026.05.27.2openai-document/document.ts
fn analyze(filePath: string, outputName: string)
Parse a .pptx or .docx file and return its structure, sections, and text content.
ArgumentTypeDescription
filePathstringAbsolute path to the .pptx or .docx file
outputNamestring
fn design(instructions: string, contentSource?: string, context?: string, outputName: string)
Design a professional document as PDF. GPT generates complete HTML with inline CSS based on your design instructions and content, then headless Chromium renders it to a pixel-perfect PDF. Supports designing from scratch, from a content description, or from an existing .docx file's extracted content.
ArgumentTypeDescription
instructionsstringDesign and content direction — describe the visual style, layout, colors, and what content to include. E.g., 'Modern proposal for Snap Inc, Kentucky blue and white color scheme, clean layout with geometric accents, two-column sections where appropriate. Cover page with large color block and company name.'
contentSource?stringOptional: absolute path to a .docx file to extract content from. The design method will pull the text and restructure it into the new design. If omitted, GPT generates content based on instructions alone.
context?stringAdditional context — company info, client details, scope data, brand guidelines, etc.
outputNamestring
fn enhance(filePath: string, instructions: string, model: enum, outputName: string)
Enhance or modify text content of a .pptx or .docx using GPT, preserving formatting and design.
ArgumentTypeDescription
filePathstringAbsolute path to the .pptx or .docx file
instructionsstringWhat to change in the text content
modelenum
outputNamestring
fn generate(templatePath: string, instructions: string, context?: string, model: enum, outputName: string)
Generate a new document from a .docx/.pptx template by populating placeholders with GPT-generated content.
ArgumentTypeDescription
templatePathstringAbsolute path to the template .pptx or .docx file
instructionsstringWhat content to generate
context?stringAdditional context
modelenum
outputNamestring
fn compose(outline: string, templatePath: string, tone?: string, audience?: string, additionalInstructions?: string, includeSpeakerNotes: boolean, outputName: string)
Expand a text outline into a fully-populated .pptx using your supplied template as the visual theme. The template's existing slides act as layout placeholders — compose generates per-slide title, body bullets, and speaker notes via OpenAI structured output, then replaces the template's text in place. No third-party deck generator required.
ArgumentTypeDescription
outlinestringOutline, brief, or source notes that compose will expand into slide content.
templatePathstringAbsolute path to the .pptx template. Each slide in the template becomes one card; pre-trim or duplicate slides in the template to control the final card count.
tone?stringVoice/tone (e.g., 'executive briefing', 'technical deep dive', 'sales pitch').
audience?stringWho's reading the deck (e.g., 'CIO and IT directors', 'AV trade press').
additionalInstructions?stringExtra direction — what to emphasize, what to avoid, brand voice notes.
includeSpeakerNotesbooleanGenerate speaker notes for each slide (written into ppt/notesSlidesN.xml when present).
outputNamestring
fn webpageDesign(brief: string, references: array, styleNotes?: string, responsive: boolean, renderPreview: boolean, outputName: string)
Generate a self-contained responsive HTML/CSS webpage that mimics the visual language of one or more reference designs (image files or URLs). GPT vision analyzes layout, typography, color, and motifs from the references, then produces a single HTML file populated with your supplied content. Optionally renders a PNG/PDF preview via headless Chromium.
ArgumentTypeDescription
briefstringWhat the page is for and the content/copy it should contain. Include headings, body copy, and any required sections.
referencesarrayReference design images — local file paths (.png/.jpg/.webp/.gif) or http(s) URLs. The model uses these for visual cues only; copy must come from the brief.
styleNotes?stringExtra style direction — brand color overrides, fonts to prefer, accessibility requirements, etc.
responsivebooleanInclude mobile-first responsive layout with media queries.
renderPreviewbooleanIf true, render the HTML to a PNG screenshot (and PDF) via headless Chromium.
outputNamestring

Resources

analysis(infinite)— Parsed document structure and content
document(infinite)— Designed, generated, or enhanced document file
03Previous Versions6
2026.05.27.1May 27, 2026

Security: genericized hardcoded host paths (now via SWAMP_OUTPUT_COPY_DIR env), README example paths, and standardized LICENSE. No functional change.

2026.05.26.2May 26, 2026

Replace jszip@3.10.1 with fflate@0.8.3 for .docx/.pptx read/modify/rezip. Clears the non-allowlisted dual-license and stale-dependency warnings; fflate is MIT and actively maintained. Behavior-preserving (OOXML round-trip validated on real files); zip backend moved to a sibling _ooxml.ts adapter.

2026.05.26.1May 26, 2026

Align model version fields with manifest (2026.05.26.1); republish under swamp 20260526 conventions

2026.05.13.1May 13, 2026

Add JSDoc to model entrypoints for rubric v2 symbols-docs

Fix JSDoc so symbols-docs factor passes — wrap type name in backticks so it isn't parsed as a JSDoc tag. Also bumps openai-document to v2026.05.13.1 (was staged at 2026.04.29.1, never published).

Modified 1 models. updated labels

2026.04.27.2Apr 27, 2026

Add curated README and LICENSE to tarball (additionalFiles), bringing extension's Swamp Club quality grade from F/B to A-/B.

2026.04.27.1Apr 27, 2026

Initial release. Four methods: analyze (parse .pptx/.docx structure), enhance (rewrite text preserving formatting), generate (populate templates with GPT content), design (generate pixel-perfect PDFs from natural-language instructions via headless Chromium).

04Stats
A
100 / 100
Downloads
7
Archive size
44.0 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository2/2earned
05Platforms
06Labels