Documentation to HTMSmall 1.6

Deutsche Version

Overview
Description of Program1 Description of Program
Assumptions, Installation, Deinstallation1.1 Assumptions, Installation, Deinstallation
Handling of Program1.2 Handling of Program
Command Line Parameters1.2.1 Command Line Parameters
Options 1.2.1.1 Options
Pattern 1.2.1.2 Pattern
Context Menu1.2.2 Context Menu
Definition of Tags1.2.3 Definition of Tags
Glossary1.3 Glossary
About HTMSmall2 About HTMSmall
Conditions of Usage2.1 Conditions of Usage
Register2.1.1 Register
History2.2 History

OverviewOverview
Description of Program1 Description of Program
Assumptions, Installation, Deinstallation 1.1 Assumptions, Installation, Deinstallation
Handling of Program 1.2 Handling of Program
Glossary 1.3 Glossary

What is HTMSmall?
HTMSmall is a program for compacting HTML files without loss of information. This for interest for authors of HTML, who wants to free their published version of HTML from ballast. The compacted pages are loaded and presented faster.

Of course the strength of compacting depends on the document: If there are only necessary tags (HTML, BODY) and plain text, nearly nothing can be compacted. If on the other hand the tags are indented or begin at new lines, the document can be compacted extremely in some cases (30% or more). The usual compact rate is about 10% in my experiences.

How does the compacting work?
At first the document is treated completely:

  1. All line breaks (DOS/Windows: CR+LF, Unix: LF, Mac: CR) are changed to a Unix line break. This saves one character per line at texts of a DOS/Windows/OS2-system (hardly feeds the squirrel... ;-).
  2. All occurrences of SPACE+'/>' are changed into '>' (notice the leading space). This might only be interesting for authors of XML.
  3. Everything which fits the pattern '<!--DEL*DEL-->' will be deleted (take care of case). This allows you to delete comments before you publish your documents to the Internet (or where ever).
The following steps are only processed on parts of text outside <PRE>...</PRE>. The case of the PRE tags is ignored. Restrictions:So, for all parts of text outside <PRE>...</PRE> the following steps are proceeded in the mentioned order:
  1. change all TAB characters to SPACE (the further compacting might be better)
  2. reduce multiple spaces to one
  3. replace SPACE+LF by LF
  4. replace LF+SPACE by LF
  5. reduce multiple LF to one
  6. deleting of white chars in front of all closing tags ('</')
  7. The tags named !, APPLET, AREA, BASE, BASEFONT, BLOCKQUOTE, BODY, BR, BUTTON, CAPTION, CENTER, COL, COLGROUP, DD, DIR, DIV, DL, DT, FIELDSET, FORM, FRAME, FRAMESET, H1, H2, H3, H4, H5, H6, H7, H8, H9, HEAD, HR, HTML, IFRAME, LEGEND, LI, LINK, MAP, MENU, META, NOFRAMES, NOSCRIPT, OL, OPTGROUP, OPTION, P, PARAM, SCRIPT, SELECT, STYLE, TABLE, TBODY, TD, TFOOT, TH, THEAD, TITLE, TR, UL usually don't need surrounding white chars, because either they cause a line break in the view (e.g. HR, P) or they are structural information (e.g. HTML, BODY) without effect to the view. Because of this, leading and trailing white chars of these tags (and their closing tags) are deleted.
    The case of the tag name is irrelevant; attributes may be present.
  8. Limit the line length to 255, if possible; a SPACE outside of tags will be replaced by LF.

Begin of Chapter Begin of Article


OverviewOverview
Description of Program1 Description of Program
Assumptions, Installation, Deinstallation 1.1 Assumptions, Installation, Deinstallation

Begin of Chapter Begin of Article


OverviewOverview
Description of Program1 Description of Program
Handling of Program1.2 Handling of Program
Command Line Parameters 1.2.1 Command Line Parameters
Context Menu 1.2.2 Context Menu
Definition of Tags 1.2.3 Definition of Tags

The main part of the visible components is a simple editor. Launch HTMSmall from the Start Menu, open a HTML file and choose File|Compact in the menu. After processing the compact orders a dialog box informs you about the strength of compacting, and the compacted text appears in the editor.
If you want to edit your text in the future, you should not overwrite your file with the compacted version, because it is horrible to read for humans. Because of this there is no Save command in the menu, only a Save as... entry.
Do so with all files you want to compact. Too much work? Then use the Command Line Parameters or the Context Menu, which is the designed main usage of HTMSmall.

