Skip to content

zach22-1999/generic-skills / skills/zach-md-html

zach-md-html

Verified

已降级的 Markdown→HTML 兼容转换器。仅当用户明确要求“使用 zach-md-html”、或明确说“不要重组内容,只把现成 Markdown 机械转换成 HTML/套用旧主题”时使用。不要因为用户只说“输出成 HTML”“生成 HTML 报告”“把日常报告做成 HTML”“数据报告/交付报告”而触发;这些任务应由模型从原始资料直接组织并生成自包含 HTML。此 Skill 不负责数据可视化、工作面、自由设计、万物转 md、html 转 md 或 md 转 docx。

examples/output/wechat.html

View on GitHub
<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <meta name="generator" content="zach-md-html · wechat theme" />

  <title>Markdown 与 HTML 的文档流水线</title>
  <style type="text/css">

html { font-size: 17px; -webkit-text-size-adjust: 100%; }
@media (max-width: 600px) { html { font-size: 16px; } }
body {
margin: 0;
padding: 0;
background: #f8f3e7;
color: #1f1a14;
font-family: "Songti SC", "STSongti-SC-Regular", "Songti TC", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
font-feature-settings: "kern", "liga";
line-height: 1.78;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-wrap: pretty;
hanging-punctuation: first allow-end last;
}

#copy-bar {
position: sticky;
top: 0;
z-index: 100;
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px clamp(20px, 4vw, 56px);
background: rgba(248, 243, 231, 0.92);
backdrop-filter: saturate(140%) blur(12px);
-webkit-backdrop-filter: saturate(140%) blur(12px);
border-bottom: 1px solid #e2d9c5;
font-family: "PingFang SC", "Helvetica Neue", -apple-system, sans-serif;
font-size: 13px;
color: #6b6358;
}
#copy-bar .label {
letter-spacing: 0.06em;
}
#copy-btn {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 8px 16px;
background: #c25b30;
color: #fff;
border: 1px solid #a84a23;
border-radius: 4px;
font-family: "PingFang SC", "Helvetica Neue", -apple-system, sans-serif;
font-size: 13px;
font-weight: 500;
letter-spacing: 0.04em;
cursor: pointer;
transition: background 120ms ease, transform 120ms ease;
}
#copy-btn:hover { background: #a84a23; }
#copy-btn:active { transform: translateY(1px); }
#copy-btn.copied {
background: #2e6b48;
border-color: #245538;
}

.title-block,
main {
max-width: 720px;
margin: 0 auto;
padding: clamp(40px, 5vw, 64px) clamp(20px, 4vw, 56px);
}
main { padding-top: 0; }

.title-block .eyebrow {
font-family: "PingFang SC", "Helvetica Neue", -apple-system, sans-serif;
font-size: 12px;
font-weight: 600;
letter-spacing: 0.22em;
text-transform: uppercase;
color: #c25b30;
margin: 0 0 16px;
}
.title-block .eyebrow::before {
content: "— ";
color: #c25b30;
}
.title-block .title,
body > h1:first-of-type {
font-family: "Songti SC", "STSongti-SC-Regular", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
font-weight: 600;
font-size: clamp(2.0rem, 4.6vw, 3.0rem);
line-height: 1.18;
letter-spacing: -0.012em;
color: #1a1612;
margin: 0 0 12px;
text-wrap: balance;
}
.title-block .title em,
.title-block .title i {
font-style: italic;
font-weight: 500;
color: #c25b30;
}
.title-block .subtitle {
font-size: 1.05rem;
line-height: 1.65;
color: #4a4338;
margin: 14px 0 24px;
max-width: 60ch;
}
.title-block .byline {
font-family: "PingFang SC", "Helvetica Neue", -apple-system, sans-serif;
font-size: 13px;
color: #6b6358;
letter-spacing: 0.04em;
}
.title-block .date {
display: block;
margin-top: 4px;
font-style: normal;
}
.title-block {
border-bottom: 1px solid #e2d9c5;
padding-bottom: 28px;
margin-bottom: 36px;
}

article { padding: 0; }

