Born Geek

Improving CoLT’s Custom Formats

January 30, 2013

To me, the single most helpful feature in CoLT is the custom format. Being able to copy link text and URLs as either HTML, Markdown, or whatever else is a real time saver. That said, I think there’s still some room for improvement in what CoLT can do. Let’s take a look at an example.

Among others, I have the following two custom formats in my current Firefox profile:

  • Markdown – [%T](%U)
  • Markdown (Selected) – [%S](%U)

The first format copies the link text along with the link URL, while the second uses any selected text in place of the link text. Both of these options are handy to have, but I’m forced to have two custom formats for something that one ought to be able to do. I also have to remember when to use each one.

Problem 1: Conditional Formatting

I would love to be able to combine the two formats above into one rule, resulting in something like the following: [%?S|T](%U). In this theoretical example, selected text would be my first option, but if no text was selected, the link text would be used as a fallback.

Problem 2: Optional Text

One CoLT user suggested a similar scenario for including optional text in the copied value. Consider this example using a differing conditional syntax: [%T](%U)%[I (%I) ]%

Here, everything between the %[I and ]% would be optional, assuming the nested %I had no value. This would allow users to insert conditional text in formats for values that may not always appear (such as the %I option, which maps to a link’s title text). However, the suggested syntax somehow seems more ugly and error prone.

Food for Thought

As a result of these usage scenarios, here are some questions for you:

  1. Is there an elegant, concise syntax that could be used for these two scenarios? I prefer the question mark-style syntax in problem 1 to indicate conditional formatting (it’s concise), but it doesn’t seem to solve problem 2.
  2. Given this kind of capability, would you actually use it? I can think of a number of scenarios where it would help me, but do others see the same kind of thing?

Any and all comments on this topic would be appreciated. And if you see ways to improve what’s already present in the extension, let me know!

Comments are closed.