Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

md-section

БесплатноБез исполняемых скриптовНе проверен

Use when converting HTML layouts to MD Section block + core block combinations for the WordPress Block Editor. Triggers: HTML-to-blocks, section layout…

wpgauravот wpgaurav★ 24 звезды на GitHub

Об этом скилле

HTML to MD Section Block Conversion

Convert arbitrary HTML layouts into nested marketers-delight/section blocks combined with core WordPress blocks. Strip external CSS/JS. Preserve inline styles via block attributes.

When to Use

  • Converting an HTML template/component into block editor markup
  • Building complex layouts (heroes, card grids, tab panels) in the block editor
  • User pastes HTML and wants it as editable blocks
  • Recreating a design using Section blocks instead of Custom HTML

Section Block Reference

The MD Section block is a dynamic container. It renders server-side using attributes stored in the block comment delimiter. Inner blocks are stored as nested block markup.

Block Name

marketers-delight/section

Attributes

Attribute Type Default Purpose
htmlTag string div Tag name: div, section, article, aside, header, footer, main, nav, figure, details, or custom
customTag string "" Tag name when htmlTag is custom (e.g. dl, fieldset)
className string "" Space-separated CSS classes
anchor string "" HTML id attribute
align string "" wide or full
sectionCSS string "" Scoped CSS block (rendered in <style> tag before element)
htmlAttributes string "" Safe custom attributes as name="value" pairs (data-*, tabindex, style, title, etc.)
ariaHidden boolean false Sets aria-hidden="true"
ariaLabel string "" Sets aria-label
ariaLabelledBy string "" Sets aria-labelledby
role string "" ARIA role (banner, marquee, tabpanel, region, etc.) or custom
customRole string "" Role value when role is custom
hidden boolean false Sets hidden attribute

Serialization Format

<!-- wp:marketers-delight/section {"htmlTag":"section","className":"hero hero--dark","anchor":"top","ariaLabelledBy":"hero-title","sectionCSS":".hero--dark { background: #0a0a0a; color: #fff; }"} -->
<!-- inner blocks here -->
<!-- /wp:marketers-delight/section -->

Dynamic block: no HTML between delimiters except inner blocks. The PHP section() callback renders the wrapper element.

Safe htmlAttributes

The PHP renderer whitelists these attribute names/prefixes:

Prefixes: data-*, aria-* Names: tabindex, style, title, lang, dir, translate, loading, fetchpriority, rel, target, width, height, viewbox, preserveaspectratio, fill, stroke, opacity

Unsafe attributes (onclick, onerror, src, href) are silently dropped.

Conversion Rules

Step 1: Strip External Resources

Remove completely:

  • <link rel="stylesheet"> tags
  • <script src="..."> tags
  • <style> blocks that define external/global CSS

Step 2: Extract Scoped CSS

If the HTML has <style> blocks with classes used within the layout:

  • Move those rules into the outermost Section block's sectionCSS attribute
  • If CSS is section-specific, place it in that section's sectionCSS
  • Keep @keyframes and @media rules with the CSS they belong to

Step 3: Map Elements to Blocks

HTML Element                    Block
-----------------------------------------------------
<section>, <article>, <aside>,
<header>, <footer>, <nav>,
<main>, <figure>, <details>,
<div> (structural)             → marketers-delight/section

<h1>-<h6>                     → core/heading
<p>                            → core/paragraph
<ul>, <ol>                     → core/list + core/list-item
<img>                          → core/image
<video>                        → core/video
<audio>                        → core/audio
<blockquote>                   → core/quote
<pre>, <code>                  → core/code
<table>                        → core/table
<hr>                           → core/separator
<iframe> (embed)               → core/embed or core/html
<a> (wrapping block content)   → marketers-delight/section with htmlTag="a" is NOT supported; use core/group or nest a core/paragraph link
<svg> (inline, decorative)     → core/html
<dl>                           → marketers-delight/section with customTag="dl" + section children for dt/dd

Step 4: Transfer Attributes

For each HTML element mapped to a Section block:

HTML Attribute Section Block Property
class="..." className
id="..." anchor
role="..." role (or customRole if not in preset list)
aria-hidden="true" ariaHidden: true
aria-label="..." ariaLabel
aria-labelledby="..." ariaLabelledBy
hidden hidden: true
data-*="..." htmlAttributes string
tabindex="..." htmlAttributes string
style="..." htmlAttributes string (as style="...")

For core blocks, use their native attribute system (e.g., style object for headings/paragr

Полный SKILL.md на GitHub

Установить md-section в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл md-section?

Use when converting HTML layouts to MD Section block + core block combinations for the WordPress Block Editor. Triggers: HTML-to-blocks, section layout, convert HTML to Gutenberg, pasting HTML into block editor.

Как установить скилл md-section?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл md-section запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить md-section с