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">
 <function
   mainExpr="^[\d]+[\x20]+@[^\n\r]*?@[\x20]+INDI([\r]|[\n]|[\r][\n])([\d]+[\x20]+[\w_]+.*?([\r]|[\n]|[\r][\n]))*?[\d]+[\x20]+NAME.*?([\r]|[\n]|[\r][\n])"
   displayMode="node">
   <functionName>
    <nameExpr expr="(?&lt;=([\d][\x20]NAME[\x20])).*?([\r]|[\n]|[\r][\n])"/>
   </functionName>
 </function>
</parser>

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.

4 comments :

  1. Thanks for this update. It was 57 for me too.

    ReplyDelete
  2. my langID shows ?? (version 0.2.0.37 of the plugin and 6.5.2 of Notepad++)

    ReplyDelete
    Replies
    1. You will see "??" if N++ is less than 6.4 (not your case) or if it can't find the "GEDCOM" menu item under the main "Language" menu. Are there any customizations to your menus?

      Delete
    2. Probably my blunder. I suspect you are using a translated version of Notepad++, so the "Language" menu isn't found. I'll be making a fix for this in a new release.

      Delete

 
Copyright © . GenApps by Stanley Mitchell - Posts · Comments
Theme Template by BTDesigner · Powered by Blogger