article h2 {
font-family: "Songti SC", "STSongti-SC-Regular", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
font-weight: 600;
font-size: 1.55rem;
line-height: 1.3;
color: #1a1612;
margin: 2.4em 0 0.7em;
padding-top: 1.2em;
position: relative;
letter-spacing: -0.005em;
text-wrap: balance;
}
article h2 .h2-num {
display: inline-block;
font-family: "PingFang SC", "Helvetica Neue", -apple-system, sans-serif;
font-size: 13px;
font-weight: 500;
letter-spacing: 0.08em;
color: #c25b30;
margin-right: 12px;
vertical-align: 0.18em;
font-feature-settings: "tnum";
}
article h2:first-child { padding-top: 0; }
article h3 {
font-family: "Songti SC", "STSongti-SC-Regular", "Iowan Old Style", Georgia, serif;
font-weight: 600;
font-size: 1.25rem;
line-height: 1.32;
color: #1a1612;
margin: 1.8em 0 0.5em;
}
article h4 {
font-family: "Songti SC", "STSongti-SC-Regular", Georgia, serif;
font-style: italic;
font-weight: 500;
font-size: 1.08rem;
margin: 1.5em 0 0.4em;
color: #1a1612;
}
article p {
margin: 0 0 1.1em;
font-size: 17px;
line-height: 1.78;
color: #1f1a14;
}

