From present-as-html
Generate a beautiful, self-contained HTML document from analysis, report, or research content. Creates polished single-file HTML with sidebar navigation, pre-rendered Mermaid diagrams (inline SVGs, no CDN dependency), fullscreen zoom, stats dashboards, styled tables, and more. Works on SharePoint, Teams, email, and offline. Use when the user wants to present findings, create a readable report, visualize an analysis, or generate an HTML version of any document. Invoked via /present-as-html:present.
npx claudepluginhub mararn1618/mararn1618-claude-marketplace --plugin present-as-htmlThis skill uses the workspace's default tool permissions.
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Builds 3-5 year financial models for startups with cohort revenue projections, cost structures, cash flow, headcount plans, burn rate, runway, and scenario analysis.
Generate beautiful, self-contained HTML documents from any content — analyses, reports, research findings, architecture overviews, evaluations. The output is a single .html file with no external dependencies that looks polished and is enjoyable to read.
/present-as-html:presentA single self-contained HTML file with these features:
@mermaid-js/mermaid-cli, and embedded directly as inline <svg> elements (see Step 2)#appGrid (grid with content area, right panel column, bottom panel row)Read template.html from this skill's directory (same directory as this SKILL.md). This template contains the complete CSS, HTML structure (sidebar, appGrid, panels, fullscreen overlay), and JavaScript. Do not modify the CSS or JavaScript — only fill in the placeholder markers.
Replace these placeholders in the template:
| Placeholder | Replace With |
|---|---|
{{DOCUMENT_TITLE}} | Document title (appears in <title> tag and sidebar <h1>) |
{{SUBTITLE}} | Short description shown under the sidebar title |
{{NAV_SECTIONS}} | Sidebar navigation links — see format below |
{{META_TAGS}} | <div class="doc-meta"> with tag spans (or remove if none) |
{{CONTENT}} | All document content: <h2>, <h3>, paragraphs, tables, diagrams, etc. |
{{DATE}} | Generation date (e.g., "February 2026") |
{{AUTHOR}} | Author or source info |
Generate sidebar links matching the <h2> headings in your content. Group them with .nav-section labels:
<div class="nav-section">OVERVIEW</div>
<a href="#executive-summary">Executive Summary</a>
<a href="#at-a-glance">At a Glance</a>
<div class="nav-section">ARCHITECTURE</div>
<a href="#system-design">System Design</a>
<a href="#data-model">Data Model</a>
<div class="nav-section">DETAILS</div>
<a href="#component-analysis">Component Analysis</a>
<a href="#integration-points">Integration Points</a>
Each href must match an id attribute on a heading inside {{CONTENT}}.
Use 3-4 tags to communicate technology, maturity, source, and scope:
<div class="doc-meta">
<span class="tag tag-blue">Python / FastAPI</span>
<span class="tag tag-green">Production</span>
<span class="tag tag-amber">Code Analysis</span>
<span class="tag tag-purple">Backend Only</span>
</div>
Use standard HTML with the component classes defined in the template. Each major section starts with an <h2 id="..."> matching the sidebar links. Use the components from the Component Reference section below to build rich content.
Before writing the HTML file, render all Mermaid diagrams to SVG and embed them directly. This ensures the document has zero JavaScript or CDN dependencies — diagrams work on SharePoint, Teams, Confluence, email, and offline.
Write a temporary config file that matches the document's color palette:
cat > /tmp/mermaid-config.json << 'EOF'
{
"theme": "base",
"themeVariables": {
"primaryColor": "#dbeafe",
"primaryTextColor": "#1e40af",
"primaryBorderColor": "#2563eb",
"lineColor": "#64748b",
"secondaryColor": "#dcfce7",
"tertiaryColor": "#f3e8ff",
"fontSize": "14px"
}
}
EOF
For each diagram you plan to include:
/tmp/diagram-0.mmd)npx -y @mermaid-js/mermaid-cli -i /tmp/diagram-0.mmd -o /tmp/diagram-0.svg -b transparent -c /tmp/mermaid-config.json --quiet
Repeat for each diagram (increment the index: diagram-1.mmd, diagram-2.mmd, etc.). These can be run in parallel since they're independent.
Note: The first run of npx @mermaid-js/mermaid-cli downloads Chromium (~200 MB). This is a one-time cost — subsequent runs use the cached binary.
When filling {{CONTENT}}, embed the rendered SVGs inside .diagram-container divs:
<div class="diagram-container">
<div class="mermaid" style="display:flex;justify-content:center;">
SVG_CONTENT_HERE
</div>
</div>
Do NOT use <pre class="mermaid"> in the final HTML. Do NOT include any Mermaid CDN <script> tags or mermaid.initialize() calls — they are not needed.
If npx is not available (no Node.js), fall back to the CDN approach:
<head>:
<script src="https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.min.js"></script>
<script>mermaid.initialize({ startOnLoad: true, theme: 'base', themeVariables: { primaryColor: '#dbeafe', primaryTextColor: '#1e40af', primaryBorderColor: '#2563eb', lineColor: '#64748b', secondaryColor: '#dcfce7', tertiaryColor: '#f3e8ff', fontSize: '14px' }});</script>
<pre class="mermaid"> blocks instead of inline SVGsRemove the temporary files:
rm -f /tmp/diagram-*.mmd /tmp/diagram-*.svg /tmp/mermaid-config.json
Write the completed HTML (template with all placeholders filled and SVGs embedded) to the output path.
Use these HTML patterns inside {{CONTENT}} to build the document.
Use for key metrics at the top of a section.
<div class="stats">
<div class="stat"><div class="num">42</div><div class="label">Total Items</div></div>
<div class="stat"><div class="num">7</div><div class="label">Categories</div></div>
<div class="stat"><div class="num">99%</div><div class="label">Coverage</div></div>
</div>
Use for key definitions, important context, or highlighted content blocks.
<div class="card card-accent">
<p>Important content with a <strong>blue accent stripe</strong> on the left.</p>
</div>
Use for key insights, important notes, or design principles.
<div class="callout">
<strong>Key insight:</strong> This is an important takeaway that should stand out.
</div>
Use inline for status indicators, categories, or labels.
<span class="tag tag-green" style="font-size:11px">Active</span>
<span class="tag tag-amber" style="font-size:11px">Pending</span>
<span class="tag tag-blue" style="font-size:11px">Info</span>
<span class="tag tag-purple" style="font-size:11px">Beta</span>
<table>
<thead><tr><th>Column 1</th><th>Column 2</th><th>Column 3</th></tr></thead>
<tbody>
<tr><td><strong>Row 1</strong></td><td>Value</td><td>Description</td></tr>
<tr><td><strong>Row 2</strong></td><td>Value</td><td>Description</td></tr>
</tbody>
</table>
Always wrap in a .diagram-container. The expand button and popover are auto-injected by the JavaScript.
Diagrams are pre-rendered to inline SVGs via Step 2. Write the Mermaid source to a .mmd temp file, render with mmdc, then embed the SVG output:
<div class="diagram-container">
<div class="mermaid" style="display:flex;justify-content:center;">
<svg><!-- rendered SVG content from mmdc --></svg>
</div>
</div>
The Mermaid source for the diagram above would be:
graph TD
A["Node A"] --> B["Node B"]
B --> C["Node C"]
style A fill:#dbeafe,stroke:#2563eb,color:#1e40af
style B fill:#dcfce7,stroke:#16a34a,color:#166534
See the Mermaid Diagram Guide section below for syntax, diagram types, and styling.
Panels are built into the template layout via #appGrid. They are not placed per-diagram — there is one right panel and one bottom panel for the entire document, and diagrams are loaded into them dynamically via the popover menu. The panel HTML is already in template.html.
Each panel contains:
.resize-handle-v for right, .resize-handle-h for bottom) — draggable to resize.panel-toolbar) with title, zoom in/out/reset, and close buttons.panel-viewport) with a .diagram-inner div for the cloned SVGWhen to use panels vs fullscreen:
Resize constraints:
| Panel | Min | Max | Default |
|---|---|---|---|
| Right | 250px width | window.innerWidth - 400 | 420px (--right-panel-width) |
| Bottom | 150px height | window.innerHeight - 200 | 320px (--bottom-panel-height) |
The expand popover is auto-generated by JavaScript for every .diagram-container. You do NOT write popover HTML manually. The JS creates an .expand-btn-wrapper with the expand button and a 3-option popover (Fullscreen, Right panel, Bottom panel).
The popover dismisses on: clicking outside, clicking an option, or pressing Escape. Only one popover can be open at a time.
Use for concluding sections — 2-column grid of icon + title + description.
<div class="summary-grid">
<div class="summary-item">
<div class="icon blue">⚙</div>
<div class="text">
<div class="title">Feature Name</div>
<div class="desc">Brief description of the feature</div>
</div>
</div>
<!-- more items... -->
</div>
Icon color classes: blue, green, amber, purple. Use HTML entities for icons (e.g., ⚙ gear, ⇅ arrows, ⚒ hammer).
Use inline to tag content with domain/category references.
<span class="scope-badge">Category 1.2</span> <strong>Item Name</strong>
Use Mermaid.js for ALL diagrams. Never use hand-drawn SVGs — they don't look good and are hard to maintain.
| Content Type | Mermaid Type | Example |
|---|---|---|
| System architecture (layers, components) | graph TB with subgraph | Architecture overview with config/runtime/comms layers |
| Pipeline / flow (left to right) | flowchart LR | Inbound processing: Fetch -> Store -> Parse -> Post |
| Process / orchestration (top to bottom) | flowchart TB with subgraph | Job scheduling, decision trees |
| Data model / entity relationships | erDiagram | Database schema with field definitions and relationships |
| Class hierarchy / inheritance tree | graph TD | Base class -> subclasses -> concrete implementations |
| Package / module structure | graph TD | Root -> subpackages/submodules |
| Sequence of interactions | sequenceDiagram | API call flows, request/response patterns |
| State machine | stateDiagram-v2 | Lifecycle states and transitions |
| Timeline / milestones | timeline | Project phases, release history |
Use a consistent color palette matching the document theme:
style NODE fill:#dbeafe,stroke:#2563eb,stroke-width:2px,color:#1e40af (blue — primary/config)
style NODE fill:#dcfce7,stroke:#16a34a,stroke-width:2px,color:#166534 (green — runtime/storage)
style NODE fill:#f3e8ff,stroke:#9333ea,stroke-width:2px,color:#6b21a8 (purple — communication/external)
style NODE fill:#fef3c7,stroke:#d97706,color:#92400e (amber — scheduling/logs)
style NODE fill:#fee2e2,stroke:#dc2626,color:#991b1b (red — critical/alerts)
style NODE fill:#f1f5f9,stroke:#94a3b8,stroke-width:1px,stroke-dasharray:5 5,color:#64748b (gray dashed — external systems)
style NODE fill:#0f172a,stroke:#0f172a,color:#fff (dark — root/factory nodes)
<b> and <i> inside node labels for emphasis: NODE["<b>Title</b><br/><i>subtitle</i>"]<br/> for multi-line labels--- for solid links, -.- for dotted links, --> for arrowssubgraph NAME["<b>Display Title</b>"] for grouped sectionsdirection LR or direction TB inside subgraphs to control layoutstring FieldName PKclassDef for reusable styles when many nodes share the same colorcode for technical identifiers (class names, table names, config keys)Use 3-4 tags at the top to quickly communicate:
These are hard-won insights from building these documents:
@mermaid-js/mermaid-cli, making the file truly zero-dependency..html file that works by double-clicking. No npm, no bundler, no server needed.#appGrid uses CSS Grid to manage the content area and panels. Grid template columns/rows are toggled via .right-open and .bottom-open classes. This is far simpler than absolute positioning..main — since the content area is now a grid child with overflow-y: auto, scroll-spy listens on .main (not window). Sidebar nav clicks also scroll .main via mainEl.scrollTo().panelState object tracks scale, tx, ty, and drag state separately for right and bottom panels. Opening a new diagram in a panel resets that panel's zoom state.template.html. Read it, fill in the placeholders, and write the output. Never regenerate the template from memory — this ensures no features are ever dropped.npx @mermaid-js/mermaid-cli fails on a specific diagram, check the Mermaid syntax in the corresponding .mmd file. Common issues: unescaped quotes in labels, invalid diagram type, mismatched brackets.npx is not available at all, the HTML falls back to CDN mode. Diagrams will work locally but not on SharePoint/Teams/email.id attributes on <h2>/<h3> elements match the href values in sidebar <a> tags.