HTMLFIX(1)

๐Ÿ“ฆ
version 2.32.0 ยท 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing

๐Ÿ’– NAME ๐Ÿ’–

okay bestie, gather round โ€” this is htmlfix, and it fixes up your HTML markup code. that's it, that's the whole vibe. she's a little cleaner-upper for your markup and she ate. ๐Ÿ’…


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

htmlfix [-o outputfile] [-F fixes] [-S fixes] [-v] [inputfile]

๐ŸŒธ DESCRIPTION ๐ŸŒธ

so here's the tea, bestie: the htmlfix program reads from inputfile, or from "stdin" if you don't hand it a file, and then it does the following little makeovers (the name of each fixup is chillin' in the parentheses, so you know what to call it):

๐Ÿ”ฅ (imgsize) : Adding WIDTH and HEIGHT attributes to IMG tags

for every IMG tag that doesn't already have both a WIDTH and a HEIGHT attribute (and yes, the matching is case insensitive, we're not doing that today), she goes and figures out the size of the image from the SRC attribute, then adds whichever of "width=X" and/or "height=Y" is missing to the list of attributes. the whole point? speed up the layouting of the final webpage. main character efficiency, honestly. โœจ

โš ๏ธ do not mix this up with a size checker, okay? htmlfix will only add missing width/height attributes โ€” she will not adjust ones that have the wrong dimensions. that's on purpose, because otherwise you'd lose the ability to scale images (which webdesigners use a lot via 1pt dot-images). so don't come for her about it. ๐Ÿ’€

there's a special case too, and it's kind of iconic: when the WIDTH or HEIGHT attribute already exists but its value is "*", that asterisk gets replaced by the physical value instead of appending a whole new attribute. use this when you want the attributes at a certain position โ€” basically, use this variant as a placeholder. ๐ŸŽ€

oh and also, HTMLfix supports one additionl feature when it's vibing with WIDTH and HEIGHT: "SCALE="factor and "SCALE="percent"%". this lets you scale the given or determined width and height values by multiplying with factor, or by multiplying with percent/100. math but make it slay. ๐Ÿงฎ

๐Ÿซถ (imgalt) : Adding ALT attribute to IMG tags

for every IMG tag that doesn't already have an ALT tag, an ALT="" attribute gets added. the intention here is twofold: make HTML checkers like weblint(1) happy, and demystify the final webpage for lynx(1) users. accessibility besties stay winning. ๐Ÿ’–

๐Ÿ‘‘ (summary) : Adding SUMMARY attribute to TABLE tags

this attribute helps non-visual rendering of tables by adding a little hint about its contents, and it makes tidy(1) quiet. two birds, one stone, no notes. ๐Ÿฆ‹

๐ŸŒˆ (center) : Changing proprietary CENTER tag to standard DIV tag

all the proprietary (Netscape) CENTER tags get replaced by the HTML 3.2 conforming construct <DIV ALIGN=CENTER>. glow-up complete, periodt. โœจ

โญ (space) : Fix trailing spaces in tags

Appendix C of the XHTML Specification recommends putting a space before closing simple tags to help rendering by old browsers, so that space gets automatically added when this fixup is used. flip side though โ€” all spaces before a right-angle bracker get suppressed. both, at once, no cap. ๐Ÿ”ฅ

๐Ÿ’… (quotes) : Adding missing quotes for attributes

all attributes of the form ...=xyz get replaced by ...="xyz". and furthermore, all the (color) attributes of the form ...="XXYYZZ" โ€” where XX, YY, ZZ are elements of the set {0,..,9,a,..,f} โ€” get fixed to ...="#XXYYZZ". she's detail-oriented, we love that for her. ๐Ÿ’œ

๐ŸŽ€ (indent) : Indenting paragraphs

paragraphs enclosed in <indent [num=N] [size=S]>...</indent> containers get indented by N*S spaces. when N=0, the whitespace block in front of the paragraph gets removed. default is a 4 space indentation, so that's N=1, S=4. cozy. ๐Ÿ›‹๏ธ

๐Ÿ™ˆ (comment) : Out-commenting tags

sometimes it's useful to temporarily out-comment a tag instead of completely removing it โ€” you know, the way you leave a text on read instead of blocking. this can be done by just adding a sharp ("#") character directly to the end of the tagname. the result is that the complete tag is commented out. for container-tags you have to comment out the end-tag explicitly too, bestie, don't forget. example: <a# href="...">. ๐Ÿ˜ญ

๐Ÿงš (tagcase) : Markup-code case-conversion

some people like their HTML markup code either all uppercase or all lowercase โ€” we don't judge, we support. this tag case-conversion is handled by the internal <tagconv case=...>...</tagconv> container tag from HTMLfix. use case=upper to translate the HTML tags in its body to uppercase (that's the default), or case=lower to translate them to lowercase. pick your fighter. ๐Ÿ’…


โœจ OPTIONS โœจ

  • -o outputfile โ€” redirects the output to outputfile. usually the output gets sent to stdout if you don't specify this option, or if outputfile is "-".
  • -F fixes โ€” specifies which specifix fixups are performed. its argument is a comma separated list of fixup names, and by default all fixups are performed. so if you're picky about your glow-up, this is your moment. ๐ŸŒŸ
  • -S fixes โ€” does the inverse job of -F, it skips the specified fixups. blocking, but make it productive. ๐Ÿ™…
  • -v โ€” sets verbose mode, where some processing information gets given on the console. she's narrating her own life and honestly? fair. ๐Ÿ—ฃ๏ธ

๐Ÿ’œ AUTHORS ๐Ÿ’œ

  • Ralf S. Engelschall โ€” rse@engelschall.com โ€” www.engelschall.com
  • Denis Barbier โ€” barbier@engelschall.com

so yeah, that's the whole page, bestie ๐Ÿซถ this icon dropped under EN Tools, dated 2020-11-29, and that's the vibe check, signed, sealed, slayed. go fix up some markup. ๐Ÿ’–โœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from