User:Whiteknight/Print Version Gadget

How to Install
This template is deprecated and will no longer be maintained or updated.

Known Issues

 * Safari & Chrome (Webkit): Opening an embedded edit window does not work. You must "Display" the text and copy+paste it into another edit window.

About This Gadget
This gadget produces a print version from provided text. It converts wikitext from a book TOC into a printable version. Notice that it does not convert plain text, it must be a properly formatted TOC. TOCs with complex or non-standard formatting may not convert properly, and will need to be edited.

The following wikitext: * /Page 1/ === Sub Heading === * /Page 2/ * /Page 3/

Will be converted to the following Print version text:

The templates and  are print-only formatting templates that create special pages, page breaks, and headings for different purposes.

How to Use This Gadget
Here are a brief set of instructions on how to use the Print Version Creator. For more help, ask Whiteknight.

Get the TOC Text
First, you need to load the text of the TOC into the gadget. There are two methods to do this:


 * 1) Enter the name of the TOC page in the edit box and click Load.
 * 2) Click Show to display a textbox, and enter the text to convert in the box.

Using option 1, if you load an existing TOC, the text of that page will be inserted into the textbox. Clicking Show will display the text of the page for you to edit. It is recommended that you remove formatting, including templates, images, categories, tags (noinclude, includeonly, nowiki, etc), magic words (NOTOC, FORCETOC, etc) and tables. The gadget can try to remove some of these things, but the algorithm is not perfect.

Converting the Text
Once you have a TOC loaded into the textbox, you can click the Convert button to produce the printable version text. Once you have converted the text, you have two options:
 * 1) Display. Display the printable version of the page, for copy+paste.
 * 2) Edit. Produce an edit window, with the printable version code already loaded. Edit the code and press "Save page" to create the PV.

The Display button will display the completed text of the printable version. If you notice problems, you can click Show to view the TOC text, make any necessary changes, and click Convert again. The Edit button will display an edit window for the page "ROOTBOOKNAME/Print Version", with the text of the printable version already loaded into the edit window. You can make any necessary changes, and then click Save page to save the printable version.


 * Notice:Edit does not work in Safari. Display and all other functionality should work in all other browsers.

To Do

 * Add ability to post a notice on the front page of the book.
 * Account for nowiki, noinclude, and includeonly tags
 * Account for text-formatting (bold and italics)
 * Account for tables
 * Handle external links in single brackets and unbracketed
 * Fix bugs in the conversion algorithm
 * rearrange buttons to look better

Version History

 * 3.05 A number of small fixes, added unit pages, etc.
 * 3.03 Nearly-perfect IE support
 * 3.02 Improved IE support
 * 3.01 Minor fixes, added partial support for IE
 * 3.00 Complete rewrite, using Gadgetscore v2.0. same functionalty but better code.
 * 2.55 Fixed XML translation thing
 * 2.54 Updated to include gadgetscore framework
 * 2.53 Minor refactor
 * 2.52 Added automatic edit summary for "Edit"
 * 2.51 changed "Edit" text to be more instructive
 * 2.50 several minor and major changes, code refactor, converted text not stored in textbox.
 * 2.02 Disabled "display" and "edit" buttons when there is no converted text.
 * 2.01 Minor aesthetic enhancements
 * 2.00 Complete rewrite, addition of several features, simplification of code.
 * 1.01 Refactored javascript and template
 * 1.00 First stable version