Version date: 3/22/04
Billym's Little Paragraph Program
(To close this file, click on it and then press Escape - "Esc")

I wrote this little Paragraph program, paragraph.exe, as an aid to preparing short articles for posting at the Rumor Mill News Forum. It solves a number of problems when preparing text for posting on the Internet, including HTML formatting, and straightening out text copied and pasted from Emails. You can actually make simple web pages with it. I simply write all my articles in this program, format them, and then simply paste them into the forum input box.

1. Fixing Fixed-line-length Text

The main problem this program solves is making wordwrapped text from text copied from Email or other sources which have fixed line lengths. Often when pasting text from certain sources, such as Email,  into a wordwrapped environment, the lines become ragged and of uneven length. This is because of the presence of paragraph marks, called "hard" returns. Paragraph program removes these so that your pasted text will be properly wordwrapped in the new environment. 

There are 3 ways to format the paragraphs: 

a. With blank line between paragraphs
b. Indentation of first lines of paragraphs (no blank line)
c. Both indentation and a blank line.
d. Additionally you can reduce multiple blank lines to just one blank line between paragraphs.

2. Inserting HTML Tags

You can add HTML tags to selected text for use in webpages, or for pasting into certain forum forms on the Internet which accept HTML tags (Like Rumor Mill News and Surfing the Apocalypse forums). The process is simple:

a. Select the text with the mouse cursor
b. Apply a tag by clicking a tag button ("Bold," "Italic," "S6," etc.)
c. Possibly click another tag button to add another attribute.
d. Each tag button puts the appropriate tag before and after the selected text
e. You can click another tag button to add multiple tags.
f. See explanation of these tags below.

Mass Tagging
You can also perform "mass tagging" which simply means to apply a certain set of HTML tags to a certain selected text wherever it appears in your document. This is useful for things like book titles or movie titles, or other special text which needs consistent formatting wherever it occurs. It is also useful for things like transcribed interviews where you want each person's name in bold each time they speak.

a. Click the "Apply Mass Tags" button
b. Check the tags you want to apply
c. Type in the text you want the tags to apply to.
d. If you select the text first it will appear in the edit box
e. Click the "Do Mass Tagging Now" button.
f. Click the "Test!" button to see how it worked
(03/03/04 - Check for errors.. still tracking a bug at this date)

3. Testing Tags in Browser
You can see how your coded text will look by pressing the "Test!" button. This makes your text into a temporary ".htm" file and opens it in your default browser. If you are using IE the browser will open in a new window, otherwise it uses the last browser window that was open, or if none is open, it starts up the browser. By using the test button you can correct any errors that may creep in.

4. Cleaning Text and Swapping Characters
Sometimes when copying text from various sources strange characters may creep in. This is because they may have originally been from sources which used "high-bit" character for the apostrophe, or the quote marks, or other special characters. Paragraph lets you clean these out or replace them with the appropriate characters. There are two panels for this: Removing characters, and Replacing characters.

a. Removing characters
1. Click the "Characters" button and the Character panel will appear.
2. Check any number of characters for removal.
3. Click the "Clean Checked" button. The characters will be removed.
4. Since different fonts sometime have different "high bit" characters, you can change the fonts in the lists.

b. Replacing characters
1. From characters panel click the "Swap Chars" button
2. Now there are two lists, chars to replace, and what to replace them with.
3. Click a character in right list, then double click in left list with the character to replace it with.
4. Each character pair will be added to the two edit boxes at the bottom of the panel so you can see them.
5. (An alternate method is to just add the characters in the edit boxes).
6. Click the "Do Replacements Now" button and the replacements will be done. 

An example of replacement that is common is something pasted from a word processor which used high bit characters for the leading and trailing quotation marks. If you see this has happened, click on the high-bit character for the leading quote mark in the left list, and double-click the ordinary quote-mark in the right list, and do the same for the trailing high-bit quote mark. Then the high-bit quote marks will be replaced with ordinary quote marks, "cleaning" your document.

Inserting HTML Character Codes

