HTML Tidy 3

|- index -|- download -|- end -|

Of course, you are encouraged to go to the official Tidy site on Sourceforge - there you will find all the latest source, patches, releases, and all information you need ... specifically, you should read the licence ... this is only a single, individual, frozen, view ... in the hope it helps others use, and aids the continued development of HTML Tidy.

Adding ALT text to an IMG element

Presently Tidy has an -alt-text <text> option, to add the static <text> to an IMG element, missing any existing "alt='text'" attribute, but that text is 'static' and it is applied to EVERY <img ...> element that does not presently have such an ALT description attached ...

If the following PATCH is applied, and Tidy is compiled using the ADD_IMG_ALT_MODIFIER pre-compiler flag, then the <text> can contain modifiers, related to the SRC file ...

As the 'patch' for the Overview.html file states, with HTML removed ...

#ifdef ADD_IMG_ALT_MODIFIER /* if this is defined for the compile */
Then, the string can include some modifiers, case sensitive, that should help you make the alt text more meaningful ... but nothing beats a personalised image description ... like "Mother, on her 80th birthday!" ...

%f add full path/file name of src.
%n add file name only, no path.
%p add just path name, if any.
%s add file short title, no extension, or path.
%x add file extension only.
and, if the file can be found, in the relative path ...
%t add the date and time of file, if file found.
%z add the size of file, if file found.

But it is worth REPEATING, and can NOT be stressed enough, YOU, AND ONLY YOU, ARE RESPONSIBLE FOR MAKING YOUR DOCUMENTS ACCESSIBLE TO PEOPLE WHO CAN'T SEE THE IMAGES CLEARLY!!! Please add to their life with a little of your effort!

Now you can add, something like, or part thereof -
alt-text: Image file %n, type %x, size %z, at %f, dated %t
or as you desire, to your config file, and add a little to their, and others, understanding of the web.
Note, some accessibility warnings may remain, but you have added to the web experience ...
#endif /* ADD_IMG_ALT_MODIFIER */

Note, the last two only function if the file is found. As the -show-alt-text help states, if the patch added, and compiled with ADD_IMG_ALT_MODIFIER - Following 2 only available if source image file found using a relative path. It will not presently function if a URL web address is used!

download:
tidydev3.zip
MD5-sum:
3c607304305662753681b5d967ada88f
release:
14 February 2006
build:
19 February 2006

The tidydev3.txt PATCH file, shows the the modifications to files in the current CVS source circa 19 February, 2006 ...

And the tidydif3.zip file, which contains four (4) files, to add to the test suite -
1. tidydif3t.txt - a diff -u showing the addition of a test case to testcases.txt ... namely 1409151 1 ...
2. test\input\in_1409151.html - an input folder, test case file, with an IMG with no ALT ...
3. test\input\cfg_1409151.txt - an input folder, test case configuration file, using each of the modifiers ...
4. test\input\arrow right.gif - a small image file, with the added case of containing a space character ... without this file, the %t (time), and %z (size) modifiers will not function ... obviously ...

To be sure, here are two links, that give lots more information on the meaning and purpose of the ALT attribute, on an IMG element, and other information -
http://ppewww.ph.gla.ac.uk/~flavell/alt/alt-text.html 
http://www.cs.tut.fi/~jkorpela/html/alt.html 
And these point you to the extensive Web Accessibility Initiative (WAI) material of the W3C ... in particular, the Web Content Accessibility Guidelines 1.0, for further reading on this topic.

The addition of this feature to Tidy is NOT intended to encourage HTML authors to add rather meaningless text to images ... it only improves slightly on an existing feature of Tidy, which allowed a single piece of 'static' text to be added, when the IMG element contains no current ALT attribute ...

In fact, it is hoped, by (a) warning the author of the missing ALT attribute, and (b) adding purely file specific descriptive text, like 'File %f, type %x, size %z, dated %t', that the author will be ENCOURAGED to go back through their work, and 'convert' this, perhaps helpful to them, file description, to a more MEANINGFUL DESCRIPTION, using the above guidelines ...

It is also a precursor to a fuller 'alt-text' feature I hope to find the time to add. Something like alt-text-file <out/in file name>. The idea here is that on the first run through the target HTML file, a file is generated containing all the IMG elements, with their existing, or 'generated' ALT attribute.

The author could then edit that OUTPUT file, using the file description as a guide, and changing the current information to a more appropriate entry. Then on the second run through the target, the adjusted file is used as INPUT, and the target IMG elements are modified accordingly ... but this is for the future ... as, and when time permits ...

Meantime, it is hoped the Tidy 'community' will add this small enhancement of an existing feature to the CVS source tree, to facilitate, and encourage further development ;=))

Hope this helps someone ...

Older patch file: The tidydif3.txt PATCH file, shows the the modifications to 12 files in anonymous CVS source circa 18 January, 2006 ...

top -|- index


checked by tidy  Valid HTML 4.01 Transitional