NJEdit is a WYSIWYM editor of sorts that I created in order to draft the manuscript for Closure: The Definitive Guide. I named it NJEdit because it was implemented in the spirit of the so-called New Jersey approach. Rather than implement a general-purpose word processing application (of which there are many), NJEdit supports only the formatting options that I needed to produce my manuscript.

As the primary output of the editor is a representation of the document in Docbook XML that can be consumed by the production team at O'Reilly (which is ultimately transformed into a version that is suitable for publication to print), NJEdit constrains the set of formatting options to those that can be realized in DocBook. More specifically, it only supports the set of features of DocBook that I needed to use. For example, as I never encountered the need for boldface text while writing my book, I never added such a feature to NJEdit.

Originally, NJEdit was implemented as a Firefox extension (using Chickenfoot, of course) so that it had the security permissions to include code snippets from source code on local disk. (This was done to ensure that my code samples and my manuscript would be in sync.) By using Firefox as my platform, I was able to leverage all of my knowledge of JavaScript/HTML/CSS to implement NJEdit while I was simultaneously inhibited by the quirks of content-editable HTML elements. Despite these tradeoffs, I was able to construct an editor with the following features:

Although NJEdit was implemented from a "works for me" perspective, I decided to port it to a webapp as others may find it useful. Further, I have open-sourced the code and made it available on Google Code. Personally, I plan to continue to use NJEdit to write technical articles such as "Inheritance Patterns in JavaScript", but if others find it useful and want to contribute, then I will happily accept patches.

Get Started Using NJEdit (requires access to Google Docs)