AI Skill Report Card

Converting Documents to Webpages

A-84·Aug 29, 2026·Source: Web
YAML
--- name: converting-documents-to-webpages description: Converts PDFs, Word docs, and PowerPoint presentations into styled HTML webpages while preserving original text, images, fonts, colors, and layout. Use when a source document (PDF/DOCX/PPTX) needs to become a faithful, browsable webpage that retains its visual identity and theme. ---
14 / 15

Given Notes.pdf, produce notes.html + assets/ folder:

  1. Open the document and extract raw text, images, and style metadata (fonts, colors, spacing).
  2. Save extracted images into an assets/ folder next to the output HTML.
  3. Build an HTML file that mirrors the document's structure (headings, paragraphs, image placement) and embeds/links the extracted images.
  4. Derive a CSS theme (color palette, font stack) from the document and apply it via a <style> block or linked stylesheet.
  5. Open the HTML in a browser and visually diff it against the original document.
HTML
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Notes</title> <style> body { font-family: 'Calibri', sans-serif; color: #222222; background: #ffffff; } h1 { color: #1F4E79; font-family: 'Georgia', serif; } img { max-width: 100%; height: auto; display: block; margin: 1em 0; } .content { max-width: 800px; margin: 0 auto; padding: 2em; } </style> </head> <body> <div class="content"> <h1>Section Title</h1> <p>Extracted paragraph text...</p> <img src="assets/image1.png" alt="Extracted graph"> </div> </body> </html>
Recommendation
Add guidance on tooling/libraries (e.g., pdf.js, python-docx, mammoth, pptx parsers) for scriptable extraction rather than leaving it abstract
14 / 15

Progress:

  • Step 1: Open source document and identify structural sections (title, headings, body, captions)
  • Step 2: Extract all embedded media (images, charts, graphs) into an assets/ folder with descriptive filenames
  • Step 3: Identify styling — fonts used, heading/body colors, background colors, accent colors
  • Step 4: Extract text content in reading order, preserving paragraph breaks and emphasis (bold/italic)
  • Step 5: Map document structure to semantic HTML (h1-h6, p, ul/ol, table, figure/figcaption)
  • Step 6: Build a CSS theme file from extracted fonts/colors (define as CSS variables for reuse)
  • Step 7: Assemble the HTML, embedding images with correct relative paths and alt text
  • Step 8: Preview in browser and compare against the original page-by-page
  • Step 9: Fix layout mismatches (spacing, image sizing, font fallbacks for missing web fonts)

Extraction details

  • Images: extract at original resolution; don't screenshot pages. Name files by content/order (fig1-chart.png) not generic names.
  • Fonts: if the document uses a non-web-safe font, map it to the closest Google Font or system font stack and note the substitution.
  • Colors: sample heading color, body text color, background, and any accent/highlight colors. Store as CSS custom properties:
    CSS
    :root { --color-primary: #1F4E79; --color-text: #222222; --color-bg: #ffffff; --font-heading: 'Georgia', serif; --font-body: 'Calibri', sans-serif; }
  • Layout: multi-column PPT slides become flex/grid sections; single-column docs become a centered max-width container.
Recommendation
Include a concrete before/after diff example showing actual extracted text vs final HTML output to strengthen example quality
16 / 20

Example 1: Input: report.docx with a blue-themed title page, two charts, and body text in Calibri. Output: report.html + assets/chart1.png, assets/chart2.png with :root CSS variables --color-primary: #2E5AAC, --font-body: 'Calibri', sans-serif, headings styled with the primary color, charts embedded as <figure> elements with captions.

Example 2: Input: pitch.pptx, 10 slides, dark background theme with white text and a logo on every slide. Output: One HTML page with 10 <section class="slide"> blocks (or 10 linked HTML files), each inheriting --color-bg: #121212; --color-text: #ffffff;, logo extracted once to assets/logo.png and reused via CSS background-image or <img> in a shared header/footer.

Recommendation
Address edge cases like tables with merged cells, embedded fonts requiring licensing checks, or scanned/image-only PDFs requiring OCR
  • Preserve reading order, not just visual position — screen readers and text selection depend on it.
  • Use semantic HTML (h1-h6, figure, blockquote, table) instead of generic div/span for everything; it keeps structure faithful and improves accessibility.
  • Extract theme colors/fonts into CSS variables once, then reference them everywhere — makes later theme tweaks a one-line change.
  • Compress extracted images (PNG for graphics/screenshots, JPEG for photos) to keep page weight reasonable.
  • Always add alt text to images, generated from captions or nearby text if available.
  • Keep a consistent naming convention for assets (page1-img1.png) so large documents stay organized.
  • For multi-page documents, decide upfront: one long scrolling HTML page, or multiple linked pages (mirrors PPT slides well; mirrors long reports poorly).
  • Don't screenshot entire pages as images — this destroys text selectability, SEO, and accessibility.
  • Don't hardcode pixel-perfect absolute positioning copied from a PDF; it breaks on different screen sizes. Use flow-based layout (flex/grid) that approximates the original design.
  • Don't skip font-fallback stacks — if the original font isn't web-safe or licensed for web embedding, always specify a fallback.
  • Don't leave images unoptimized (multi-MB PNGs) — this makes the resulting webpage slow.
  • Don't flatten headings into styled <p> tags — this breaks document outline/SEO/accessibility.
  • Don't rely purely on manual copy-paste for large documents — for anything beyond a few pages, use a scriptable extraction approach (e.g., a PDF/DOCX parsing library) to avoid missed content and manual errors.
0
Grade A-AI Skill Framework
Scorecard
Criteria Breakdown
Quick Start
14/15
Workflow
14/15
Examples
16/20
Completeness
17/20
Format
14/15
Conciseness
13/15