Thursday, September 23, 2010

A First attempt at Zen Coding

This is a trial of a coding appreviation standard called Zen Coding which allows one to code complicated structures such as one would see in HTML or CSS that require balancing of tags and prevent typos with easy to corrupt syntax. I created this using the string "div#page>div.logo+ul#navigation>li*5>a".

I just inserted two paragraphs with the same class by entering "p.first+p.first" a pound-sign would mean an element id. Having element.class pairs allows for element specfic CSS.

This is the second paragrah of class "first" I added. There are three instances of that paragraph class in this document.

Page1

This template was produced entirely from the one line zen coding: "div#page>(div#header>ul#nav>li*4>a)+(div#page>(h1>span)+p*2)+div#footer"

This was the second paragraph created.

top

These pags were added.

I then created three new pages each with a unique ID using the pattern "div#page2>(h1>span)+p*2"

I am using a plugin for Komodo 5.2 for Zen Coding.

top

Zen Coding is a Google Project

It is implemented using a plugin for the supported editors. That is how I found out about the Komodo plugin.

A Second paragraph.

top

An Emacs mode for Zen Coding

There is an elisp major mode for emacs for zen coding. I have not yet tried it out.

I tried it later today and if found it broken. I was able to expand simple templates, but nothing more complex.

top
Free Web Hosting