Legends Viewer is a utility that loads up the legends you can export in a much more usable format than the Legends mode of DF itself. Legends Viewer can open pages in new tabs, filter information on a wide range of criteria, and display information on the map as well. Binaries are only available for Windows, as well as the source (written in C#).
It takes four files as input: the legends XML file, the sites and pops text, world history text, and a map image. It can load these separately, but it is recommended to load them as a single compressed archive (folder) - the XML can be multiple GB uncompressed for long histories, and reduce to less than 5% of its size.