Another feature of the character panel is the insertion of HTML codes for individual characters. Just double-click on a character and it's HTML code will be inserted, such as this one, for character 189:  &#189;

The high bit characters (numbers 128+) are not the same in every font, so you can access a symbol not available in the font you are using by putting the appropriate font tag on the HTML character code. For example, the symbol for one-half (#189) is not available in the Arial font but is available in Courier. So if you were using Arial and wanted to use the one-half symbol from Courier it would look like this: <font face="Courier New">&#189;</font>

5. Other Features & Utilities
There are a number of other little features which operate on your text. More are being added as I write this! Here are some of them. Click the button "More Stuff" and you will see:

a. Strip extra lines between paragraphs.
This enforces that there is one and only one blank line between paragraphs. 
b. Alphabetize the lines in your file
This applies to the paragraph as a whole, that is, the text is "un-wordwrapped" before this operation so the "lines" that are alphabetized are in fact the the paragraphs, each paragraph being a "line."
c. "Specify and remove chars" 
This is an alternate way to remove characters and is easiest when you want to remove typable characters rather than high-bit characters. Just type the characters you want to remove. It's especially handy when you are working with text from the "quoted" part of an Email which usually has a character like ">" at the head of each line.
d. Insert a separator line
This lets you insert a line between sections of your document. You make it up by specify 1 or more chars to repeat, and the number of repetitions. This allows a great variety of line types. A typical one might be an equals char ("=") repeated 50 or 60 times.
e. Capitalization
You can select a chunk of text and make it all capitals, all lower case, or "normalized," which means lower case with first letter of each sentence capitalized.
f. Search and Replace
This is familiar. It works as it does in most word processors. Type the text you want to search for and what you want to replace it with. If you want to search for whole words only (not words within other words) check that box. Match case means just what it says.
g. Internet search features
This program was originally written to help me write articles for Rumor Mill News forum, which often involved researching things as I went along, so if you are connected to the Internet there are several web search tools you can use. These are accessed by right-clicking when you are in the text window. First select a word or phase in your document you want to look up.

1. Merriam-Webster search. Often when writing you may want to check the meaning of a word, or its spelling. This looks up your selected word in the Merriam Webster online dictionary.
2. Google search feeds your selected text to the Google search engine and your browser will open the results.
3. Because I was using this for Rumor Mill News articles there are also searches specific to Rumor Mill News and Rense.com

h. Recent files list
The program keeps track of the last ten files you had open. Right-click in the text window and choose "Recent Files" and then choose the file you want from the list and it will be opened.

h. Remove extra spaces
Sometimes you will come across text that has been pasted from a source which had both right and left edges justified, which is accomplished by adding bits of space between words. When pasted into plain text this can create extra spaces between words. This feature fixes that so that there is one and only one space between words. 

First select the text you want to fix. (Ctrl-A selects All text). Then click the "Remove Extra Spaces" button.

Unless you have special reasons for having mulitple spaces somewhere, such as if you are using indentation, often doing this process on your whole text is a good idea, to assure it is nicely formatted throughout. In most ordinary text you don't want more than one space anywhere.

i. Add quotation marks
This feature allows you to select a bunch of paragraphs and put quotation marks on them show that they are quoted material. The paragraphs are assumed to be continuous, so each paragraph gets a beginning quote mark except the last paragraph, which gets beginning and ending quote marks. Each paragraph is scanned first to see if it contains any quote marks, and if it does these are first replaced with single quote marks. This takes care of most situations.

NOTE: Be sure to format the paragraphs first with blank lines before adding the quote marks or you will get quote marks on every single line!

i. Setting your desired browser
You can set the name of the browser program you want to use for testing your pages when the "Test!" button is clicked. Click "More Stuff" and you can check one of the 3 main browsers: IE, Netscape or Opera. Or you can check "Other" and find any other program you want to use.

j. Setting your custom colors
You can set up to 16 custom colors any time you use the "Color" button. You can save and load these on the "More Stuff" panel. You can make as many of these little color files as you want. The last one loaded will be loaded automatically the next time you run the program.

k. Make document into a Web page
Your document can be turned into a full web page for putting on the Internet. Click on "More Stuff," click the Make Web Page button and fill out the form. "Title" is what will appear in the browser's title bar. "Description" and "Keywords" help the search engines index your page. You can also put in the URL of a background image, or set the color of the page background.

When you are done, save your document with a ".htm" or ".html" extension so a browser will recognize it (e.g. "mypage.htm").

6. Explanation of the HTML tags
The way that HTML tags work is fairly simple. It places a tag before your selected text, turning a given attribute ON, and another after your text turning it OFF. Here are examples of what happens to "Your selected text is here" when you click on the various tag buttons. These tags format your text when it is presented by a web browser.

Clicking the bold button:
<b>Your selected text is here</b>

Clicking the italic button ("em" means "emphasis")
<em>Your selected text is here</em>  

Clicking the underline button:
<u>Your selected text is here</u>

Clicking the "S6" button (Largest font size):
<font size="6">Your selected text is here</font>

Clicking the "Times" button sets the font to Times New Roman
<font face="Times New Roman">Your selected text is here</font>

Clicking the "Block" button will indent the selected text
<BLOCKQUOTE>Your selected text is here</BLOCKQUOTE>

Clicking the "Color" button lets you pick a color for your text, this is RED
<font color="#FF0000">Your selected text is here</font>

Clicking the "Image" button lets you enter a web address (URL) to a picture on the web.
<img border="0" src="http://www.addressofsite.com/somepicture.jpg"><br>

Clicking the "Link Selected" button makes your text an Internet link to a URL you enter.
<A HREF="http://www.addressofsite.com/"> Your selected text is here </A>

Clicking "Any Font" brings up a panel which lets you insert a tag for any font and style. Select the font you want from the dropdown list. (Remember, if this is for the Internet not every user will have the same fonts that you have, though their browser will try to find the closest match). Check the boxes for character style, size, and color. 

Clicking the "Bookmark" button will insert a tag that makes the selected text a bookmark. This means you can make a link to that specific place from elsewhere in your document by selecting some text and choosing the bookmark from the bookmark list next to the bookmark button.

Clicking "Break" forces the text to the next line.
Clicking "Paragraph" forces the text to a new paragraph (space between lines)
Click "Line" inserts a horizontal line

7. Inserting a Table into your Document
If you click on the "Make Table" button a form will appear where you can make an HTML table which allows formatting text into columns and rows. You design your table and enter the data, then click the "Make HTML" button to create the code for your table, then click the "Copy Code" button to copy the code, then click the "Close" button to return to your document and paste the code in (Ctrl-V). 

(NOTE: The Table Maker is still a work in progress :-) as of 03/04)