Begin of Chapter Begin of Article


OverviewOverview
Description of Program1 Description of Program
Handling of Program1.2 Handling of Program
Command Line Parameters1.2.1 Command Line Parameters
Options 1.2.1.1 Options
Pattern 1.2.1.2 Pattern

You can use HTMSmall in batch processing by giving one ore more file names or file name masks of the files to compact on the command line to HTMSmall. All files matching the given file masks or names are compacted then. Because the content of the files is overwritten by the compacted text, the files should be copies of the originals (see also the example at pattern). If HTMSmall have not changed the content (maybe it was not compactable), the file is not overwritten.

The complete command line syntax is:

HTMSmall.exe [[-i|-d] |[-a|-m] [-h] [-k [-r] [-s] <pattern>]

Some conventions about notation:

Begin of Chapter Begin of Article


OverviewOverview
Description of Program1 Description of Program
Handling of Program1.2 Handling of Program
Command Line Parameters1.2.1 Command Line Parameters
Options 1.2.1.1 Options

If command line parameters are given, they are processed from left to right. If mutually exclusive switches are given, the last switch is used.
The options in detail:
OptionDescription
-hHelp: show possible command line parameters
-i|-dInstall/Deinstall: Creates or deletes the registry entries. These options should only be used by the installation program.
-aArchive: treat only files that are changed (files with archive flag set). Cannot be used in conjunction with -m.
-mTreat only files that are changed (like -a). After compression the archive flag is unset. Cannot be used in conjunction with -a.
-kKeep (date): the date/time of the file is kept although the file was compressed by the program
-sShared: If more than one instances of HTMSmall are started in batch mode, the first started program acts as a server to later launched instances. They pass their parameters to the server and terminate. This option is intended for launching HTMSmall from the context menu to avoid dozens of instances. The radius of the server is limited to the local station. ;-)
-rRecursive: treat also files in sub directories

Begin of Chapter Begin of Article


OverviewOverview
Description of Program1 Description of Program
Handling of Program1.2 Handling of Program
Command Line Parameters1.2.1 Command Line Parameters
Pattern 1.2.1.2 Pattern

After eventually given options HTMSmall expects one ore more file names or one ore more file name masks of the files to compress: HTMSmall.exe [Options] [Pattern] [Pattern] [...]
The entries are processed from the left to the right.
Pattern is an optional path followed by either a single file name or a mask composed by the Windows joker '*' and '?'.
Example for the usage of a file name mask in the command line
HTMSmall C:\Projects\MillersWeb\Export\*.htm
would compact all files with the extension htm in the directory C:\Projects\MillersWeb\Export\.

If a space is part of Pattern you have to put Pattern into double quotes (as usual). Example: C:\Programs\HTMSmall\HTMSMall.exe "C:\My Web\test.htm"

If you compact files of certain projects more frequently, the usage of batch files is sense full.
Example for the usage of HTMSmall in a batch file, e.g. MAKE.BAT
  REM First copy all files into an export directory:
xcopy /S C:\Projects\MillersWeb\Raw\*.* C:\Projects\MillersWeb\Export\*.*
  REM Now run HTMSmall on it:
C:\Programs\HTMSmall\HTMSMall.exe C:\Projects\MillersWeb\Export\*.htm
C:\Programs\HTMSmall\HTMSMall.exe C:\Projects\MillersWeb\Export\script.js
C:\Programs\HTMSmall\HTMSMall.exe C:\Projects\MillersWeb\Export\Texte\*.htm C:\Projects\MillersWeb\Export\Text\*.html
In this example Windows would start three parallel working instances of HTMSmall. If you don't want to have parallel working (there may be dependencies between the target files) you can either use the Windows command start with the parameter /wait or simply list all file names (or masks) as a parameter for HTMSmall or use the switch -s

Attention: If HTMSmall is started with parameters the file will be overwritten with the compacted version without warning. It might be better if you put all your files you want to export into a separate directory and then start HTMSmall (as seen in the example above).

Begin of Chapter Begin of Article


OverviewOverview
Description of Program1 Description of Program
Handling of Program1.2 Handling of Program
Context Menu 1.2.2 Context Menu

A comfortable way to use HTMSmall is the Context Menu: open any folder with HTML files, select one ore more of them, right click on them and choose Compact. (The original file will be overwritten by the compacted version.)