article strong, article b {
font-weight: 600;
color: #1a1612;
background: linear-gradient(to bottom, transparent 62%, #f3deb6 62%);
padding: 0 1px;
}
article em, article i { font-style: italic; }
article a {
color: #8a3911;
text-decoration: underline;
text-decoration-thickness: 1px;
text-underline-offset: 3px;
text-decoration-color: #d2b89e;
}
article a:hover {
color: #5e2509;
text-decoration-color: #5e2509;
}

article blockquote {
margin: 1.8em 0;
padding: 0 0 0 18px;
border-left: 3px solid #c25b30;
color: #4a4338;
font-style: italic;
}
article blockquote p:last-child { margin-bottom: 0; }
article blockquote cite {
display: block;
margin-top: 0.6em;
font-style: normal;
font-family: "PingFang SC", "Helvetica Neue", -apple-system, sans-serif;
font-size: 13px;
color: #6b6358;
}

article ul, article ol {
padding-left: 1.5em;
margin: 0 0 1.1em;
}
article ul { list-style: none; padding-left: 0; }
article ul > li {
position: relative;
padding-left: 22px;
margin: 0.4em 0;
}
article ul > li::marker { content: ""; }

article ul > li > .bullet {
position: absolute;
left: 0;
top: 0;
color: #c25b30;
font-weight: 600;
}
article ol li {
margin: 0.4em 0;
}
article ol li::marker {
color: #c25b30;
font-weight: 600;
}

article code,
article pre {
font-family: "JetBrains Mono", "SF Mono", "Menlo", "Consolas", monospace;
}
article :not(pre) > code {
background: #f3e9d4;
color: #5e2509;
padding: 2px 6px;
border-radius: 3px;
font-size: 0.86em;
}
article pre {
margin: 1.6em 0;
padding: 16px 20px;
background: #2a2622;
color: #e9e2d0;
border-radius: 6px;
overflow-x: auto;
line-height: 1.6;
font-size: 13px;
-webkit-overflow-scrolling: touch;
}
article pre code {
background: transparent;
color: inherit;
padding: 0;
font-size: inherit;
}

article table {
width: 100%;
margin: 1.6em 0;
border-collapse: collapse;
font-size: 0.95em;
}
article thead {
border-top: 2px solid #1a1612;
border-bottom: 1px solid #1a1612;
}
article tbody tr { border-bottom: 1px solid #e2d9c5; }
article tbody tr:last-child { border-bottom: 2px solid #1a1612; }
article th, article td {
text-align: left;
padding: 10px 14px;
vertical-align: top;
}
article th {
font-family: "PingFang SC", -apple-system, sans-serif;
font-weight: 600;
font-size: 0.85em;
text-transform: uppercase;
letter-spacing: 0.04em;
color: #1a1612;
}

article figure {
margin: 1.8em 0;
}
article figure img,
article p > img,
article > img {
display: block;
max-width: 100%;
height: auto;
margin: 0 auto;
border-radius: 2px;
}
article figcaption {
margin-top: 8px;
font-size: 13px;
color: #6b6358;
text-align: center;
font-family: "PingFang SC", -apple-system, sans-serif;
font-style: italic;
}

article hr {
border: none;
height: 1px;
background: #e2d9c5;
margin: 2.6em auto;
width: 30%;
}

#TOC, nav#TOC {
margin: 0 0 2em;
padding: 16px 0;
border-top: 1px solid #e2d9c5;
border-bottom: 1px solid #e2d9c5;
font-family: "PingFang SC", -apple-system, sans-serif;
font-size: 14px;
}
#TOC > ul { list-style: none; padding: 0; margin: 0; }
#TOC ul ul { list-style: none; padding-left: 1.4em; margin: 0.2em 0; }
#TOC li { margin: 0.3em 0; }
#TOC a {
color: #4a4338;
text-decoration: none;
}
#TOC a:hover { color: #c25b30; }

a.footnote-ref, a.footnote-back {
font-size: 0.78em;
vertical-align: super;
text-decoration: none;
color: #c25b30;
}
.footnotes {
margin-top: 3em;
padding-top: 1.2em;
border-top: 1px solid #e2d9c5;
font-size: 0.92em;
color: #4a4338;
}
.footnotes ol { padding-left: 1.4em; }

::selection {
background: #f3deb6;
color: #1a1612;
}
@media print {
#copy-bar { display: none; }
body { background: white; color: black; }
article pre { background: #f4efe2; color: #2a2622; }
}

#toast {
position: fixed;
bottom: 24px;
left: 50%;
transform: translateX(-50%);
background: #1a1612;
color: #f8f3e7;
padding: 12px 20px;
border-radius: 6px;
font-family: "PingFang SC", -apple-system, sans-serif;
font-size: 14px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
opacity: 0;
pointer-events: none;
transition: opacity 200ms ease;
z-index: 200;
}
#toast.show { opacity: 1; }
</style>

</head>
<body>

  <!-- COPY BAR — sticky at top, will NOT be copied -->
  <div id="copy-bar" data-no-copy="true">
    <span class="label">公众号粘贴预览 · zach-md-html</span>
    <button id="copy-btn" type="button">
      <span id="copy-btn-text">复制到公众号</span>
    </button>
  </div>

  <header class="title-block">
    <div class="eyebrow">公众号 · Zach</div>

    <h1 class="title">Markdown 与 HTML 的文档流水线</h1>



  </header>

  <main>
    <article id="article-content">
<p>很多团队会把写作、评审、发布混在一个格式里:有人在 Word
里写,有人在网页编辑器里改,有人最后再把内容复制到别的平台。格式一多,版本就乱,AI
也很难稳定接手。</p>
<p><code>zach-md-html</code> 的做法是把角色分开:</p>
<ul>
<li><code>markdown</code> 负责生产:轻、可 diff、适合 AI 读写</li>
<li><code>HTML</code>
负责阅读和展示:可排版、可交互、浏览器直接打开</li>
<li><code>DOCX</code> 负责审校和交付:适合编辑、客户、投稿系统</li>
</ul>
<h2 id="为什么先写-markdown">为什么先写 Markdown</h2>
<p>Markdown 的优势不是好看,而是稳定。</p>
<table>
<thead>
<tr>
<th>维度</th>
<th>Markdown</th>
<th>HTML</th>
<th>DOCX</th>
</tr>
</thead>
<tbody>
<tr>
<td>AI 读取</td>
<td>很轻</td>
<td>token 成本高</td>
<td>需要解析</td>
</tr>
<tr>
<td>版本管理</td>
<td>适合 diff</td>
<td>标签噪声多</td>
<td>不适合纯文本 diff</td>
</tr>
<tr>
<td>最终展示</td>
<td>需要转换</td>
<td>浏览器直接打开</td>
<td>Office 生态友好</td>
</tr>
</tbody>
</table>
<p>所以更稳的流程是:先用 Markdown 写清楚,再按交付场景生成 HTML 或
DOCX。</p>
<h2 id="一个实用工作流">一个实用工作流</h2>
<ol type="1">
<li>收到 PDF / DOCX / 网页资料,先转成 Markdown。</li>
<li>在 Markdown 里做修改、补充、审校。</li>
<li>对外展示时转成 HTML。</li>
<li>需要编辑审校或投稿时转成 DOCX。</li>
</ol>
<p>这个流程的好处是:所有中间修改都留在同一个源文件里,产物可以重复生成。</p>
<h2 id="什么时候用工作面-html">什么时候用工作面 HTML</h2>
<p>不是所有内容都适合线性文章。下面这些场景更适合做成工作面:</p>
<ul>
<li>三个方案横向对比</li>
<li>项目计划和里程碑</li>
<li>事故复盘时间线</li>
<li>PR / 文档评审批注</li>
<li>周报和状态看板</li>
</ul>
<p>这类内容如果只做成长文,读者需要来回跳转;做成 HTML
工作面后,可以在一个页面里比较、展开、复制和定位。</p>
<h2 id="结论">结论</h2>
<p>把 Markdown 当源,把 HTML / DOCX
当产物,文档工作会更像软件工程:源文件稳定、产物可再生、AI
也更容易协作。</p>
    </article>
  </main>

  <!-- TOAST -->
  <div id="toast" role="status" aria-live="polite"></div>

  <script>
  (function () {
    'use strict';

    // ----- Step 1: post-process the rendered DOM so it matches the
    //              "WeChat-survivable" structure (real spans, not ::before content)

    // 1a. Convert section counters into real <span class="h2-num"> elements
    var article = document.getElementById('article-content');
    var h2s = article.querySelectorAll('h2');
    h2s.forEach(function (h2, i) {
      // Skip if a number span already exists (idempotent)
      if (h2.querySelector('.h2-num')) return;
      var num = document.createElement('span');
      num.className = 'h2-num';
      var n = String(i + 1).padStart(2, '0');
      num.textContent = n;
      h2.insertBefore(num, h2.firstChild);
    });

    // 1b. Convert UL bullets to real <span class="bullet"> for paste survival
    var ulItems = article.querySelectorAll('ul > li');
    ulItems.forEach(function (li) {
      if (li.querySelector(':scope > .bullet')) return;
      var bullet = document.createElement('span');
      bullet.className = 'bullet';
      bullet.textContent = '—';
      bullet.setAttribute('data-bullet', 'true');
      li.insertBefore(bullet, li.firstChild);
    });

    // ----- Step 2: copy logic —— inline computed styles for every element
    //              inside <article>, then write to clipboard

    // Properties to inline (whitelisted to keep payload small and reliable in WeChat)
    var STYLE_PROPS = [
      'color', 'background', 'background-color', 'background-image',
      'font-family', 'font-size', 'font-weight', 'font-style', 'font-variant',
      'line-height', 'letter-spacing', 'text-align', 'text-decoration',
      'text-decoration-color', 'text-decoration-thickness', 'text-underline-offset',
      'text-transform', 'white-space',
      'margin', 'margin-top', 'margin-right', 'margin-bottom', 'margin-left',
      'padding', 'padding-top', 'padding-right', 'padding-bottom', 'padding-left',
      'border', 'border-top', 'border-right', 'border-bottom', 'border-left',
      'border-radius', 'border-color', 'border-style', 'border-width',
      'display', 'vertical-align', 'position',
      'width', 'max-width', 'height',
      'overflow', 'overflow-x',
      'list-style', 'list-style-type'
    ];

    function inlineStyles(root) {
      var elements = root.querySelectorAll('*');
      // Include root itself
      var all = [root].concat(Array.prototype.slice.call(elements));
      all.forEach(function (el) {
        if (el.dataset && el.dataset.noCopy === 'true') return;
        var cs = window.getComputedStyle(el);
        var inline = '';
        STYLE_PROPS.forEach(function (prop) {
          var val = cs.getPropertyValue(prop);
          if (val && val !== 'normal' && val !== 'auto' && val !== 'none' &&
              val !== '0px' && val !== 'rgba(0, 0, 0, 0)' && val !== 'transparent') {
            // Skip ::before/::after-derived properties; they don't apply to element itself anyway
            inline += prop + ': ' + val + '; ';
          }
        });
        if (inline) {
          // Preserve any existing inline style first, then append computed
          var existing = el.getAttribute('style') || '';
          el.setAttribute('style', (existing ? existing + '; ' : '') + inline.trim());
        }
        // Strip class to avoid WeChat trying to interpret it (WeChat keeps class but that's fine)
        // ...actually keep class for fallback, WeChat just ignores it.
      });
    }

    function buildClipboardHtml() {
      // Clone the article to avoid mutating the live page
      var clone = article.cloneNode(true);

      // Important: append to a hidden container in the live DOM so getComputedStyle works
      var hidden = document.createElement('div');
      hidden.setAttribute('aria-hidden', 'true');
      hidden.style.cssText = 'position: absolute; left: -99999px; top: -99999px; width: 720px;';
      hidden.appendChild(clone);
      document.body.appendChild(hidden);

      // Apply inline styles
      inlineStyles(clone);

      // Now read the HTML back; we no longer need the hidden node
      var html = clone.outerHTML;
      document.body.removeChild(hidden);

      // Wrap with a UTF-8 charset declaration for safety
      return '<section style="font-family: -apple-system, BlinkMacSystemFont, \'PingFang SC\', \'Helvetica Neue\', sans-serif;">' + html + '</section>';
    }

    function showToast(msg) {
      var toast = document.getElementById('toast');
      toast.textContent = msg;
      toast.classList.add('show');
      setTimeout(function () { toast.classList.remove('show'); }, 2400);
    }

    function fallbackCopy(text) {
      // Old-school copy via hidden contentEditable + execCommand
      var area = document.createElement('div');
      area.contentEditable = 'true';
      area.style.cssText = 'position: absolute; left: -9999px; top: 0; opacity: 0;';
      area.innerHTML = text;
      document.body.appendChild(area);
      var range = document.createRange();
      range.selectNodeContents(area);
      var sel = window.getSelection();
      sel.removeAllRanges();
      sel.addRange(range);
      try {
        document.execCommand('copy');
        document.body.removeChild(area);
        return true;
      } catch (err) {
        document.body.removeChild(area);
        return false;
      }
    }

    var btn = document.getElementById('copy-btn');
    var btnText = document.getElementById('copy-btn-text');
    btn.addEventListener('click', async function () {
      var html = buildClipboardHtml();
      var plain = article.innerText;

      try {
        // Modern path: ClipboardItem with both text/html and text/plain
        if (window.ClipboardItem && navigator.clipboard && navigator.clipboard.write) {
          await navigator.clipboard.write([
            new ClipboardItem({
              'text/html': new Blob([html], { type: 'text/html' }),
              'text/plain': new Blob([plain], { type: 'text/plain' })
            })
          ]);
        } else if (navigator.clipboard && navigator.clipboard.writeText) {
          // Fallback to text-only (HTML formatting will still come through if pasted via execCommand path)
          var ok = fallbackCopy(html);
          if (!ok) await navigator.clipboard.writeText(plain);
        } else {
          fallbackCopy(html);
        }

        btnText.textContent = '已复制 ✓';
        btn.classList.add('copied');
        showToast('已复制到剪贴板,粘贴到公众号编辑器即可');
        setTimeout(function () {
          btnText.textContent = '复制到公众号';
          btn.classList.remove('copied');
        }, 2400);
      } catch (err) {
        console.error(err);
        // Last-resort fallback
        var ok = fallbackCopy(html);
        if (ok) {
          btnText.textContent = '已复制 ✓';
          btn.classList.add('copied');
          showToast('已复制 (兼容模式)');
          setTimeout(function () {
            btnText.textContent = '复制到公众号';
            btn.classList.remove('copied');
          }, 2400);
        } else {
          showToast('复制失败,请手动选中正文复制');
        }
      }
    });
  })();
  </script>
</body>
</html>
canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pdfanthropics/skillsUse 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 PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pptxanthropics/skillsUse 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 presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall