Skip to main content

Openai Document

@dougschaefer/openai-documentv2026.07.27.1· 1d 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.

02Release Notes

Docs: replace a real company name used as a fictional prospect in the design example with the Acme placeholder. No functional changes.

03Models1
@dougschaefer/openai-documentv2026.07.27.1openai-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, fontFiles: array, inlineLocalAssets: boolean, deckContract: boolean, pageWidth: number, pageHeight: number, 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.
fontFilesarrayLocal font files embedded as @font-face data URIs AFTER generation. The model is only told the families exist and is forbidden from writing @font-face/@import/base64 itself — font bytes must never round-trip through the model.
inlineLocalAssetsbooleanAfter generation, inline every local absolute-path image reference (img src and CSS url()) as a data URI so the HTML file is fully self-contained and portable.
deckContractbooleanTreat the output as a paginated slide deck: append hard sizing/fragmentation rules to the prompt, inject print-safety guard CSS after generation, validate referenced local assets exist, and check the rendered PDF's page count against the slide count.
pageWidthnumberDeck page width in px (used when deckContract is true).
pageHeightnumberDeck page height in px (used when deckContract is true).
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
04Previous Versions11
2026.07.20.2
2026.07.20.1

webpageDesign: fontFiles embedding, inlineLocalAssets, deckContract print guards + preflight (slide/page count, missing assets). Deterministic post-gen pipeline replaces model-side base64.

2026.06.29.1

Fix the LICENSE link target in the README.

Added 1, removed 1 models

2026.06.08.1
2026.05.27.2
2026.05.27.1

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

2026.05.26.2

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.1

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

2026.05.13.1

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.2

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

2026.04.27.1

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).

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