The installation program inserts an context menu entry for the file types handling the extensions htm, html and shtml. You may alter these assignments with the menu entry Extras|Context menu...:
list of all available file typesHTMSmall is already in context menu at these file typescreate a context menu entry for the above selected file typedelete the context menu entry for the above selected file typefile name extension(s) assigned to the above selected file typelook for the file type of a given extensioncaption of the context menudialog window 'edit context menu'
Explanation
Available file typesList of all file types installed at your system. Examples: 'Wordpad Document', 'XML Document'
Assigned file typesList of all file types which already have a context menu entry for HTMSmall.
AddCreates a context menu entry for the selected file type.
RemoveDeletes the context menu entry for the selected file type.
Assigned file extensionsList of the file name extension(s) which are assigned to the selected file type.
Search extensionOpens a dialog window where you can select a file extension. If done so, the file type owning this extension will be selected in one of the lists.
Caption of context menuHere you can edit the caption of the context menu that is shown in the Windows Explorer. If you assign a null value, the default entry ('Compact') is taken. Note: You can define an acceleration key with putting an ampersand in front of it (e.g. 'Com&pact' is shown as 'Compact).

Probably then most often case is to create a context menu entry for a given file extension (.xml for example):

  1. Click the button Search extension... and choose the given file extension.
  2. Now the file type responsible for this extension is selected in the list Available file types (in the above example XML Document). Press the button Add to create a context menu entry for this file type (of course it will be deleted, if you deinstall HTMSmall).

Begin of Chapter Begin of Article


OverviewOverview
Description of Program1 Description of Program
Handling of Program1.2 Handling of Program
Definition of Tags 1.2.3 Definition of Tags

List of all tags to treatAdd a tagEdit selected entryDelete selected entriesReset the list to the default settingsdialog window 'Tag list' On command Extras|Tag list... you can edit the list of tags HTMSmall treats in the compress operations. You can add tags, rename them or - the probably most often operation - delete them, if not used in your HTML files. If you write the HTML source text by yourself you should delete all tags from the list you know you will never use them. This accelerates the compression a bit.
All tag names are changed to upper case; multiple occurrences are not allowed.

Furthermore you can define the maximum number of treatments by HTMSmall for each tag. Some tags (e.g. TITLE) occur only once in nearly all documents (I hope :-) and after HTMSmall has found this tag, there is no need to proceed with this tag. This accelerates the compacting, too. Although it is not very useful, other values than 1 and all are possible: Dialog window 'Edit item'

Begin of Chapter Begin of Article


OverviewOverview
Description of Program1 Description of Program
Glossary 1.3 Glossary

Used Symbolic Terms

white charone of the chars SPACE, TAB, LF, CR
SPACESpace, ASCII-Code 32 decimal
TABTabulator, ASCII-Code 9 decimal
LFLine Feed, ASCII-Code 10 decimal
CRCarriage Return, ASCII-Code 13 decimal
;-)a Smiley - this one indicates an eye twinkle

Pattern

The name Pattern is used for text, which may contain the wild cards star '*' or question mark '?'. The question mark replaces exactly one character; the star zero, one ore more characters. The star is "not greedy", that means that if more possibilities of matches exist, the shortest is chosen.
Both wild cards replace also special characters like LF, CR or TAB.

Begin of Chapter Begin of Article


OverviewOverview
About HTMSmall2 About HTMSmall
Conditions of Usage 2.1 Conditions of Usage
History 2.2 History

Please send bug reports, comments and the shareware money ;-) to:

Matthias Stolte Datentechnik (MSDatec)

System Serving, Seminars, Data- and Communication solvings

Communication channels:

Newest version

The newest version of this software is always available at our communication channels or on Internet at http://www.msdatec.de/htmsmall-info.htm.

Begin of Chapter Begin of Article


OverviewOverview
About HTMSmall2 About HTMSmall
Conditions of Usage2.1 Conditions of Usage
Register 2.1.1 Register