Here are some further tips:

1. Set the number of rows and columns you want using the "Rows" and "Cols" controls at the bottom.

2. You can also control the row height and column width at the bottom. However, so far only the column width setting is active as far as the table appearance goes. Further control is coming soon! To push a column over to the right, leave a blank column to the left of it and set its width to whatever you want.

3. Set the HTML settings at the bottom. This will affect how your table appears.
a. Cell spacing sets how far apart the cells are, in pixels.
b. Cell padding sets how much space is around your text.  
c. Alignment affects whether the cell contents are aligned Right, Left or Centered
d. Border sets how thick the grid lines of the table will be. A setting of zero will make a table which has no lines at all, just the text.

4. If you right-click on the table you will be able to save your table as a comma delimited text file, and also to load a comma delimited text file you have previously save. A comma delimited text file simply means a text file which has one line for each row of the table, and each line has the text for the columns separated by a comma.

You can use a different character to delimit the columns however, for example if your cell text itself contains commas. You have a chance to change the delimiter character when you save or load a table file. 

As of 03/13/04 there is no special formatting of the text in the cells, although I would like to add this later. NOTE: There is still a bug (error) which occurs sometimes when changing number of rows and columns. This is not a serious bug and should not affect your work. Working on it.

8. Inserting a List into your Document
There are two kinds of lists, ordered and unordered. Ordered lists get numbered and unordered lists have bullets. Click the "List" button" and enter or paste your list items into the list box. Choose "ordered" or "unordered." If you like you can check the box to put a blank line between each list item. Finally, click "Paste Code to Document" and the HTML code will be inserted. If you want the list indented, select the list code in your document and click the "Block" button.

