Monday, May 23, 2005

Tanach Linkify

I have created a Firefox extension called Tanach Linkify 1.5. (It is compiled from a Greasemonkey script)
  • It looks for references to psukim (Biblical verses) on web pages and replaces them with links to that pasuk (verse) at mechon mamre, a site that has Tanach (Bible) in Hebrew and English, side by side.
  • It replaces references to pages of gemara with the relevant page at e-daf, which gives an image of the page.

Note: This will only work in the Firefox Browser. It will not work in Internet Explorer.

Installation Instructions: (see upgrade instructions at the bottom)
  1. Click on the following link to Tanach Linkify 1.5. Then click on Install Now.

  2. Close and restart Firefox.
  3. Reload this page and see if the following plaintext has turned to mechon mamre/e-daf links.

    The first interesting pasuk is Bereishit 4:10.
    Do not forget Job 6:5 or Song of Songs 1:10.
    In terms of Talmud, how about Ketubot 13a, Horayos 2b, or Bava Kama daf 5b?

  4. Follow a link or two to ensure that it has worked.

This was compiled via a Greasemonkey compiler. The greasemonkey code is here: Tanach Linkify 1.3.

If you have any problems with this, drop me a comment here on this post, or else send me an email. For example, text variants of seforim that I have missed, of cases where the code fails.


version 1.4
* made compatible with Firefox 1.5
version 1.3
* Sped up execution time by splitting up regular expressions
* Added support for still more alternate spellings, such as Ksubot 3a and Breishis 4:5
* Fixed off by one amud error for Ketubot.

version 1.2 (archive)
Added feature: Names of pages of gemara now become links to the page at e-daf.
*Compiled the code into a Firefox extension so as to ease installation.