This Software is Shareware.
This means you can test the software and decide if it satisfies your demands before buying it. You will notice that the software inserts a hint if compacting is better than 10%. If you accept this and don't change, delete or make the hint unreadable in any other way, you may use the software without a licence.
If not, you may try the software within 30 days after the first start. Then you should licence the software or don't use it anymore.
Number of licences
n²-licence
number of
licences
simultaneous
usable
11
24
39
416
...
Please note that the software is licensed like a book. You can install it on different machines and it can be used by different persons, but not simultaneously. If the software is used multiple simultaneously, you need multiple licences.
The number of necessary licences follows the n²-licence, that means, the number of software copies you can use simultaneously is the square of the number of licences (see table).
Limitations
The usage of this program is at your own risk. There is no warranty for the program except the above mentioned functions. Neither the author nor his company is responsible for any damage or loss concerning this program.
May I give the software to others?
You may give it to others, if you didn't change anything in the distribution. Please keep the name of the distribution if you give it to others.
Of course you are not allowed to give the register code to others except you don't use it anymore.
What is the difference between the unregistered and the registered version?
The difference is, that the registered version does not insert the hint into your text.
Furthermore you get technical support concerning this program as well as free updates to versions with the same main version number (for example if you register version 1.1 you can use all versions 1.x).
How can I register?
See next page. :-)

Begin of Chapter Begin of Article


OverviewOverview
About HTMSmall2 About HTMSmall
Conditions of Usage2.1 Conditions of Usage
Register 2.1.1 Register

How to register the shareware version
The inserting of the hint will be switched off with register. The cost of one licence is 9.00 €. You can transfer it to my account or you can send me a letter with a cheque or bank notes. Please don't forget to mention the name of the program and your E-Mail- or letter-address. Sometimes I get payments, where I can't see which program is concerned nor where I have to send the code.

If you have done so you will get the register code by E-Mail or letter. You can enter the code in the menu Help|Register code... then.

You can send me the following order as an E-Mail. If you have activated java script in your browser, the sums are calculated automagically.
(If the order isn't possible with this formula {e.g. earlier versions of Internet explorer can't do this}, you can send me the text formula HTMSmallReg_en.txt with E-Mail, fax or letter.)


Yes, please send me...

1 register code for the program HTMSmall 1.6 (9.00 €)
more licence(s), each 9.00 €
per E-Mail
and furthermore a bill with named tax rate1,50

Sum:
All prices include taxes.

The value of € I have
assigned to the account of Matthias Stolte Datentechnik, account number 41508078 (IBAN: DE41 4805 0161 0041 5080 78) at Sparkasse Bielefeld, bank number 480 501 61 (SWIFT-BIC: SPBIDE3BXXX), Germany. I've put my name as well as the name of the program (HTMSmall) on the assignment formula.
sent as cheque/bank notes to: Matthias Stolte Datentechnik, 33613 Bielefeld, Albert-Schweitzer-Straße 4, Germany.
Salutation:First name:Family name:
Organisation:Department:
Postal area code:City:Country:
Street:
Telephone:Fax:E-Mail:
Comments:

Begin of Chapter Begin of Article


OverviewOverview
About HTMSmall2 About HTMSmall
History 2.2 History

Version 1.0:
Release: no public release, for internal use only
Version 1.1:
Release: 28 Apr 2000, Time stamp 01:01:00
Size of EXE file: 450,048 Bytes, MD5 sum: 1e12fcaa104e6b5c66dc8c2979f1a45a
Version 1.2:
Release: 02 May 2000, Time stamp 01:02:00
Size of EXE file: 466,944 Bytes, MD5 sum: 27b253d2b1a4c961afd6e7e92238c960
Bug fixes:Changes:Additions:
Version 1.3:
Release: 21 July 2000, Time stamp 01:03:00
Size of EXE file: 489,984 Bytes, MD5 sum: 44569027902b7495537e7c1f9f0a51ba
Bug fixes:Changes:Additions:
Version 1.4:
Release: 16 Jan 2001, Time stamp 01:04:00
Size of EXE file: 497,664 Bytes, MD5 sum: ?
Bug fixes:Changes:Additions:
Version 1.4.1:
Release: 17 Jan 2001, Time stamp 01:04:00
Size of EXE file: 499.200 Bytes, MD5 sum: ea66bb1a9abb9c4066c0b4138338009b
Bug fixes:
Version 1.5:
Release: 21 Apr 2002, Time stamp 01:05:00
Size of EXE file: 622,592 Bytes, MD5 sum: 10203c96e62cbd5d5d06c53b0477841e
Bug fixes:Changes:Additions:
Version 1.6:
Release: 24 July 2003, Time stamp 01:06:00
Size of EXE file: 229,376 Bytes, MD5 sum: f81dfe4898d01a66aa00b4d47ba05c48
Bug fixes: no bugs found
Changes:Additions:

Begin of Chapter Begin of Article


Last update: 24/07/2003