博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Zen Coding — a new way of writing HTML and CSS code
阅读量:5846 次
发布时间:2019-06-18

本文共 3719 字,大约阅读时间需要 12 分钟。

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

Follow us on Twitter

New version 0.7 is available (March 13, 2011), read 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:

       
       

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 .

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. 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 and read .

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. .

Officially supported editors

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

  • Aptana/Zend Studio/Eclipse (crossplatform)
  • TextMate (Mac). Available in two flavors: basic snippets (Zen HTML and Zen CSS) and full-featured plugin (ZenCoding for TextMate). Bundles > Zen Coding menu item
  • Coda (Mac) — , via . Plug-ins > TEA for Coda > Zen Coding menu item
  • Espresso (Mac) — , via . Zen Coding is bundled with Espresso by default, but you should upgrade ZC to latest version. Actions > HTML menu item
  • Komodo Edit/IDE (crossplatform) — . Tools > Zen Coding menu item
  • Notepad++ (Windows). Zen Coding menu item Also a Python version of NPP plugin is available:
  • PSPad (Windows). Scripts > Zen Coding menu item
  • <textarea> (browser-based). See .
  • editArea (browser-based). See .
  • CodeMirror (browser-based). See .

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.

  • Dreamweaver (Windows, Mac)
  • Sublime Text (Windows)
  • Sublime Text 2 (crossplatform) —
  • UltraEdit (Windows)
  • TopStyle (Windows)
  • GEdit (crossplatform) — ,
  • BBEdit/TextWrangler (Mac) —
  • Visual Studio (Windows) — at
  • EmEditor (Windows) —
  • Sakura Editor (Windows) —
  • NetBeans (crossplatform) —
  • Chrome Extension
  • Userscript for Greasemonkey
  • Geany
  • RJ TextEd
  • AkelPad
  • — built-in in v2.2.1

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.

  • IntelliJ IDEA/WebStorm/PHPStorm (crossplatform) — built-in in latest versions
  • Emacs (crossplatform) —
  • Vim (crossplatform) — ,
  • for Visual Studio

转载地址:http://cuwjx.baihongyu.com/

你可能感兴趣的文章
HDU 2289 Cup (二分)
查看>>
C#中使用Monitor类、Lock和Mutex类来同步多线程的执行
查看>>
[翻译] 使用CSS进行文字旋转
查看>>
读取本地已有的.db数据库
查看>>
C#发现之旅第十一讲 使用反射和特性构造自己的ORM框架
查看>>
使用GHOST对Windows操作系统进行备份和还原
查看>>
KMeans (K均值)算法讲解及实现
查看>>
为什么不应该使用Zookeeper做服务发现?(转载)
查看>>
《JavaScript核心概念及实践》——2.2 变量
查看>>
git 常用命令
查看>>
关于java 1.8的Lambda表达式详解
查看>>
缅怀那些正渐行渐远的编程语言
查看>>
各个网站的CSS清除代码
查看>>
TableView的集合
查看>>
软RAID管理命令mdadm详解
查看>>
Bootstrap学习
查看>>
控制器 控制器view cell的关系
查看>>
Eclipse RCP 玩转 Spring
查看>>
我的友情链接
查看>>
Maven项目部署到tomcat(内嵌tomcat)
查看>>