Zen CodingZen Coding is a faster way to write HTML using a CSS style selector syntax and you can now use Zen Coding in Visual Studio via the Web Essentials 2012 plug in (v1.7). Zen Coding was introduced by Sergey Chikuyonok in 2009 (according to Smashing Magazine) and has been updated over time to become a great way to write monotonous HTML much more efficiently.Special thanks to Mads Kristensen and his team at Microsoft for adding Zen Coding to Visual Studio 2012 via Web Essentials 2012 (along with many other great features).Quick ReferenceHere is a quick list of the Zen Coding features that are now supported in Visual Studio 2012 via the Web Essentials 2012 plug in.
What can you do? Here is an example:
Let's take a closer look at the various symbols used.ID and Class Attributes: # and .You can create an element and assign it an id or class attribute using CSS-style syntax.
Custom Attributes: [ ]You can create any attribute using the square bracket syntax.
Or create multiple attributes and fill in the values as in the following:
Child Elements: >Create an element and then a child element inside of it. In this example I create a div with the id=menu that contains a span with a class=item and a blank title attribute.
Sibling Elements: +You can create a sibling element easily too.
Climbing Elements: ^The > operator descends into element hierarchy whereas the ^ climbs up the hierarchy. You can also climb multiple levels. For example, use 1 ^ to climb 1 level or use 4 ^ to climb 4 levels.
Multiplication: *Create n number of elements.
Item Numbering: $When using multiplication to create n number of elements, you can add an incremental number to them using the $. Notice that using multiple $ operators (for example: $$) pads the numbers with 0's.
Text: } {You can enter text values inside of elements, without changing the parent context.
This does not change the parent context, so when specifying the sibling to follow the text, the sibling element will actually follow the element prior to the text. That's why the example below creates an anchor tag next to the span tag.
Combining Them allYou can combine multiple features together that allow you to write some pretty cool HTML much faster. You can even use this to create some Knockout.js bindings for templates and then just change the property names.
Grouping: ( )Grouping is a powerful feature of Zen Coding that allows you to create complex expressions. It is not yet in Web Essentials 2012, but I assume it will be in the near future. If it does arrive, you will be able to create entire sections of a DOM very easily.
As you can see, this would make it quite simple to create large sections of HTML with just a few keystrokes.Lorem Ipsum GeneratorYou can now generate Lorem Ipsum directly in the HTML editor. Type “lorem” and hit TAB and a 30 word Lorem Ipsum text is inserted. Type “lorem10″ and a 10 word Lorem Ipsum text is inserted. ul>li*5>lorem3
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: