ezra-bible-app / node-sword-interface

JavaScript (N-API) interface to SWORD library
GNU General Public License v2.0
22 stars 2 forks source link

How could I get the cross references from a text? #62

Closed joshpetit closed 2 months ago

joshpetit commented 2 months ago

Hey there! Thank you for making this lovely interface. I've been poking around for a while and am wondering how I can get the cross references in a given text. Here's the closest I think I've gotten

function printCrossReferences() {
  var crossReferences = interface.getRawModuleEntry("NASB", "Matt.1.1.xref.A");
  console.log(crossReferences);
}

printCrossReferences();

Some help would be appreciated, thank you.

joshpetit commented 2 months ago

I realize now that the way I was doing it was correct, the cross references are clearly there I'm not sure how I missed them haha

tobias-klein commented 2 months ago

@joshpetit The cross references are part of the markup that is embedded in the sword modules and returned by node-sword-interface.

For most of the functions, the requirement for getting the markup is first enabling it with the following function: nodeSwordInterface.enableMarkup()

However, if you are using the function getRawModuleEntry you may already get the full markup without pre-conditions.

joshpetit commented 2 months ago

Thank you Tobias, I appreciate it a lot. I'm able to get the info I need ptl