Line Selection Feature Added to OGD Archive

by Planetperson
Example of linking to specific lines.

One of the ideals I strive for on this site is to make BIONICLE lore accessible for new fans, so that they can enjoy the saga as we in the BIONICLE community did during BIONICLE’s heyday. Despite the fact that the original BIONICLE story ended nearly a decade ago, I have been pleasantly surprised by the continued vibrancy of the BIONICLE community. An example of this is that in the past few years, we have seen a surge of interest in compiling the various novels, comics, animations, etc. into a single, linear narrative through projects like Biological Chronicle and Wall of History. Compilations like these are a great way to introduce new fans to the old stories that captivated us all those years ago.

Another important aspect of the BIONICLE saga, however, has always been the tribal knowledge passed on from Greg Farshtey on forums like BZPower and the LEGO Message Boards. How do Matoran eat? How does the system of sky-domes in the Matoran universe work? What was the name of Lhikan’s Toa team? What power does the Rhotuka spinner on Zivon’s front-left claw have? All of this information originally came from there. This is why I am especially proud of the Official Greg Discussion Archive, which has restored and preserved the “official Greg topics” from BZPower and the LEGO Message Boards, all of which have been lost in their original forms. Since those topics altogether make up over 1,500 pages of forum posts, I have aimed to make it as easy as possible to find specific pieces of information and cite them, so reference sites like BS01 can easily back up facts with their original sources.

Being able to link to specific posts in the original sources has a gone a long way toward verifying information on BS01. To pick an example completely at random, I like that I can now go to a page like “Rhotuka Launching Shield,” read a statement like “When the Toa Hagah were transformed into Rahaga, their shields were transformed into mounted Rhotuka Launchers,” and see a link to the exact forum post from 2005 where this was stated. This is a lot better than “I don’t know where this fact came from but trust me I read it 15 years ago on a forum that no longer exists.”

There are eight other questions in that post that have nothing to do with that piece of information, though. You know what would be really cool? If you could link specifically to question #9.

Like this.

That’s right! It is now possible to link to specific lines within a post. This is a feature I have been wanting to implement for a long time, as it can vastly improve citations to posts which happen to contain dozens of other questions. For now, I’ve only added this feature to the BZPower topics, but I plan to add it to the LEGO Message Boards topic in the future.

Here’s how it works. When you hover over a post, line numbers pop up to the left. Clicking a line number will highlight the line next to it, and the URL in the browser will be updated to reflect the selection. The updated URL can be used as a permanent link to that specific line.

Selecting a single line

It gets even better. You can also select ranges of lines and make multiple selections by holding down the Shift or Ctrl keys while clicking (Shift to extend the range, and Ctrl to add a new selection). You can also de-select lines by clicking them with Ctrl pressed. This selection mechanism should feel very familiar – it works in much the same way as a typical file browser or an Excel spreadsheet.

Selecting ranges of lines

I had a lot of fun working on this feature. It came with a few unexpected and interesting technical challenges. For example, I ended up writing code to ensure that the line ranges encoded in the URL are always represented in the simplest possible form, in order to canonicalize the links. For instance, to link to lines 5-10 and 15-20 in post #42, the URL uses the fragment #post42-line5-10,15-20. On the other hand, a URL with something like #post42-line5-10,8-12,13-20 would be invalid, since the ranges overlap, and the ranges 8-12 and 13-20 are adjacent. Instead, it is automatically simplified to #post42-line5-20. Another fun challenge was figuring out how to chop up the contents of each post into separate line elements without messing up the styling, and then figuring out how to un-indent the line numbers to line up evenly on the left column.

I look forward to getting some good use out of this feature on the Great Archives’ own articles. Hopefully some of you folks out there will find it useful too.