Rethinking the "Changes" feature in SAB

There are a number of times when the “Changes” feature doesn’t do as much as I need it to do. Here are a few examples:

I would like to make a change, but in some source files (like appendices), it does bad things. How about defining/limiting Changes to a specific book or collection?

I would like to limit Changes to a particular context. Any possibility of implementing what they did for RegExPal in Paratext? Which is search within a search:

This would give additional control over changes.

There are times when it would be helpful to pre-process a source file with a script, like a Python script. (See RTL numeral issues - #13 by CraigN for an example.) SAB could pump the source file through the script (maybe just using stdin and stdout, to make things easy), and use that version of the file to produce the app. I assume it does something similar with the current Changes (makes changes, stores that temporary result for use in the app, and in fact the Source tab can show you the changes made). This could be a setting for a specific book or collection, and we could assume that the script engine required is properly installed on the system - SAB would just shell out that job to produce the output.

In Scripture App Builder 8.5, you can define book collection specific changes.

Excellent! That’s a good start…

It would be good if look aheads and look behinds could also be supported.
You could specify which book to change by adding this to the end of your regex e.g.

(?<=\\id GEN.*?)

for Genesis, or e.g.

(?<=\\id (?!GEN).*?)

to exclude Genesis.

This type of regex can be very taxing on your system and tends to work better, the more specific your regex preceding it is.

\\c \d+(?<=\\id GEN.*?)

will probably fail, but

\\c 1\r\n(?<=\\id GEN.*?)

will be much easier on your system.

1 Like