Friday, February 16, 2007

Blogging with Eclipse

I have mentioned—probably ad nauseum—that I haven’t yet settled on a good HTML editor for Ubuntu/Linux. I’ve now begun work on writing a plugin for Eclipse, for blog editing. I even found some tools from Google, that will let me post to my Blogger account(s) automatically, by code. I’m using Java, of course, so I downloaded a handy-dandy JAR file from Google, that simplifies the whole thing. In fact, submitting a post—once you have all of the text for it, of course—is just 9 lines of code.

If all goes according to plan, I’ll be creating the following for Eclipse:

  • An HTML editor—based on existing HTML editors, I’m not writing anything from scratch—with edit and preview views
  • A plugin for working with quotation marks, similar to what I did for HTML-Kit
  • A generic plugin architecture, so that others can add their own blog-specific plugins
  • Preferences, where you can set up Eclipse with all of the blogs you post to, and HTML templates for those blogs.
  • The ability to automatically submit, with the click of a button. This would include things like:
    • Fixing up quotes, using the smart quotes plugin
    • Fixing up any newline issues, and—if necessary—removing <BR> tags
I’m fairly excited about this. But there’s a bit of a learning curve, in writing an Eclipse plugin, so it probably won’t be ready any time soon. (You can actually generate an Eclipse plugin with a few clicks of the mouse, and get it to generate a lot of the functionality for you; but then, when the skeleton code is there, I need to figure out how to sub-class an HTML Editor class, etc.)