`
yangshen998
  • 浏览: 1288983 次
文章分类
社区版块
存档分类
最新评论

前端开发神器:notepad++插件zen-coding

 
阅读更多

Zen HTML Elements

Based on HTML 5 specification draft.


Root Element

html

<html></html>

html:xml

<htmlxmlns="http://www.w3.org/1999/xhtml"xml:lang="ru"></html>

html:4t

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<htmllang="ru">
<head>
<title></title>
<metahttp-equiv="Content-Type"content="text/html;charset=UTF-8">
</head>
<body>

</body>
</html>

html:4s

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<htmllang="ru">
<head>
<title></title>
<metahttp-equiv="Content-Type"content="text/html;charset=UTF-8">
</head>
<body>

</body>
</html>

html:xt

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml"xml:lang="ru">
<head>
<title></title>
<metahttp-equiv="Content-Type"content="text/html;charset=UTF-8"/>
</head>
<body>

</body>
</html>

html:xs

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml"xml:lang="ru">
<head>
<title></title>
<metahttp-equiv="Content-Type"content="text/html;charset=UTF-8"/>
</head>
<body>

</body>
</html>

html:xxs

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml"xml:lang="ru">
<head>
<title></title>
<metahttp-equiv="Content-Type"content="text/html;charset=UTF-8"/>
</head>
<body>

</body>
</html>

html:5

<!DOCTYPE HTML>
<htmllang="ru-RU">
<head>
<title></title>
<metacharset="UTF-8">
</head>
<body>

</body>
</html>

Document Metadata

head

<head></head>

title

<title></title>

base

<basehref="">

link

<link>

link:css

<linkrel="stylesheet"type="text/css"href="style.css"media="all">

link:print

<linkrel="stylesheet"type="text/css"href="print.css"media="print">

link:favicon

<linkrel="shortcut icon"type="image/x-icon"href="favicon.ico">

link:touch

<linkrel="apple-touch-icon"href="favicon.png">

link:rss

<linkrel="alternate"type="application/rss+xml"title="RSS"href="rss.xml">

link:atom

<linkrel="alternate"type="application/atom+xml"title="Atom"href="atom.xml">

meta

<meta>

meta:utf

<metahttp-equiv="Content-Type"content="text/html;charset=UTF-8">

meta:win

<metahttp-equiv="Content-Type"content="text/html;charset=Win-1251">

meta:compat

<metahttp-equiv="X-UA-Compatible"content="IE=7">

style

<styletype="text/css"></style>

Scripting

script

<scripttype="text/javascript"></script>

script:src

<scripttype="text/javascript"src=""></script>

noscript

<noscript></noscript>

Sections

body

<body></body>

section, sect

<section></section>

nav

<nav></nav>

article, art

<article></article>

aside

<aside></aside>

h1

<h1></h1>

h2

<h2></h2>

h3

<h3></h3>

h4

<h4></h4>

h5

<h5></h5>

h6

<h6></h6>

hgroup, hgr

<hgroup></hgroup>

header, hdr

<header></header>

footer, ftr

<footer></footer>

address, adr

<address></address>

div

<div></div>

Grouping Content

p

<p></p>

hr

<hr>

br

<br>

pre

<pre></pre>

dialog, dlg

<dialog></dialog>

blockquote, bq

<blockquote></blockquote>

ol

<ol></ol>

ol+

<ol>
<li></li>
</ol>

ul

<ul></ul>

ul+

<ul>
<li></li>
</ul>

li

<li></li>

dl

<dl></dl>

dl+

<dl>
<dt></dt>
<dd></dd>
</dl>

dt

<dt></dt>

dd

<dd></dd>

Text-level Semantics

a

<ahref=""></a>

a:link

<ahref="http://"></a>

a:mail

<ahref="mailto:"></a>

q

<q></q>

cite

<cite></cite>

em

<em></em>

strong, str

<strong></strong>

small

<small></small>

mark

<mark></mark>

dfn

<dfn></dfn>

abbr

<abbrtitle=""></abbr>

acronym, acr

<acronymtitle=""></acronym>

time

<time></time>

progress, prog

<progress></progress>

meter

<meter></meter>

code

<code></code>

var

<var></var>

samp

<samp></samp>

kbd

<kbd></kbd>

sub

<sub></sub>

sup

<sup></sup>

span

<span></span>

i

<i></i>

b

<b></b>

bdo

<bdodir=""></bdo>

bdo:r

<bdodir="rtl"></bdo>

bdo:l

<bdodir="ltr"></bdo>

ruby

<ruby></ruby>

rt

<rt></rt>

rp

<rp></rp>

Edits

ins

<ins></ins>

del

<del></del>

Embedded Content

figure, fig

<figure></figure>

img

<imgsrc=""alt="">

iframe, ifr

<iframesrc=""frameborder="0"></iframe>

embed, emb

<embedsrc=""type="">

object, obj

<objectdata=""type=""></object>

param

<paramname=""value="">

video

<videosrc=""></video>

audio

<audiosrc=""></audio>

source, src

<source>

canvas

<canvas></canvas>

map

<mapname=""></map>

map+

<mapname="">
<areashape=""coords=""href=""alt="">
</map>

area

<areashape=""coords=""href=""alt="">

area:d

<areashape="default"href=""alt="">

area:c

<areashape="circle"coords=""href=""alt="">

area:r

<areashape="rect"coords=""href=""alt="">

area:p

<areashape="poly"coords=""href=""alt="">

Tabular Data

table

<table></table>

table+

<table>
<tr>
<td></td>
</tr>
</table>

caption, cap

<caption></caption>

colgroup, colg

<colgroup></colgroup>

colgroup+, colg+

<colgroup>
<col>
</colgroup>

col

<col>

tbody

<tbody></tbody>

thead

<thead></thead>

tfoot

<tfoot></tfoot>

tr

<tr></tr>

tr+

<tr>
<td></td>
</tr>

th

<th></th>

td

<td></td>

Forms

form

<formaction=""></form>

form:get

<formaction=""method="get"></form>

form:post

<formaction=""method="post"></form>

fieldset, fset

<fieldset></fieldset>

legend, leg

<legend></legend>

label

<labelfor=""></label>

input

<inputtype="">

input:hidden, input:h

<inputtype="hidden"value="">

input:text, input:t

<inputtype="text"value=""id="">

input:search

<inputtype="search"value=""id="">

input:email

<inputtype="email"value=""id="">

input:url

<inputtype="url"value=""id="">

input:password, input:p

<inputtype="password"value=""id="">

input:datetime

<inputtype="datetime"value=""id="">

input:datetime-local

<inputtype="datetime-local"value=""id="">

input:date

<inputtype="date"value=""id="">

input:month

<inputtype="month"value=""id="">

input:week

<inputtype="week"value=""id="">

input:time

<inputtype="time"value=""id="">

input:number

<inputtype="number"value=""id="">

input:range

<inputtype="range"value=""id="">

input:color

<inputtype="color"value=""id="">

input:checkbox, input:c

<inputtype="checkbox"id="">

input:radio, input:r

<inputtype="radio"id="">

input:file, input:f

<inputtype="file"id="">

input:submit, input:s

<inputtype="submit"value="">

input:image, input:i

<inputtype="image"src=""alt="">

input:reset

<inputtype="reset"value="">

input:button, input:b

<inputtype="button"value="">

button, btn

<button></button>

select

<selectid=""></select>

select+

<selectid="">
<optionvalue=""></option>
</select>

optgroup, optg

<optgroup></optgroup>

optgroup+, optg+

<optgroup>
<option></option>
</optgroup>

option, opt

<option></option>

Interactive Elements

datagrid, datag

<datagrid></datagrid>

datalist, datal

<datalist></datalist>

textarea, tarea

<textareaid=""cols="30"rows="10"></textarea>

keygen, kg

<keygen>

output, out

<output></output>

details, det

<details></details>

command, cmd

<command>

bb

<bb></bb>

menu

<menu></menu>

menu:context, menu:c

<menutype="context"></menu>

menu:toolbar, menu:t

<menutype="toolbar"></menu>

Conditional Comments

cc:ie

<!--[if IE]><![endif]-->

cc:noie

<!--[if !IE]><!--><!--<![endif]-->

展开缩写

展开缩写功能将类似CSS的选择器转换为XHTML代码。术语“缩写”可能会有点儿难以理解。为什么不直接称之为“CSS选择器”呢?嗯,首要原因是语义化:“选择器”意为选择一些东西,但是在这里我们事实上是生成一些东西,是写一个长代码的较短的替代。其次,它只是使用真实的CSS选择器语法的一个小的子集,并添加了一些新的操作符。

这里是一个支持的属性和操作符的列表:

  • E 元素名称(div, p);
  • E#id 使用id的元素(div#content, p#intro, span#error);
  • E.class 使用类的元素(div.header, p.error.critial). 你也可以联合使用class和idID: div#content.column.width;
  • E>N 子代元素(div>p, div#footer>p>span);
  • E+N 兄弟元素(h1+p, div#header+div#content+div#footer);
  • E*N 元素倍增(ul#nav>li*5>a);
  • E$*N 条目编号 (ul#nav>li.item-$*5);

正如你能看到的,你已经知道如何使用Zen Coding了:只是些一个简单的仿CSS选择器(呃,“缩写”抱歉),就像这样…

div#header>img.logo+ul#nav>li*4>a

…然后调用”展开缩写”行为。

这里有两个新增的操作符:元素倍增和条目编号。比如,如果你想生成5个<li>元素,你可以简单的写位li*5。它也将同样重写全部子代元素。如果你想写4个<li>元素,每个里面都有一个<a>标签,你就可以简单的写为li*4>a,这样会生成以下HTML代码:

1
2
3
4
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>

最后一个——条目编号用于当你想用索引标记重复的元素的情况。假设你想生成class为item1、item2和item3的3个<div>元素。你可以写成这样的缩写,div.item$*3:

1
2
3
<div class="item1"></div>
<div class="item2"></div>
<div class="item3"></div>

只需在你想要索引出现的任何class或id属性上添加一个美元符号即可,而且想要多少都可以。那么,这样…

div#i$-test.class$$$*5

会被转换成为:

1
2
3
4
5
<div id="i1-test" class="class111"></div>
<div id="i2-test" class="class222"></div>
<div id="i3-test" class="class333"></div>
<div id="i4-test" class="class444"></div>
<div id="i5-test" class="class555"></div>

你会看到,当你写a的缩写的时候,输出是<a href=”"></a>。或者,如果你写img,输出就是<img src=”" alt=”" />。

Zen Coding是如何知道什么时候应该为生成的标签添加默认的属性或者跳过关闭标签的?有一个专门的文件,名为zen_settings.js描述了输出元素。这是一个简单的JSON文件,描述每种语言的缩写(是的,你可以为不同的句法定义缩写,比如HTML、XSL、CSS等)。通用的语言缩写定义看起来就像这样:

1
2
3
4
5
6
7
'html': { 'snippets': { 'cc:ie6': '<!--[if lte IE 6]>\n\t${child}|\n<![endif]-->',
   ...
   },
     'abbreviations': { 'a': '<a href=""></a>', 'img': '<img src="" alt="" />',
   ...
   }
   }




分享到:
评论

相关推荐

    Notepad++(notepad-plus-plus-8.4.1.tar.gz)源码

    4. **插件系统**:Notepad++的插件管理器允许用户扩展编辑器功能,源码会揭示如何设计一个灵活的插件架构,以及插件是如何加载和管理的。 5. **宏和脚本支持**:Notepad++支持录制和执行宏,了解这部分源码有助于...

    notepad++plugins---notepad++插件,开发必备(全)

    它支持多种编程语言,并具有丰富的自定义功能,其中最重要的一个特性就是其可扩展性——通过安装各种插件,Notepad++可以变成一个功能强大的开发工具。本资源提供了Notepad++插件的完整集合,对于开发者来说,这些...

    Notepad++插件ComparePlugin-中文汉化版

    对比两份文本异同的Notepad++ 插件。把压缩包中ComparePlugin.dll放入Notepad++\plugins目录即可。启动Notepad++自动加载该插件。Clt+Alt+C对比当前打开的两个文本文件,Clt+Alt+X退出对比。

    notepad++ 插件开发模板

    《深入探讨Notepad++插件开发模板》 Notepad++是一款广受欢迎的开源文本编辑器,因其轻量级、高效且可扩展性强大而受到程序员的青睐。在Notepad++中,用户可以通过编写插件来扩展其功能,满足个性化需求。本文将...

    Notepad++自动缩进插件---NppAStyle.dll

    Notepad++本来是没有自动缩近的功能的。想要自动缩近必须要安装插件NppAStyle。 2 下载后我们打开这个解压文件。发现有两个文件夹ansi和unicode。由于我们是在中国,所以打开unicode文件夹,将里面的NppAStyle.dll...

    notepad++包含各种插件绿色版

    "notepad++包含各种插件绿色版" 这个标题指出这是一个特别的Notepad++版本,它带有多种插件,并且是绿色免安装版。这意味着用户无需进行正式的安装过程,只需解压文件并运行,就可以享受到这些附加功能。 **描述...

    notepad++ zencoding插件notepad++ zencoding插件notepad++ zencoding插件

    notepad++ 密码是1 zencoding插件

    Notepad++ v7.8.9 32-bit Json Viewer插件

    在这个特定的场景中,我们讨论的是Notepad++的一个插件——v7.8.9 32-bit版本的Json Viewer。这个插件专为解析和格式化JSON(JavaScript Object Notation)数据设计,是开发者处理JSON文件时不可或缺的工具。 JSON...

    ZenCoding Python 0.7.0.1a(notepad++)

    ZenCoding是一种快速、高效的前端开发编码技术,它后来演变成了 Emmet,现在是Web开发者广泛使用的代码编写辅助工具。在Python环境下,ZenCoding提供了一种类似的功能,使得Python程序员能够利用简短的缩写来快速...

    Notepad++选中行操作 快捷键

    ### Notepad++选中行操作与快捷键详解 #### 一、选中行操作 Notepad++是一款功能强大的文本编辑器,支持多种编程语言的语法高亮、代码折叠以及宏等功能。对于程序员而言,掌握其快捷键能极大地提高工作效率。下面...

    notepad++ 32位

    5. **插件支持**:Notepad++拥有丰富的插件库,如FTP客户端、代码折叠、代码比较等,可以根据个人需求扩展其功能。 6. **编码支持**:支持多种字符编码,如ASCII、UTF-8、Unicode等,确保文件在不同系统间正确交换...

    NotePad++常用插件集合

    这个压缩文件包含了notepad++的一些常用插件 包括热门插件compare zen coding emmet jstool tags jump nppexec quicktext nppFTP等等 以及用于php python js等领域开发的插件 便于安装配置 省掉了重装或新装np++的...

    notepad++-插件-plugs

    notepad++_插件_plugs 全部插件 3P, ActiveX, AnalysePlugin, nppAutoDetectIndent, AutoCodepage, AutoEolFormat, NppScripts, AutoSave, BetterMultiSelection, BigFiles, ...

    notepad++中文安装包npp-7.4.2-Installer

    7. **自定义插件**:Notepad++有一个活跃的社区,开发了众多插件以扩展其功能,如用于版本控制的Git插件,或者用于调试的NppFTP等。 8. **轻量级**:相比于其他大型IDE,Notepad++的体积小,启动速度快,占用系统...

    Notepad++ release 8.6.4 x64

    3. **插件系统**:Notepad++ 的一大亮点在于其丰富的插件库,如NppFTP用于FTP文件传输,Git插件进行版本控制,以及CodeFolding用于代码折叠,这些插件极大地扩展了编辑器的功能。 4. **用户界面定制**:用户可以...

    Notepad++ 代码补全插件QuickText

    6. **兼容性与更新**:QuickText作为Notepad++的插件,保持与Notepad++版本的兼容性,确保在升级Notepad++时仍能正常使用。同时,开发者也会定期发布更新,修复问题并增加新特性。 在实际开发过程中,熟练运用...

    Notepad++ 插件集合(共52个)

    Notepad++ 插件集合(共52个),适用于32位Notepad++(含部分64位),下载插件,将zip文件解压后的dll文件放到Notepad++安装目录下的plugins目录,重启Notepad++,点击菜单--插件,即可看见安装的插件。

    Notepad++对比插件

    复制到Notepad++安装目录下的\plugins目录 快捷键:文件对比:ctrl+alt+c 也可以在插件 --- 插件...直接用notepad++的插件管理搜一下能不能搜到Compare,还不行的话直接把ComparePlugin.dll文件放到plugins目录试一下

    (Notepad++8.5.3)安装包+AutoSave插件+HexEdit插件

    在使用这些组件时,你需要先安装Notepad++的主程序,然后通过Notepad++的插件管理器(Plugins Manager)安装或手动安装AutoSave和HexEdit插件。Notepad++的插件管理器允许用户方便地查找、安装和管理各种插件,大大...

    NotePad++Hex插件

    **NotePad++ Hex插件详解** NotePad++是一款广受欢迎的免费源代码编辑器,尤其在程序员和IT专业人员中非常流行。它支持多种编程语言,并具有语法高亮、代码折叠、多文档界面等特性。而Hex插件是NotePad++的一个扩展...

Global site tag (gtag.js) - Google Analytics