Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: c421646f64
Fetching contributors…

Cannot retrieve contributors at this time

112 lines (87 sloc) 2.626 kb

Sparkup

Install this by putting sparkup in your $PATH somewhere. Requires Python 2.5+ (comes preinstalled with Mac OS X).

This project is inspired by Zen Coding of Vadim Makeev. The Zen HTML syntax is forward-compatible with Sparkup (anything that Zen HTML can parse, Sparkup can too).

Usage

You can write HTML in a CSS-like syntax, and have sparkup handle the expansion to full code. To use sparkup in the command line, simply do echo "<your code here>" | sparkup.

Sparkup also offers intregration into common text editors. Support for VIM and TextMate are currently included.

Usage for text editors

  • TextMate: Simply double-click on the Sparkup.tmbundle package in Finder. This will install it automatically. In TextMate, open an HTML file (orset the document type to HTML) type in something (e.g., #header > h1), then press Ctrl + E. Pressing Tab will cycle through empty elements.

  • VIM: See the sparkup.vim file's contents for details.

Examples

div

div#header

div.align-left#header

div#header + div#footer

#menu > ul

    #menu > h3 + ul

      #header > h1{Welcome to our site}

      Welcome to our site

      a[href=index.html]{Home} Home

      ul > li*3

      ul > li.item-$*3

      ul > li.item-$*3 > strong

      table > tr2 > td.name + td3

      #header > ul > li < p{Footer} <!-- The < symbol goes back up the parent; i.e., the opposite of >. -->

      Footer

      Jump to Line
      Something went wrong with that request. Please try again.