You can have whole series of paragraphs be numbered or bulleted by simply pasting them into the list box and proceeding as above. You will notice there is no wordwrapping in the list box. This is to avoid numbering the wordwrapped lines rather than the real lines.

Special Search-Link Tags
There are 4 special search tags you can apply to selected text. These make the selected text into a link to a Google search of the selected text. The user's browser will open with the search results. There is a general Google search, and searches specific to Rumor Mill News and Rense.com.

You can also insert a search tag and specify any website and a link will be inserted to search just that website. These searches will search for the selected text by default, but you can edit the search terms fed to Google to make the search more exact.

These special search tags can be a real boon to your readers by giving then a really quick way to get to other material regarding what you are writing about.

Using this Help File - it doubles as a scratch pad!
Because this program is quite simple, you will learn it fairly fast and probably not be needing this help file for long. So I made it possible to use it as a scratch pad. When writing articles I often want to quote some other article, so you can load a file into this help file window, copy things from it into your main window, and save it (just don't call it "parahelp.rtf"). 

Just right-click on the Helpfile window and choose "Load another file," and you can have that file available to copy stuff from into your main window.

Perhaps there is a file you want to copy things from often. An example could be a file of boiler-plate responses for pasting into email, or a collection of statements or articles  you are posting to many places on the web. In that case you can make a certain file you have loaded become the new default "Helpfile," which means it will always be loaded at program startup.

NOTE: Remember throughout that the shortcut for copying selected text is Ctrl-C, and the shortcut for pasting text is Ctrl-V. Also, Ctrl-A will select all the text in the window.

NOTE: To quickly close the Helpfile window, just click on it and then press the Escape key ("Esc").

Memos Feature  More scratch pads!
When writing articles you often want to quote text from various sources. Clicking on the "Memos" button will open a window with five scratch pads on it. You can load up to four files here, edit them and save them. There are buttons for ordinary cut and paste, as well as a special button "Paste to Document" which closes the scratch pads and pastes your selected text into your main document.

Clicking the "Memos" button also brings up the fast File Finder panel. Here you can quickly navigate your disks to find files you may want to quote from. Double-click the filename to open the file in the Memo editor that is currently selected. Right-click in the file window to delete or rename a file. 

NOTE:  In the "Memos" window there is a "Format" button which works like the "Format Paragraphs with Blank Lines" button on the main form. However, since the Memo editors are in fact Richtext format windows, be aware that you will lose your Richtext formatting when you press the Format button, and in some cases the file may get squashed to a single paragraph. The format button is there mainly to format text pasted from emails.

When you close the program the filenames of your Memos are recorded so that when you run the program again these file will be automatically reloaded.

=================================
More Notes & Tips

1. "Clear All Text" warning can be turned off for faster work. A friend of mine objected when I added the warning notice when clicking the "Clear All Text" button. I know what he means. When you get good at a program these little delays can be annoying. So I made this warning optional. Click the "More Stuff" button and you will see that you can turn off this warning.

Some Known Bugs:

1. Sometimes after certain mass operations like character replacements some html code shows up in your document when you test it in the browser. The happens especially where there is a complex tag, like the Google search links. It is usually due to a broken line in the middle of a tag. I am trying to track this down and prevent it. For now, the work around is to manually fix the broken tag line by rejoining the lines where there error occurs. 

Added features:

03/06

Test button now opens in new window if IE is default browser. Need to find params for Netscape?

added normalize for frontpage yesterday.

format with blank lines now works on selected text if selected, otherwise whole file if nothing is selected.

fixed error in dbl-click char box to insert correct char code

03/09 - remove extra spaces, added hints. Added "Any Font" tag button so a tag to any font may be inserted.

03/10 - added new panel for "Any Font" allowing to set any font including styles, size and color all at once. I like it! Uses two Jedi components.