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…
от dmccreary★ 115 звёзд на GitHub
Установить docx-to-web-publisher в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
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
.docxfile 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.tsxroute) - 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.tsxthat 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:
# 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:
// 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:
{
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">— thenot-proseprevents Tailwind prose from mangling table styles. Always add explicit text colors for dark mode contrast. - Callout boxes: Use colored
divwith border, background, and label (see template for investor/technical/info callout patterns) - Stats grids:
not-prose grid grid-cols-2 md:grid-cols-4for hero metric blocks - Table headers: Always include
text-neutral-900 dark:text-whitefor contrast - Table row names: Add
font-medium text-neutral-900 dark:text-whiteto the first column - Alternating rows:
bg-neutral-50 dark:bg-neutral-800/30on even rows - HTML entities: Use
—,–,×,'etc. — never raw special characters in JSX
**Common cont
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- assets/template-content-component.tsx
- assets/template-content-registry.ts
- assets/template-cover.svg
- scripts/extract_docx.py
FAQ
Что делает скилл 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.
Как установить скилл docx-to-web-publisher?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл docx-to-web-publisher запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
AnthropicUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
xlsx
AnthropicUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
pptx
AnthropicUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…