Skip to main content

Netbeans, my weblogging tool

Posted by evanx on June 7, 2006 at 5:31 AM PDT

fountain_pen_150.jpg

red_thread_125.jpg

quill_small.jpg

nails150.jpg

St_Basils_Cathedral-150.jpg bean_jar_crop.jpg align=right hspace=16 />
single_coffee_bean_small.jpg nails_small.jpg quill2_rotate.jpg

quill_small.jpg quill_125.jpg

quill_100.jpg

quill_125s.jpg

quill_125ss.jpg align=left hspace=16 />
quill_125.jpg

-->


Hammers and nails

"I write when I'm inspired, and I see to it that I'm inspired at nine o'clock every morning." Peter De Vries

quill_100.jpg align=right hspace=16 />
I've been using Netbeans to draft my java.net weblogs of late. Because I like rich clients. And i love Netbeans. I loved Eclipse and
IntelliJ too. But you gotta pick your tool and stand by it. And go in search of nails.

Java.net weblogs is my newest nail, and i've been hammering it. With Netbeans. In particular for my last two articles, namely "Swing and Roundabouts 1: Event DTs" and "Bean Burd 2: The SQL".

The last article was a long one. I knew it was gonna be. The web browser is killer for reading, but not for writing, not long articles anyway. The "any internet cafe" convenience of gmail and blogger is great. But when I'm at home, I want something rich and fattening!


Taking off the latex gloves

"I never know what I think about something until I read what I've written on it." William Faulkner

In the past I used jEdit to edit my articles in HTML. I like HTML because it reminds of me a LaTeX, which I used for years before there was HTML, and years after HTML came along too. But in the new millenium I switched to HTML with CSS.

HTML and CSS are great because your style and content are separate,
so you can focus on your content, just like LaTeX. For example, you can define a style for your code samples as follows.

.code { 
   font-size: 9pt;
   font-family: courier;
   background: #fcfcfc;
   padding-top: 0px;
   padding-left: 15px;
   padding-bottom: 15px;
   margin-top: 2px;
   border: 1px dashed green;
   border-style: dashed dashed dashed dashed;
   page-break-inside: never;
   color: black;
}

Add a few other styles, eg. for document title, subtitle, section headings, subsections, and you're good to go.

You can change the style in one place, and your whole document automagically falls in line. That's how it should be! Blindingly simple, yet incredibly powerful :)


One zip to view them all

"The difference between fiction and reality? Fiction has to make sense."
Tom Clancy


yast_zip.png border=0 align=left vspace=8 hspace=16 />

All I wish for is an ODF-type standard format for zipping your HTML, CSS and images into one file that Firefox and Thunderbird (for starters) can understand and view. Like a PDF for the web. Let's call it IDF for Internet Document Format. So it's just a zip file with an index.html. Sweeet.
You heard it here first, ladies and gentlemen. Forget all those other people who said it before!

Now where the flock was I? Flock is my mother's word, for... So it's my mother's word, but I use more than she does.
-->


Counting the time

"Only those things are beautiful which are inspired by madness and written by reason." Andre Gide

I've found with long articles, it takes a day to write two pages. I wrote this Swing article last year. The first draft took 5 days, and was 12 pages. I was bored so I decided to extend it. To cut a long story short, it ended up being 45 pages, and took about a month, ie. 22 days.

And this 15 page SQL article took me 8 days. So that's two pages a day, by all accounts.


Bizarre cathedral

"I love being a writer. What I can't stand is the paperwork."
Peter De Vries

Cathedral1-150.jpg align=right hspace=8 />
The bitter moral of the story? Keep it short and sweet. Break it up into multiple parts. That's what's great about blogging. And opensource. "Release often." Don't build cathedrals, build bazaars. No that's not it. Don't build cathedrals in one release, is what it should be.
Using bazaars, or something. Ok, I flocked it up, sorry Eric. Send me a signed copy of your book, so i'll never flock it up again, please, please!?

