If you've ever tried making an e-Sword module, you know what a time consuming task this can be. Today I want so share with you a huge shortcut you can use
when you have
clean, consistently formatted text. I need to get into the habit of sharing more information like this (it just takes time to make screenshots and write the article).
I spent less than 20 minutes making
this e-Sword module because someone gave me clean, consistently formatted text. Granted, it wasn't a large module but it could have been 10x as large and the build time would basically have been the same. (The story here is: someone asked how long until you can make this module? I said, my queue is months deep but if you'll get me
clean,
consistently formatted text, I can give you a module in half an hour.)
Every document is different. Every module will be different. So all we can use are examples but you can learn to apply these
concepts to your future projects. This example is from the Expositor's Bible Commentary (Acts, to be exact):
I started with text that looked like the screenshot below. Acts came in two volumes, so I just combined the files into one file. The text was consistent--the Chapter #, Name, and verse range was the same throughout the file. (Remember, I use Tooltip3 to make modules. So my goal is for my commentary verse reference to start with a "÷" sign followed by the verse reference. If I were making a Topic file, I would want my "÷" to be followed by the chapter name. The text of the verse comment (or chapter comment for a topic file) follows. That's our goal.)
The text started off looking like this:
formatting_tut1.png 126.85K
61 downloadsStep 1) Notice my search box in Microsoft Word. I
searched for: (Chapter [0-9]{1,2}*^13*^13*^13*^13)(*^13)
- When searching in Microsoft Word: "*" is a wildcard representing any text.
- "^13" is the end of the line. "[0-9]{1,2}" means any digit found once or twice.
- Put that all together and the search will find a line beginning with "Chapter ##", followed by 5 line breaks (represented by ^13). The last line contains the scripture reference.
- The parenthesis is what makes this possible. Parenthesis tell Word to treat the text found within the parenthesis separately. The first set of parenthesis can be referred to as "\1" and the second set as \2" and if other sets existed, they would be referred to sequentially as well. "\1" represents the first line (Chapter ##), the second line (blank), third line (chapter title), and fourth line (blank). "\2" represents the verse reference (Acts 1:2) we want to capture.
Our
replacement text is: ÷\2^p\1\2
- "÷" is simply a divide symbol that Tooltip3 needs before a verse comment. Who wants to manually insert those. I don't.
- "\2" refers to the second set of paranthesis in our search statement. Text found in that set of paranthesis is placed where our "\2" variable is. In this example, "\2" represents the Acts 1:2 verse reference in the screenshot.
- "^p" tells Word to make a new paragraph.
Step 2) When we click the
Replace All button, we see the result of our search/replace:
formatting_tut2.jpg 335.01K
53 downloadsNotice Acts 1:2 has been copied from beneath the chapter number and name and pasted to the top. A "÷" symbol has been inserted before the Acts 1:2 verse reference.
We could stop here. This is all Tooltip3 needs. We could then run this document through Tooltip 3 and generate our commentary! But sometimes our search/replacing needs a little review. Just a quick glance to make sure nothing crazy happened.
Step 3) Wouldn't it be nice to review all the verse references of our soon-to-be commentary (or chapter names if this were a topic file)?
formatting_tut3.png 177.17K
34 downloads- Notice our search box again. This time we're searching for: "÷*^13" and replacing with nothing. If you just below our replacement box, you see "Style: Heading 1". I previously made a "style" (Georgia font, size 11, left aligned -- easy, took 1.5 seconds). Styles appear in the left Navigation column. Let's make our ÷ verse reference lines appear in that column.
- "÷^13" searches for a line beginning with the divide symbol and ending with a line break. We can trust this formatting assumption because we just created it above.
- The replacement field contains no text but will assign Style 1 to the text found (the entire ÷ line).
The result are the verse references in the Navigation column of the screenshot above. Notice we need to review our work. The second and third references have brackets {} around them because of formatting inconsistencies in our source document. We can quickly review the results of our work.
Now our document is ready for Tooltip3. After tooltipping the document (automatically in T3), we could convert to a commentary. Once our document is in the right format, we're just a minute or two from a completed commentary (or topic file if we were making a topic file)! Use MS Word's search/replace features to get the text right. Then, open the document in T3 and a few clicks later, you have a module...
You can apply these same principles to a document
if it's cleanly and consistently formatted. Your search text will be slightly different depending on where the verse reference or chapter name you need to capture is located. But this should get you started!
By request, here is the text from the Acts example above. Scroll down until you see the Chapter 1 header, as shown in the example.
Edited by Josh Bond, 04 December 2011 - 09:49 AM.