Thursday, February 13, 2014

GEDCOM Plugin for Notepad++: Now with Automatic Install

Earlier this week, the GEDCOM plugin made it to the official list of Notepad++ plugins. Registering a plugin and getting it accepted is fairly easy. But there is a big benefit to the user: your desired plugin is just a click away. No more downloads, unpacking zips, and copying files to multiple directory locations.

You can thank the Plugin Manager (also a plugin!) developed by Dave Brotherstone for this effective system of plugin management. When you register a plugin, you supply the information the Plugin Manager needs to find your zip (a download URL), identify its version, and tell it what needs to be extracted and where it should go. With just that information the Plugin Manager can perform installs and updates of registered plugins. It does this magic and also stops and restarts Notepad++ to make the changes take effect. And if the plugin doesn't do what you want, it's just as easy to remove it.

Plugin Manager also updates its list of available plugins from the plugin registry. There are actually two lists, a list of registered but not yet vetted new or updated plugins, and then the current official list which is downloaded by Plugin Manager. When you issue the command Plugins->Plugin Manager->"Show Plugin Manager", it displays the current official plugin list. Here is a screenshot of that from version 6.5.2 of Notepad++ taken today (13 Feb 2014):

You will notice that GEDCOM Lexer is still at version 0.1. Generally, Plugin Manager will lag behind the latest and greatest, for that you may still need to do a manual update.

Wednesday, February 12, 2014

New in GEDCOM Plugin v0.2: Navigating by NAMEs

GEDCOM Plugin v0.2 can now use the Function List to navigate to individual names. This allows you to double-click a name in a list to go directly to that INDI record in the GEDCOM file.

Notepad++ has a Function List plugin that comes already installed (more...). At one time this was an independent plugin developed by Jens Lorenz, but has been integrated into the main program since version 6.4.

The Function List panel (shown above) can be displayed by clicking the "Function List" command under View on the main menu. Any file type can define a rule for filling the Function List panel. Each node in the list serves as a hyperlink to a location in the file. Double-clicking on a node will take you straight to that file location. The larger image below better illustrates the relation between a viewed file and the Function List panel.

Setting up the Function List for the GEDCOM file type requires adding two entries to Notepad++'s functionList.xml configuration file. This file is user specific, so it is located in the directory: %APPDATA%\Notepad++.

The first entry associates the function list rule with a particular language and this takes the form of an <association> element under the <associationMap> section. For GEDCOM add this element line:
<association langID="XX" id="gedcom_name"/>
The "XX" following langID is a placeholder for whatever language ID number has been assigned to GEDCOM for your installation of the plugin. For Notepad++'s internal languages, there are fixed numbers assigned to each language (file type). But for external languages, this number can vary depending on what version of Notepad++ you are using and whether you have other external languages installed. Starting with v0.2 of the plugin, this langID is determined for you and displayed in the About dialog ("57" in this example):
The second entry defines the function list rule as a pair of regular expressions and takes the form of a <parser> element under the <parsers> section. To populate the Function List with NAMEs from GEDCOM INDI records, add this block:

<parser id="gedcom_name" displayName="GEDCOM Names">
    <nameExpr expr="(?&lt;=([\d][\x20]NAME[\x20])).*?([\r]|[\n]|[\r][\n])"/>

Note that if an INDI record contains more than one PERSONAL_NAME_STRUCTURE, only the first one encountered will be displayed. To learn more about the Function List see the Notepad++ Function List page. To download this example functionList.xml file, grab it from the SampleFiles area on SourceForge.

Tuesday, January 28, 2014

Announcing: GEDCOM Plugin for Notepad++

GEDCOM file in Notepad++ with GedcomLexer pluginI have been looking at raw GEDCOM files quite a lot lately. I usually go to the Notepad++ text editor for this because it is good at recognizing file encodings. Notepad++'s popularity derives from it being open-source and general-purpose, robust and lightweight. Many plugins have been developed for it to extend its capabilities to more specialized uses (especially for programmers). So that prompted me to cook up a GEDCOM plugin to provide syntax highlighting and folding.
Technically, this is a lexer plugin (GedcomLexer.dll) for GEDCOM files. A lexer is a program that performs lexical analysis, in this case of GEDCOM files. The lexer follows the data representation grammar of GEDCOM specification version 5.5.1. It recognizes the possible tokens in a line: level, xref_id, tag, user tag, pointer, value, and escape. Each of these tokens has a default style supplied by the plugin which can be customized through the Notepad++'s Style Configurator. When an invalid character in a token is detected, the lexer enters the Invalid state and outputs the remainder of the line in the Invalid style (default red).
In the current release (0.1.0), folding (hiding detail text) is based on the line level. In GEDCOM files, logical records begin at line level 0. Subordinate lines with levels 1 or higher contribute to the logical record which was defined by the level 0 line that preceded it. So, folding allows a user to see only level 0 lines (logical record starts) or level 0 lines plus selected additional levels, giving the user some control over the amount of detail displayed.
The plugin has been tested with a variety of GEDCOM files (*.ged), including UTF-8, UTF-16, ANSI, and ASCII. In release 0.1.0, the ANSEL character set is not supported.
This is released as an open source project on SourceForge: GEDCOM Lexer Plugin for Notepad++. A ZIP file of the plugin and install instructions can be downloaded here.

Popular Posts


Total Pageviews

Follow by Email