Eric Raymond is really a great guy. How do i know? He stayed with me, in my house! Actually, very small apartment. He was visiting Cape Town, and our LUG appointed me to accomodate him. My impresssions of him before I met him was that he was an arrogant gun-toting guy. Then you meet the chap, have a few lunches with him, and you quickly realise why he is leading our movement. He is a diamond twinkling in the rough. Not arrogant at all. A humble, extremely knowledgeable person that you wish you could marry so that you could listen to him all the time. Because he is so fastinating to listen to, about anything and everything. Besides computers I mean! Throw a
dart at wikipedia and you'll enjoy his input on the subject of whatever your dart hits.

OK, lemme focus. It's difficult to stay on track today... well, most days actually.


Public display format

"I have always been a huge admirer of my own work. I'm one of the funniest and most entertaining writers I know."
Mel Brooks

So this long 45 page article that I was writing, I edited in jEdit as an HTML document, with a few lines of CSS at the top, and used Firefox to preview it. You know the drill, Ctrl-S Alt-Tab F5. And then I used PDFCreator to print it from Firefox to a PDF file. PDFCreator is the dogs!


font_type1.png border=0 align=left vspace=8 hspace=16 />

The point is that I was using deliberately using HTML to produce a PDF document! Isn't that wikkid cool in a beautifully twisted way? An advantage I guess is that you can readily put the article up on the web. Although I didn't do that with that article, because the company didn't reply to my request to publish it under a creative commons. Doesn't matter, I'll write it again, right here on java.net,
piece by piece.

But that wasn't why I was writing it in HTML. I was writing it in HTML because HTML/CSS is my first choice of document formatting language these days. True Story.


Blogger with a beanie

"Most writers regard truth as their most valuable possession, and therefore are most economical in its use." Mark Twain

penknife.jpg
So the past week I spent writing this SQL article in HTML.
The difference is that I'm not using jEdit, I'm using Netbeans!

Now, I've written a few blogs along the lines of "Netbeans is my hammer." You could say that this is a common thread running through all my blogs. Some of them are about "IDE vs non-IDE" and others about "IDE-exploiting designs vs non-IDE-exploiting ones." I don't wanna get too deep into that here and now... Ok I will, I can't resist it.

These days I'm finding myself designing for IDEs. I guess in the past, software/language design didn't consider "IDE-leveragability" and refactorability, i mean as crucial factors to weigh in?

I'm a fairly recent IDE convert. I spent 20 years programming without an IDE and then the past 2 years with a IDE. And you know what they say about religious converts. Something about them being the most zealous advocates of IDEs.

I've always been obsessive-compulsive about code. It must look beautiful, and be consistent. I don't want any broken windows. Not even one. If i find one broken window, I gotta fix it immediately.

So IDE refactorings are the bomb for me. Actually mostly just the renaming. OK, so that's why i like IDEs, and design for IDEs.
Now, back to the main thread.

The Rub

"Our admiration of fine writing will always be in proportion to its real difficulty and its apparent ease." Charles Caleb Colton

In general I prefer to use rich desktop applications, rather than pedestrian web-based ones.
Actually pedestrians aren't lame, so maybe that's not a fair analogy ;) For example, I use Thunderbird, Open Office, and jEdit. And Netbeans.

pen_and_glasses_crop2.jpg align=right hspace=16 />
Now the trick for editing your java.net weblog "offline" using a fat and rich client (software), is as follows. (If you need this, you're probably doing it already, but thanks for reading my blog anyway. The reason one writes is in the hope that someone, somewhere, will read it, so thanks!)

So try this. In Firefox, view the "Page Source" of one of your published weblog articles, and cut and paste all the buff up to where you start your blog eg. "Once upon a time, on a webserver far far away..."

Cut and paste all that into an HTML file in Netbeans, and start writing your blog below that. And then you use my favourite keystrokes in the whole world after F6, that is Ctrl-S Alt-Tab F5.

Finally, when you're finished the endless cycle of editing and previewing your long article, you cut and paste your content into your blog entry and publish!

Having completed this story, i have realised that this really is much a blog about nothing. Self indulgent, pitchy in parts, and i didn't work it out at the end. Sorry about that! It seemed like a good choice of song at the time.

Related Topics >>