New version
pielrf 2.1.
See the first post to download.
Lots and lots of changes, both new features, bug fixes, and under-the-hood cleanup.
NEW FEATURES- UNIX style "preferences" file, ".pielrfrc" and a "--write-rc" function.
- <justified></justified> tags simply remove the indent on the first line of a paragraph in any paragraphs between these tags.
- <verse></verse> tags for proper indentation of poetry.
- "--verseparindent" a NEGATIVE number which pulls the first line of the verse further to toward the left margin. The Margin of subsequent lines in the same verse are shared with "--quoteoffset"
- Added "--html-quotes" and "--trust-html" as aliases to the "--use-rdquotes" switch. They make more sense.
BUG FIXES- Fixed "<<" (double less-than). Pielrf now outputs the same number less-than signs it encounters! (I even tested it this time, so it's really fixed!)
- Formatting tags "<center>" and "<h1>,<h2>,etc." no longer create vertical whitespace when encountered... unless they are on paragraph -- this allows for more "fine grained" control of formatting.
- Bold, Italic, Subscript and Superscript can all be combined (well, not Subscript/Superscript).
- Multiple <blockquote> levels are now supported, to a maximum of 3 levels. Pielrf will not indent further than 3 <blockquote> levels -- if it encounters fruther <blockquotes>, those remain indented at level 3.
- Both "--html-quotes" (aka "--use-rdquotes") and "--preserve-spaces" now apply correctly.
Preferences (.pielrfrc) File
My original intent for providing full control over command line options came because I realized that people have a wide variety of tastes in the "look and feel" of their e-books. The problem is, if you don't like the default settings, that can add up to a lot of typing for
every book you convert. The ".pielrfrc" file stores all
formatting options so you don't have to re-type them every time, and command line options will still override the ".pielrfrc" options when you need to!
Note that non-formatting related command line options like "--title", "--author", "--headerstyle", etc. are not stored in the .pielrfrc file, since they change for every book.
The .pielrfrc is NOT created automatically. You can create one yourself, or you can have
pielrf write out the current options with the "--writerc" command line switch.
pielrf -t "Harry Potter" -a "Rowling, J.K." -i hp.txt -o hp.lrf --fontsize=200 --bold --parindent=30 --baselineskip=150 --write-rc
This creates (or overwrites) the ".pielrfrc" file in your home directory. Either "/Users/<username>/.pielrfrc" on Mac OS X / Linux / UNIX or "c:\Documents and Settings\<username>\.pielrfrc" on Windows.
Thanks to Lee Bigelow for providing the code for this feature
FORMATTING ADDITIONS
The new tags "<justified></justified>" and "<verse></verse>" allow you to mix paragraph styles within the text.
Standard text has every paragraph's first line indented by the amount indicated in "parindent" to delimit a tab (you know, every paragraph in a book).
<justified></justified> tag makes the whole paragraph left justify, meaning it does not have the first-line indentation.
<verse></verse> makes each paragraph reverse-indent. The first line is justified (on the left margin), and subsequent lines are indented. This allows you to include poetry in your book.
The defaults for "--verseparindent" matches exactly with the default margins and indent used by
pielrf. If you use the <verse></verse> tags AND change your margins, you probably need to adjust the "--verseparindent" and "--quoteoffset" options. Beside the default, using "--quoteoffset=50" and "--verseparindent=-225" are good alternatives.
FORMATTING CHANGES
(1) The main change is that the formatting tags "<center>" and "<h1>,<h2>,etc." used to generate a new paragaraph when the open/close tags were encountered. This is no longer the case -- unless the tags form their own paragraph (see below). For example, you can now have standard paragraphs followed by centered text with no interveneing vertical whitespace (crs).
Here's two examples to illustrate behaviour of the center tag.
<tabchar>And this time he'd make sure they didn't fail. He had a plan.
<center>
* * *
</center>
<tabchar>The repaired alarm clock rang at six o'clock the next morning.
Generates
And this time he'd make sure they didn't fail. He had a plan.
* * *
The repaired alarm clock rang at six o'clock the next morning.
And this...
<tabchar>And this time he'd make sure they didn't fail. He had a plan.
<tabchar><center>
<tabchar>* * *
<tabchar></center>
<tabchar>The repaired alarm clock rang at six o'clock the next morning.
Generates
And this time he'd make sure they didn't fail. He had a plan.
* * *
The repaired alarm clock rang at six o'clock the next morning.
In these examples, <tabchar> is the actual tab character, and is the paragraph telimiter (-b tab).
(2) The "<blockquote>", however, still generates a single vertical whitespace. Though if you have mulitple <blockquotes> in a row, you get only 1 vertical whitespace.
-Pie