Home Link

Hello, my name is Brett Terpstra, and it’s nice to meet you. Elegant solutions to complex problems. Curious?

Posts Tagged ‘javascript’

  • Jan
  • Feb
  • Mar
  • Apr
  • May
  • Jun
  • Jul
  • Aug
  • Sep
  • Oct
  • Nov
  • Dec

Dec 31
2009

I made a cou­ple of minor changes to the Clip­pable book­marklet, mostly in the way it han­dles Syn­tax­High­lighter code blocks. The Syn­tax­High­lighter plu­gin is used (too) often to for­mat and color code source snip­pets in web­sites. The result when clip­ping a page is that the code you get still has line num­bers, but no option to view the raw source with­out going back to the web page. Then you end up man­u­ally edit­ing out the line num­bers if you want to copy and paste the code, which can be a pain in most cases.

Since the point of Clip­pable was to deal bet­ter with things like code blocks (espe­cially for sav­ing snip­pets to Ever­note), it now removes the tool­bar and line num­bers from Syn­tax­High­lighter blocks. It also looks for another com­mon tech­nique: con­vert­ing lines in code to an ordered list inside of a pre block. This is just blot­ted out with CSS now. Those are the only two high­light­ing meth­ods it tar­gets at the moment, but I’ll tackle more as I run into them.

If you already have the book­marklet installed, you’re already ben­e­fit­ting from these changes (the book­marklet calls the source scripts on my server, so it is, in essence, auto­mat­i­cally updated). If not, just cruise over to the Clip­pable page and grab it!

Nov 02
2009

So my mod­i­fi­ca­tion of the Read­abil­ity book­marklet kind of snuck out before it was ready, but it’s my own fault. Now I’m scram­bling a lit­tle to make it more pre­sentable and less of a straight-up hack of the excel­lent orig­i­nal. I wanted to make a few things clear about my goals and pur­pose on this one.

First the entire project was really a sub­set of my attempt at a bet­ter Ever­note clip­per for Snow Leop­ard. One which allowed me to pre­serve code for­mat­ting and auto­mat­i­cally remove com­ments and ads from the post, in a smarter fash­ion than the cur­rent Safari clip­per does. I built it as a Sys­tem Ser­vice and run it with a hotkey. You can down­load it and try it out, if you like. I’ll make a more acces­si­ble ver­sion with instruc­tions shortly.

This is why I removed the for­mat­ting options from the book­marklet… Ever­note was going to strip all of that out any­way. Orig­i­nally, I was just using the code to strip out ads and find the meat. The mod­i­fi­ca­tions to pre­serve code blocks, movies, etc. were sim­ply work­ing toward the “per­fect” Ever­note clip.

It works for what it is, but wasn’t really intended to be used with­out the Ever­note Ser­vice. If I get enough feed­back, and no cease and desist orders from the orig­i­nal cre­ators, I’ll con­tinue to mod­ify it. One thing you can cer­tainly do to help is pro­vide me with URL’s to pages it fails on; the more sce­nar­ios I can study, the smarter I can make it.

Entries (RSS) and Comments (RSS).

Switch to Mobile version