Zen Coding in Programmer’s Notepad

A user requested support for Zen Coding on the bug tracker.

Zen Coding is a system for writing HTML and CSS in text editors, expanding shorthand notation to full code.

I hadn’t used Zen myself, but a quick read of the excellent Smashing Magazine Introduction and a watch of the above video and I was intrigued.

Zen itself is an editor-agnostic set of scripts available in both Javascript and Python. That’s right, Python!

As testament to the good design of Zen, it was a piece of cake to integrate it with PyPN, allowing you to drop Zen for PyPN into your scripts directory and start taking advantage of this useful shorthand.

If you use PN 2.1.4 or later, you can start using Zen yourself right now:

  1. Download Zen Coding for PyPN Preview

  2. Extract the contents of the zip into your Programmer’s Notepad\Scripts directory

  3. Start PN

  4. Optionally bind the Expand Abbreviation script to a keyboard shortcut

Future enhancements to this implementation (and PN 2.1.5) will bring tab stops so that you can tab through the generated code, and probably other Zen Coding commands. For now, let me know what you think!