I’ve been taking class notes on my computer (and Palm m500) for quite some time now, but I’m always left with the question of how to format them so they’re actually useful later. Plain text has formatting issues, and isn’t easily malleable. HTML looks nice, but it’s hard to write on the fly without a decent WYSIWYG editor. XML might work. Microsoft Word will not.
Last night, I finally took the time to look for a decent script that converts plain text into HTML. I found a couple of tools that offer various levels of thoroughness and complexity. Which is good, because now I don’t have to try and write something from scratch.
The first is called Gruatxt. It does all the things you would expect, like *emphasized* text, bulleted lists, horizontal rules, and headings. It’s also very good at doing tables. Unfortunately, Gruatxt wouldn’t let me nest a list inside another list, which I need for any sort of note taking. Here is a sample file, and the same file converted with Gruatxt.
I stopped my search after finding txt2html. The structure of a plain text file for txt2html is a bit less rigid, which I find an annoyance, but it does my nested lists beautifully. Again, here’s a sample file and formatted document. This is the tool I’ll be tweaking to work just right for me. Mmm.. open source.
well Gruatxt is open source, you want me to see if I can fix it for you?
Well, I could fix it for me, but txt2html already works better. So intead of coding, I will pina colada!
Might be a good exercise for brushing up on your Perl, though.
I take all my notes in class in HTML using psgml with emacs. It creates a nice template for you, knows HTML’s DTD and gives you a few keys to insert new (and valid) elements. For example, “C-c C-e” prompts to insert a new element at the cursor. “C-c +” adds an attribute to the current element (and gives you a list of possibilities). It’s pretty keen and speedy once you get used to the bindings.
I’m currently without laptop, so I’ve resorted to taking notes on the Palm now. (When I’m not on co-op, that is.
I’ve been meaning to dabble in emacs, though. I hear it’s damn extensible, and I need to learn more of the bindings anyway if I want to use bash any more efficiently.