version 1.1 (archive
* Fixed bug that name attribute of the script was blank. Changed it to Tanach Linkify 1.1
* Expanded recognizable sefer name variants by using regular expressions throughout.
* Began work on recognizing references to Talmud, but did not yet enable this feature.Blockquote

version 1.0 (archive)
* Link to Tanach at Mechon Mamre, with basic spellings of seforim and some variant spellings.
To work on:
* Expand this to provide links to snunit's Bavli and Yerushalmi

Upgrade Instructions:
Make sure to first uninstall your previous version. For the Greasemonkey script, this means choosing Tools/Manage User Scripts, Selecting Tanach Linkify (or perhaps an empty line in the list, and Clicking Uninstall. For the Firefox extension, choose Tools/Extensions, Select the Tanach Linkify extension, and Click Uninstall. Then, follow the directions in the Installation Instructions above.


Joshua Tallent said...

Awesome extension! It would be great if you could add the ability to turn turn off the feature for specific web pages. I go to one page for work every day that has a lot of text and it takes the extension a full minute to finish parsing it.

joshwaxman said...

I've got to look at the code to see if there is some way to speed it up.

The easiest way to disable it for certain websites is to get the Greasemonkey version instead of the Extension. I compiled the Greasemonkey script (also linked to on this page) to get the extension, so they are equivalent.

You can go here to get Greasemonkey, which is a Firefox extension that lets you run your own javascript on webpages after they load. Once you install Greasmonkey and restart your browser, you right click on the link above, or here, to the Tanach Linkify Greasemonkey script, then choose Install User Script from the popup menu. A screen will pop up asking yuo to include or exclude certain pages. Right now, I include *, which is a wildcard for all pages, but you can exclude whatever pages you want on the bottom part of the screen (and modify these options later under the Manage User Scripts otion).

joshwaxman said...

yucs (where I am currently storing the script and extension) seems to be down at the moment, however.

Anonymous said...

Can't get it to load-is something wrong?

joshwaxman said...

yeah, yucs was down.
i moved the file, for now, to another host. it should work now.

Anonymous said...

the box moved, its sitting in my office at columbia right now. dns is taking a while to update

you can connect to it at (have been planning to move it for a while so that was there, but it will go away once dns is stable again)

Anonymous said...

Thanks for the great extension!

The following did not linkify: "Gittin 57b" (other links on the same page did generate, like "Sotah 6a" and "Bamidbar 5:27".

Yaakov said...

worked now...must have been something with the site (maybe some extra markup)

joshwaxman said...

thanks Shaya

Biz said...

Amazing! Tizku Lemitzvos! der Z'Chus zol dir bayshtayn!

And what happens to Brachot 1a :)?

Yvel273 said...
This comment has been removed by a blog administrator.
joshwaxman said...

I changed where it was stored, such that the need to open in a new tab is not the correct action to do. I'll change the instructions. Now, simply click on the link.

joshwaxman said...

make sure you are running the firefox web browser, and also try closing and restarting firefox. it won't kick in until you restart.
I'm deleting your previous postings, as per your request.

Yvel273 said...

Yes, I'm using Firefox. I think
it's easier to install the
Greasemonkey extension directly
from the Menu (Tools..extensions..
search "G..").But I'm still unable
to use it. Anyway , thank you for
your work and assistance. Tomorrow
I'll find the way. Erev tov !

Anonymous said...

This is a phenomenal add-in.

2 Questions

1. Can this be made to open the link in a new tab? (Normally I don't have links open in a new tab.)

2. I don't know whether it's linux, the Machon Mamre site, or the script, but could you guess why when I link to Tanach text I get this:

יב כִּי תַעֲבֹד אֶת-הָאֲדָמָה, לֹא-תֹסֵף תֵּת-כֹּחָהּ לָךְ; נָע וָנָד, תִּהְיֶה בָאָרֶץ.

This doesn't look like the site - it's either something wrong with my set up (I'm investigating that) or the layout gets munged, and cut and paste just carries over the problem.

I'd love some feedback on this one.

joshwaxman said...

In terms of #1, if you work of the Greasemonkey script, you can change the links generated to have target="_blank" in the anchor tag. Then change Firefox to open such links in a tab rather than a window.

In terms of #2, I'm not sure. I'm not running Linux, but even the text you cut and pasted looks perfectly normal to me.
You might try changing the Encoding to Unicode, or to Windows Hebrew. Perhaps mechon mamre contains the encoding information on the page (at the top of the html - view the source), which is not the case elsewhere.

Anonymous said...

Anonymous said...

i installed the extension and promptly forgot about it .. i kept noticing sites that linked pesukim to mechon-mamre, I was really impressed that people cared so much to link psukim. then I landed on a US government site that mentioned a passuk, and it was linked to mechon-mamre.. i was like wait a minute.. i vaguely remember installing a bunch of extensions.. so I looked, and sure enough, all this happiness is thanks to you and there's no greater web awareness to link pages to mechon mamre.. it is a great enhancement to the web experience..

btw, what is missing is a similar script you can plug html into and get out mechon-mamre enhanced html.. which would be nice if you wanted to put the links in your own site, instead of hoping your visitors have Tanach Linkify...

Anonymous said...

it does not work with firefox 2, can u update? thanks.

Joel Nothman said...

I've been considering doing this or something like it for some time, but have never got around to it. It would be worthwhile releasing it as a bookmarklet so that (1) it is cross-browser [althoguh already if greasemonkey can do it then Opera can probably handle it]; (2) it is only activated when you want it.

I at one point attempted to make the linking on Wikipedia to bible sources consistent, but flexible. For this I made the script which needs some updating and new features that I haven't had time to implement, but allows many verse reference formats and many sources for results. For example, your system fails to cope with Roman numeral references, or Hebrew numerals. It also only shows the Mechon-Mamre Parallel look, when one might want it with cantillation, or targum, or with Rashi. You might consider linking there.

I also have in planning a similar system for amudim of the Babylonian Talmud, linking to various online resources relating to it.

Please contact me also if you are interested in collaborating or have suggestions to make. Thanks. Chag sameach.


Blog Widget by LinkWithin