Docx To Web Publisher logo

Docx To Web Publisher

Community
dmccreary
docx-to-web-publisher

Converts .docx files (papers, briefs, reports) into styled React component pages in a Next.js content-catalog site. Use when publishing a Word document as a structured web page.

Overview

Publisherdmccreary
Repositoryibook-skills
Skill namedocx-to-web-publisher
Stars
109
Forks
21
Bundled files
4
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by dmccreary on GitHub. Read the source before you install it.

Installation

Install the Docx To Web Publisher AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/dmccreary/ibook-skills/tree/main/skills/docx-to-web-publisher
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dmccreary/ibook-skills.git /tmp/ibook-skills
mkdir -p .claude/skills
cp -r /tmp/ibook-skills/skills/docx-to-web-publisher .claude/skills/docx-to-web-publisher
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Docx To Web Publisher in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Docx To Web Publisher on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Docx To Web Publisher is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

docx-to-web Publisher

Version: 1.0

Convert a .docx document into a fully structured, styled web page within a Next.js site that uses a content catalog pattern (product array, detail page route, optional knowledge graph).

When to use

  • User has a .docx file and wants it published on their Next.js site
  • User says "publish this paper/brief/report" and there's a .docx involved
  • User wants to add a research document to a content library or wisdom library
  • Converting any structured Word document to a web-rendered page

Prerequisites

  • Next.js App Router project with a content catalog pattern (a TypeScript data array + dynamic [slug]/page.tsx route)
  • ImageMagick (convert/magick) for cover image generation (optional)
  • Python 3 for .docx extraction if pandoc isn't available

Workflow

Step 1: Audit the site's content architecture

Before touching the document, understand how the site organizes content. Find and read:

  • Data catalog file — the TypeScript array of content items (e.g., src/data/products.ts, src/data/wisdomProducts.ts). Note the interface fields: slug, title, description, author, format, tags, etc.
  • Detail page — the [slug]/page.tsx that renders individual items. Note what components it uses and how it handles different content formats.
  • Listing page — the page that lists all items. Check for format icon maps (Record<Format, Icon>) that need updating.
  • Knowledge graph (if present) — tag aliases and taxonomy mappings.
  • Format types — the union type for content formats. You may need to add a new format (e.g., 'research').

Step 2: Extract content from the .docx

Use the approach that's available:

bash
# Option A: pandoc (best if installed)
pandoc document.docx -t markdown -o content.md

# Option B: Python XML extraction (always available)
python3 -c "
import xml.etree.ElementTree as ET, zipfile, sys
# Extract text with style markers from document.xml
..."

If using the docx skill's unpack script, that works too. The goal is to get the full text with structural markers (heading levels, list items, table boundaries).

Read the extracted content carefully. Identify:

  • Title and subtitle
  • Section headings (H1, H2, H3)
  • Data tables (columns, rows, header rows)
  • Bullet/numbered lists
  • Callout boxes or highlighted sections (investor implications, key findings)
  • Author attribution and date
  • Statistics or key metrics that could become a hero section

Step 3: Add format type and catalog entry

If the site's format union type doesn't include a suitable format for research/report content, add one:

typescript
// In the ProductFormat or ContentFormat type
export type ProductFormat = '...' | 'research';

// In FORMAT_LABELS
research: 'Research Brief',

Then add the content item to the data catalog array:

typescript
{
  slug: 'kebab-case-title',
  title: 'Full Document Title',
  description: '1-2 sentence teaser summarizing the document.',
  longDescription: [
    'Summary paragraph 1 — the challenge or situation.',
    'Summary paragraph 2 — the resolution or key finding.',
    'Summary paragraph 3 — scope of what the full document covers.',
  ],
  author: {
    name: 'Author Name',
    profileHref: '/experts/author-slug',  // if expert profiles exist
  },
  format: 'research',
  coverImage: '/path/to/cover.png',
  tags: ['Tag1', 'Tag2', 'Tag3'],  // choose 5-8 relevant tags
  featured: true,
  createdAt: 'YYYY-MM-DD',
}

Update ALL files that use Record<Format, ...> — search the codebase for the format type name. Every icon map, label map, etc. must include the new format. Missing one causes a TypeScript build error.

Step 4: Create the rich content component

Create a new file for the full document content. Location pattern: src/content/{collection}/{slug}.tsx

This is the core of the skill. Convert the extracted document structure into a React server component with proper Tailwind styling:

Component template: See assets/template-content-component.tsx

