View Single Post
Old Aug 23rd, 2008, 4:04:27 AM   #1
ryubahamut
is a Programmer Alumnusis a Contributor Alumnus
 
ryubahamut's Avatar
 
Join Date: Jan 2007
Posts: 999
Default General HTMLizing tools

http://ryubahamut.googlepages.com/row_alternator.py

Figured this might be useful to people while HTMLizing something with a lot of tables, like http://www.smogon.com/dp/articles/breeding_guide_part3. It's a Python script that takes a file as input, identifies tables in it and row-alternating them, and then outputs the row-alternated file on stdout. I have tried it on a few table-intensive pages, and it has worked pretty fine.

Quote:
Usage: row_alternator.py <file>
row_alternator.py <file> > <output>

Simple HTML row alternation script.

Arguments:
<file> The file to be processed.
<output> The file in which the processed data is to be written.

Omitting '> <output>' outputs the processed data to stdout.
<output> will be overwritten without warning.
Just be careful not to send in a file with any row-alternated table -- the results will be an ugly table with re-alternated rows (instead of ABABAB you'll probably see something like ABBAABABBAAB).
ryubahamut is offline   Reply With Quote