XPresso for YanCEyWare v0.2[20]

 

Readme Information

General Information

XPresso is a program for formatting the html files for YanCEyWare. We have developed this to do several tasks that would be either tedious or practically impossible without it. Here's a few features of XPresso:

  • Strip out extraneous HTML tags
  • Convert scripture links
  • Insert paragraph numbers
  • Insert named anchor tags on every paragraph
  • Calculate the codes needed to allow highlighting and annotation of paragraphs, called AHTags

eBook Template Wizard

The Wizard has a friendly wizard interface to help you create a blank eBook Template that you can edit for your new project in preparation for a converting to a ybk.

eBook Compiler Wizard

The Compiler has a friendly wizard interface to help you convert content to a final ybk.

You will need to have your content in the right folder structure and have all links functional before running the wizard. Here's what the Compiler Wizard does:

  • Give the user some options on what way to treat the content.
  • If there's no bookmetadata.html file prompt the user for the details to create one.
  • Perform the same tasks as "Convert and Save F5" function in XPresso for every file in the new book.
  • Save a finished ybk file ready for insertion into YanCEyWare in the Destination directory.

Installing

Run the setup file and follow the on screen instructions.

Known Issues

  • WindowsXP skins messup my size calculations so the scrollbar and file menu get hidden below the statusbar.

Tips & Tricks

I have noticed that there are some little tweaks I use when using XPresso, tips if you will that others might find useful.

 

Preparing content before running the ahtag function.

XPresso finds each occurance of <p> and adds a special <ahtag> to it. Then it will find the next occurance of </p> and add an </ahtag> to that. Finally it will add the code for highlighting.>

So....

1. Surround every paragraph with <p> and </p> that you want highlighted

2. When ahtagging content if there's a blank line that's being tagged or some other paragraph that doesn't need to be, you can change the <p> to a <p >. Adding that space will ensure that XPresso will ignore it for tagging but YwR will still see it as a start of a new paragraph.

Renumbering Paragraphs

You might want to run the Remove AHTags function first or else you will get duplicate code.

Linking to Custom Content

XPresso uses "p" and a number to number the paragraphs, like this <a name="#p3">

To link to a paragraph you need the p and paragraph number like this.

<a href="personal\patriarchial.html#p3">

Find Scripture References

There's a few things you need to know about the Find Scripture References Function.

It's in the Advanced Menu so you have to enable that first from the YanCEyWare menu

Run this BEFORE you add Paragraph numbering

Do not run this more than once as it will add multiple references (Hint: Press F12 to preview the changes before saving over your original)