Key patterns to follow:

  • Wrapper: <article className="prose prose-neutral dark:prose-invert max-w-none">
  • Tables: Wrap in <div className="not-prose overflow-x-auto mb-8 text-neutral-700 dark:text-neutral-200"> — the not-prose prevents Tailwind prose from mangling table styles. Always add explicit text colors for dark mode contrast.
  • Callout boxes: Use colored div with border, background, and label (see template for investor/technical/info callout patterns)
  • Stats grids: not-prose grid grid-cols-2 md:grid-cols-4 for hero metric blocks
  • Table headers: Always include text-neutral-900 dark:text-white for contrast
  • Table row names: Add font-medium text-neutral-900 dark:text-white to the first column
  • Alternating rows: bg-neutral-50 dark:bg-neutral-800/30 on even rows
  • HTML entities: Use &mdash;, &ndash;, &times;, &apos; etc. — never raw special characters in JSX

Common contrast mistakes to avoid:

  • Tables inside not-prose lose inherited text color — always set it explicitly
  • Dark mode backgrounds need lighter text — dark:text-neutral-200 minimum
  • Header cells need dark:text-white to stand out from body cells
  • Green/emerald metric values: use text-emerald-700 dark:text-emerald-400

Step 5: Create the content registry

Create an index file that maps slugs to content components: src/content/{collection}/index.ts

typescript
import type { ComponentType } from 'react'

type ContentModule = { default: ComponentType }

const contentRegistry: Record<string, () => Promise<ContentModule>> = {
  'my-slug': () => import('./my-slug'),
}

export function hasRichContent(slug: string): boolean {
  return slug in contentRegistry
}

export async function getRichContent(slug: string): Promise<ComponentType | null> {
  const loader = contentRegistry[slug]
  if (!loader) return null
  const mod = await loader()
  return mod.default
}

If the registry already exists, just add a new entry.

Step 6: Extend the detail page

Modify the [slug]/page.tsx to:

  1. Import getRichContent from the content registry
  2. Make the page component async (if not already)
  3. Call const RichContent = await getRichContent(params.slug)
  4. Render {RichContent && <div className="mb-8 border-t ..."><RichContent /></div>} after the summary section
  5. Add the new format's icon to any formatIcons record

Step 7: Update the knowledge graph (if present)

If the site has a knowledge graph generator:

  1. Add TAG_ALIASES for new concept tags (lowercase → display name)
  2. Add TAXONOMY entries mapping concepts to categories with colors
  3. Existing tags that already have aliases/taxonomy entries don't need changes

The document's tags will automatically create new nodes and co-occurrence edges in the graph at the next build.

Step 8: Generate a cover image

Create an SVG with the document's title, author, key metrics, and branding, then convert to PNG:

bash
# Create SVG (see assets/template-cover.svg for the pattern)
# Convert with ImageMagick
magick cover.svg -resize 800x600 public/path/to/cover.png

If ImageMagick isn't available, create a simple placeholder or ask the user to provide one.

Step 9: Build and verify

bash
npm run build  # must pass clean — TypeScript errors = missing format entries

Check:

  • Detail page renders with full structure
  • Listing page shows the new item
  • Knowledge graph (if present) shows new concepts
  • Dark mode contrast is readable on all tables and callouts

Step 10: Commit and push

Stage all changed files and commit with a descriptive message.

Troubleshooting

IssueCauseFix
Property 'research' is missing in typeA Record<ProductFormat, ...> wasn't updatedSearch for all Record<ProductFormat and add the new format
Tables unreadable in dark modenot-prose strips inherited text colorAdd text-neutral-700 dark:text-neutral-200 to table wrapper div
Build fails on page componentawait used in non-async componentAdd async to the page function signature
Cover image not foundWrong path or missing fileVerify path matches coverImage field in catalog entry
Tags not appearing in graphMissing TAG_ALIASES entryAdd lowercase tag → display name mapping

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Docx To Web Publisher AI skill do?

Converts .docx files (papers, briefs, reports) into styled React component pages in a Next.js content-catalog site. Use when publishing a Word document as a structured web page.

Why use Docx To Web Publisher on TypingMind?

Because you install it once and use it with any model. Docx To Web Publisher is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Docx To Web Publisher in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/dmccreary/ibook-skills/tree/main/skills/docx-to-web-publisher. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Docx To Web Publisher?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Docx To Web Publisher?

As many as you like. As long as a model supports skills, you can use Docx To Web Publisher with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Docx To Web Publisher AI skill free?

It is published on GitHub by dmccreary. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