Zen Coding — a new way of writing HTML and CSS code

ZenCoding是一款提升HTML、XML、XSL等结构化代码编写效率的编辑器插件,通过强大的缩写引擎将简洁表达式快速转换为完整的HTML代码。支持ID和CLASS属性定制、元素复制等功能,并兼容多种编辑器。

zen-coding - Set of plugins for HTML and CSS hi-speed coding - Google Project Hosting

Zen Coding — a new way of writing HTML and CSS code

Follow us on Twitter @zen_coding

New version 0.7 is available (March 13, 2011), read release notes for more info.

Zen Coding is an editor plugin for high-speed HTML, XML, XSL (or any other structured code format) coding and editing. The core of this plugin is a powerful abbreviation engine which allows you to expand expressions—similar to CSS selectors—into HTML code. For example:

div#page>div.logo+ul#navigation>li*5>a

...can be expanded into:

<div id="page">
        <div class="logo"></div>
        <ul id="navigation">
                <li><a href=""></a></li>
                <li><a href=""></a></li>
                <li><a href=""></a></li>
                <li><a href=""></a></li>
                <li><a href=""></a></li>
        </ul>
</div>

Read more about current Zen Coding syntax

Abbreviation engine has a modular structure which allows you to expand abbreviations into different languages. Zen Coding currently supports CSS, HTML, XML/XSL and HAML languages via filters.

Current features of abbreviation engine

  • ID and CLASS attributes: div#page.section.main.
  • Custom attributes: div[title], a[title="Hello world" rel], td[colspan=2].
  • Element multiplication: li*5 will output <li> tag five times.
  • Item numbering with $ character: li.item$*3 will output <li> tag three times, replacing $ character with item number.
  • Multiple '

characters in a row are used as zero padding, i.e.: li.item$$li.item001

Abbreviation groups with unlimited nesting: div#page>(div#header>ul#nav>li*4>a)+(div#page>(h1>span)+p*2)+div#footer. You can literally write a full document markup with just a single line. Filters support div tag name can be omitted when writing element starting from ID or CLASS: #content>.section is the same as div#content>div.section. (v0.7) Text support: p>{Click }+a{here}+{ to continue}.

To better understand how Zen Coding works, watch demo video and read Smashing Magazine tutorial.

Zen Coding isn’t only a decent abbreviation engine, it also provides some very useful actions for HTML-coder’s every day needs, like: Wrap with Abbreviation, Tag Balancing, Toggle Comment, Remove Tag etc. Read more about available actions.

Officially supported editors

These plugins are developed by Zen Coding team and guarantee to have full support of all Zen Coding latest features.

Third-party supported editors

These plugins are using official Zen Coding engine and developed by third-party developers. Thus, no guarantee that they support all latest ZC features.

Unofficial implementations

These plugins are developed by third-party and has their own ZC engine implementation, which leads to different feature set and abbreviation syntax. Zen Coding team has no relation to this projects.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值