You can customise the search parameters by editing the Link_Books.txt file in the XPresso Directory (Hint: There is a shortcut to this file in the XPresso Program Group

If you reinstall XPresso it will NOT overwrite this file. To revert back to the original file delete this from the XPresso directory first and then re-install (This behaviour is intentional. I do not want to overwrite any customisation)

Here's the format of the Link_Books.txt.

1. "Book as it appears in your file"
2. "YanCEyWare Book name"
3. "YanCEyWare Sub Title"

All seperated by commas and enclosed in "" and followed by a new line. Like this:

"Gen.","OT","Gen"
" Genesis","OT","Gen"

Also sometimes XPresso does not see scriptures with () around them. Try adding these into your Link_Books.txt file like this...

"(Gen.","OT","Gen"
" (Genesis","OT","Gen"

RegEX Replace Function

This function finds the regular expression specified and replaces it with the replace text. You can find more information on the use of Regular Expressions from http://www.regular-expressions.info/.

Here's some RegEX examples that are used internally to clean up the code...

"<head[^>]*>[\w|\t|\r|\W]*?(<style[^>]*[\w|\t|\r|\W]*?</style>)[\w|\t|\r|\W]*?</head>" replace with "$1"
"<!--[\w|\t|\r|\W]*?-->" replace with ""
"<script[^>]*>[\w|\t|\r|\W]*?</script>" replace with ""
"<noscript[^>]*>[\w|\t|\r|\W]*?</noscript>" replace with ""
"<body[^>]*>" replace with ""
"<meta[^>]*>" replace with ""
"<html[^>]*>" replace with ""
" target=[^>]*>" replace with ""
"<form[^>]*>[\w|\t|\r|\W]*?</form>" replace with ""
"<!DOCTYPE[^>]*>" replace with ""

If you wrap the variables in () then you can call that result in the replace text with $1 and $2 for the second (), etc.

So this RegEX <h3[^>]*>([\w|\t|\r|\W]*?)</h3> and $1 to Replace will wrap the heading in bold tags instead of the heading 3 tags.

Exclude files from AHTagging and Collapsable Index

When AHTagging or creating Collapsable Index in an entire book sometimes you will want to exclude a file from the rest of the book.

I added in a little check for the existence of a new tag to see if it should be excluded from the general settings.

To exclude a file from Ahtagging even though the general settings are set to, insert <No AHTags> as the last line in that file.

To exclude a file from creating Collapsable Headings even though the general settings are set to, insert <No Index> as the last line in that file.

You can combine these in the same file.

Create CONTENTS.HTML File for entire book

The function "Build Contents Page" will prompt you for a directory. Once you choose a directory it will loop through all html files creating an Index based on <h1> to <h4> tags in each page, writing the output into a single file in that chosen directory called CONTENTS.HTML.

Use the <No Index> tags mentioned above to exlclude pages from this function.

The results will probably not be in the right order as there's know way for XPresso to know. You can edit the resulting html file to suit your needs.

More Tips and Tricks Online

http://www.yanceyware.com/forum/

 

Version Changes

Version 0.2[20]

  • Fixed a Runtime Error caused by the "Find Scripture References (F9)" when there was no verse, i.e. (Exodus 20)
  • Fixed problems where an Index is being built with no Headings in the content. The header was getting stripped out and never put back.

Version 0.2[19]

  • Updated the Convert Scripture code to take new english designated URL's from scriptures.lds.org

Version 0.2[18]

  • Bug fixed where ! was being inserted before the quotes for a scripture reference
  • Updated Code to find extra scriptural references after a Semi Colon

Version 0.2[17]

  • New Personal Category in the eBook Template Wizard
  • New counter to increase the chapters created in the eBook Template Wizard up to 99
  • Fixed a bug where the Build Index function caused a fatal error if no <h1> to <h6> tags where found
  • XPresso Convert and Save function now will AHTag, Build Index and Check for both lds.org and other scriptures always (used to check last run compiler options)
  • Removed the new code to find extra scripture references marked with a ; as it was causing some problems. I hope to put it in the next release

Version 0.2[16]

  • Added Check in Installer to check for program updates
  • Fixed Graphic on Installer Program
  • Fixed Text on Readme screen for Installer
  • Fixed Graphic on eBook Template Wizard
  • Updated Code to find extra scriptural references after a Semi Colon
  • Changed Menu Layouts on Main program to Link to AHTag, Compiler and eBook Template Wizards
  • Add Menu Item under Help to check for program updates

Version 0.2[15]

  • Added new eBook Template Wizard
  • Changed name of Compiler to eBook Compiler Wizard
  • Save <script> </script> contents on stripping unneeded html code
  • Added "!" to Scripture Links
  • Changed Header info to new type Links
  • Added Progress Bar to AHTag.exe

Version 0.2[14]

  • Fixed a bug in the Build Index and Build Contents Page where the function was stopping or skipping items after encountering a <hr>
  • Added two dll files to the Installer to accomodate the VBScripting and Regular Expressions on some computers
  • Removed the extra <ln> in the Create Metadata File function

Version 0.2[13]

  • Rebranded XPLite to AHTag.exe. This will only regenerate the ahtags for all htm and html files in the specified directory and all sub dirs. The 3 exceptions are for binding.html, bookmetadata.html and readme.html.
  • Fixed a bug where the function to remove whitespace causing problems

Version 0.2[12]

Version 0.2[11]

  • Changed the way the function to wrap the entire page in a <p></p> for ahtagging worked.

Version 0.2[10]

  • Fixed another bug in the compiler that was sorting incorrectly if the file or names were alphabetically before Binding.html
  • Added Function to wrap the entire page in an ahtag if there were no <p>'s on the page

Version 0.2[09]

  • Added in scripture.lds.org conversion for jst of matthew links to study helps
  • Added new Function "Build Contents Page"
  • Fixed a bug in the compiler that was sorting incorrectly if the directory names were in lowercase

Version 0.2[08]

  • Bug in the Compiler function that was putting the order.cfg file in the wrong place and therefore it never got used by YanCEyWare Reader.

Version 0.2[07]

  • Resized the Status Label to prevent wrapping on long paths.
  • Added another missing OCX File into the Installer program.
  • Fixed a bug in the "Find Scripture References F9" function.

Version 0.2[06]

  • Renamed Collapsable Contents to Collapsable Index globally for consistency.
  • Added new feature to allow exceptions in the global Compiler and "Convert and Save F5" functions to create AHTags and Collapsable Index. See "Tips and Tricks" Section of Readme for details.
  • New icon for the compiler to distinguish it from XPresso.

Version 0.2[05]

  • Patched a supposed fix from the previous version.
  • Corrected version number (internal version number of 0.2[04] reporting as 0.2[031]).

Version 0.2[04]

  • Scripture Conversion Tweaks.

Version 0.2[03]

  • New Installer Program
  • Updated Convert Other Scriptures code to check for existing links and additional verses
  • XPresso ~ Read in "Convert and Save F5" settings from the xpresso ini. These settings are also set on the first compile.
  • Compiler ~ Will no longer process the following files prior to compilation in Wizard, binding.html and bookmetadata.html
  • Compiler ~ Display issues where the source and destination directories were wrapping in XP is fixed
  • Compiler ~ Updated the Processing to display the filename currently being processed in the status bar text
  • Compiler ~ Save last Source Directory used to xpresso.ini

Version 0.2[02]

  • Fixed bug in scriptures.lds.org conversion that converted Article of Faith links incorrectly
  • Changed sort routine in ybk Compiler code that resulted in some books not displaying in the library
  • Fixed error in the YBK Browser, also exits after being run from the commandline (Used to exit into XPresso)

Version 0.2[01]

  • Removed XPLite
  • Included Compiler for native windows ybk creation
  • New code to find additional scripture references in "Find Scripture References (F9)" function
  • Complete re-write of most functions for modular use between Compiler and XPresso
  • Split menu's up differently
  • New tweaks for "Convert and Save F5" function
  • New Graphics
  • Lots of Bug fixes
  • Changed Version number as it's a significant update

 

Get the Latest verison from http://www.thecoffeys.net/