helps you have more fun with knowledge creation

Piggydb user Jerome J. Slote kindly shared his tips for modifying the existing look and feel of Piggydb, and moreover, an interesting way of extending the text formatting beyond the wiki markup set.

You may recall that I was looking for ways to insert invisible metadata into fragments: in particular, dates and tags that carry over from other systems when importing.

It turns out Piggydb has a “backdoor” capability that advanced users might find quite useful: text formatting in fragments, beyond the wiki markup set. This includes font changes, colors and highlighting, as well as the format I was seeking, invisibility.

The key is in the Stylish extension to Firefox, which superimposes style sheet specs that can be edited and toggled within the browser. I’d been using Stylish previously to customize Piggydb’s overall look and feel: serif font, eye-saving green background, a larger edit box, a smaller H1 display font in document view, and, most relevant to broader text formatting, the removal of internal tag highlighting in document view.

Style sheets, as you know, can alter the formatting of linking text according to the link’s target. So extended formatting can be accomplished by using dummy links whose format specs have been set up in the Stylish system.

Appended below is my Stylish sheet for Piggydb. You’ll notice a date format “dt”, a highlighting format “s1”, and an invisibility format “s0”. Within a fragment, any text that links to #dt, #s1 and #s0 is displayed in these formats if the style is toggled on. The hash mark makes for a more graceful response to an inadvertent click. Of course, these formatting links can be searched, so it’s easy to locate fragments with highlighted text, for example.

Piggydb’s integration with the browser and its extensions is a core advantage over standalone systems. Thanks for your vision, and for all you’ve done to make it real.

I think it is an amazing idea to add new formatting using a “href” attribute of a link. You can even add invisible metadata, which can be used for searching, to fragments.