Documentation to HTMSmall 1.6
Deutsche Version
| Overview |
| | 1 Description of Program |
| | | 1.1 Assumptions, Installation, Deinstallation |
| | | 1.2 Handling of Program |
| | | | 1.2.1 Command Line Parameters |
| | | | 1.2.1.1 Options |
| | | | 1.2.1.2 Pattern |
| | | | 1.2.2 Context Menu |
| | | | 1.2.3 Definition of Tags |
| | | 1.3 Glossary |
| | 2 About HTMSmall |
| | | 2.1 Conditions of Usage |
| | | | 2.1.1 Register |
| | | 2.2 History |
| Overview |
| | 1 Description of Program |
| | 1.1 Assumptions, Installation, Deinstallation |
| | 1.2 Handling of Program |
| | 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:
- 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... ;-).
- All occurrences of SPACE+'/>' are changed into '>' (notice the leading space). This might only be interesting for authors of XML.
- 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:- HTMSmall does a simple text search, not a parsing of the document like a browser. This means HTMSmall does not know anything of SGML comments (<!-- ... -->): all tags within a SGML comment will be processed.
- According the specification nesting of PRE tags is not allowed - HTMSmall will not work proper if PRE tags are nested.
- If there are attributes within a PRE tag, HTMSmall will not recognize the PRE tag (searching
<PRE *>
takes much more time than <PRE>
). If anybody needs this case handled, please let me know.
So, for all parts of text outside <PRE>...</PRE> the following steps are proceeded in the mentioned order:- change all TAB characters to SPACE (the further compacting might be better)
- reduce multiple spaces to one
- replace SPACE+LF by LF
- replace LF+SPACE by LF
- reduce multiple LF to one
- deleting of white chars in front of all closing tags ('</')
- 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. - Limit the line length to 255, if possible; a SPACE outside of tags will be replaced by LF.
| Overview |
| | 1 Description of Program |
| | 1.1 Assumptions, Installation, Deinstallation |
|
- Assumptions:
Windows 95/NT or newer. - Installation
- Fetch the newest program version and execute the installation program.
- Unpack the archive into the desired installation directory, e.g.
C:\Program files\HTMSmall
. - The installation program copies all necessary files in the directory you choose and creates entries in the Start menu as well as in the Quick Launch Bar of the current user. For files with the extension
HTM
, HTML
and SHTML
context menu items are created - depending on your windows configuration administrator privileges might be necessary.
No files outside the installation directory are manipulated. All files needed the program to work stay in the installation directory.
- Deinstallation
You can deinstall the program either by Start|Programs|HTMSmall 1.6|Deinstall or by Start|Settings|Control|Software|Install/Deinstall|HTMSmall 1.6|Add/Remove. If a valid licence key is detected on the system, you are asked to save it to a file while deinstallation.
| Overview |
| | 1 Description of Program |
| | | 1.2 Handling of Program |
| | | 1.2.1 Command Line Parameters |
| | | 1.2.2 Context Menu |
| | | 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.
| Overview |
| | 1 Description of Program |
| | | 1.2 Handling of Program |
| | | | 1.2.1 Command Line Parameters |
| | | | 1.2.1.1 Options |
| | | | 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:
- necessary parameters are surrounded by <> and optional ones by []
- the symbol "|" is used for an OR-combination
- words in Italic font are understood to be symbolic terms
| Overview |
| | 1 Description of Program |
| | | 1.2 Handling of Program |
| | | | 1.2.1 Command Line Parameters |
| | | | 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:Option | Description |
---|
-h | Help: show possible command line parameters |
-i|-d | Install/Deinstall: Creates or deletes the registry entries. These options should only be used by the installation program. |
-a | Archive: treat only files that are changed (files with archive flag set). Cannot be used in conjunction with -m. |
-m | Treat only files that are changed (like -a). After compression the archive flag is unset. Cannot be used in conjunction with -a. |
-k | Keep (date): the date/time of the file is kept although the file was compressed by the program |
-s | Shared: 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. ;-) |
-r | Recursive: treat also files in sub directories |
| Overview |
| | 1 Description of Program |
| | | 1.2 Handling of Program |
| | | | 1.2.1 Command Line Parameters |
| | | | 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 lineHTMSmall 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 -sAttention: 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).
| Overview |
| | 1 Description of Program |
| | | 1.2 Handling of Program |
| | | 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...:
ExplanationAvailable file types | List of all file types installed at your system. Examples: 'Wordpad Document', 'XML Document' |
Assigned file types | List of all file types which already have a context menu entry for HTMSmall. |
Add | Creates a context menu entry for the selected file type. |
Remove | Deletes the context menu entry for the selected file type. |
Assigned file extensions | List of the file name extension(s) which are assigned to the selected file type. |
Search extension | Opens 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 menu | Here 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):
- Click the button Search extension... and choose the given file extension.
- 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).
| Overview |
| | 1 Description of Program |
| | | 1.2 Handling of Program |
| | | 1.2.3 Definition of Tags |
|
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:
| Overview |
| | 1 Description of Program |
| | 1.3 Glossary |
|
Used Symbolic Terms
white char | one of the chars SPACE, TAB, LF, CR |
SPACE | Space, ASCII-Code 32 decimal |
TAB | Tabulator, ASCII-Code 9 decimal |
LF | Line Feed, ASCII-Code 10 decimal |
CR | Carriage Return, ASCII-Code 13 decimal |
;-) | a Smiley - this one indicates an eye twinkle |
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.
| Overview |
| | 2 About HTMSmall |
| | 2.1 Conditions of Usage |
| | 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:
The newest version of this software is always available at our communication channels or on Internet at http://www.msdatec.de/htmsmall-info.htm.
| Overview |
| | 2 About HTMSmall |
| | | 2.1 Conditions of Usage |
| | | 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²-licencenumber of licences | simultaneous usable |
---|
1 | 1 |
2 | 4 |
3 | 9 |
4 | 16 |
... |
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. :-)
| Overview |
| | 2 About HTMSmall |
| | | 2.1 Conditions of Usage |
| | | 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.)
| Overview |
| | 2 About HTMSmall |
| | 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:- The search of '
<!--DEL * DEL-->
' (see Description of Program) did not work properly. After working on the concerning routines I have not seen any errors on random examples. - One quotation too much in the file INSTALL.INF leads to missing the installation directory for INSTALL.BAT, if called for de installation from start menu.
Changes:- Optimise the routines for processing the tag list. Should be quicker now.
Additions:- The list of tags as well the tag names can be edited now.
- Version 1.3:
- Release: 21 July 2000, Time stamp 01:03:00
Size of EXE file: 489,984 Bytes, MD5 sum: 44569027902b7495537e7c1f9f0a51ba
Bug fixes:- White chars trailing the expression
<Tag name *>
were not deleted.
Changes:- Changed pattern for deleting comments to '
<!--DEL*DEL-->
' - The Reset button in the dialog window Tag list is enabled only, if the list has been changed.
- Improved language management: country specific information is in file STATE_nn.NLS, language specific in LANG_mm.NLS now. nn is the 2 character country code according ISO 3166, mm the 2 character language code according ISO 639.
Additions:- File types for context menu entries can be chosen now.
- Version 1.4:
- Release: 16 Jan 2001, Time stamp 01:04:00
Size of EXE file: 497,664 Bytes, MD5 sum: ?
Bug fixes:Changes:- The dialog window Edit Context Menu does not contain the file types anymore. Instead their captions are shown.
- The pattern for <!--DEL*DEL--> is now compiled only once per file compression. This saves time.
- Again improvement of language management: In order to make it possible to have more than one MSDatec-program in one directory, the names of the language specific files are the 6 chars project name plus the 2 character country code according ISO 3166, here: HTMSMLmm.NLS.
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:- A variable wasn't initiated - the search of <!--DEL*DEL--> began somewhere...
- Forgotten to delete a part of the German template in the English documentation.
- Version 1.5:
- Release: 21 Apr 2002, Time stamp 01:05:00
Size of EXE file: 622,592 Bytes, MD5 sum: 10203c96e62cbd5d5d06c53b0477841e
Bug fixes:- fixed the error on assignments to the title of the dialog window Language
- some entries in the state definition files (
State_cc.nls
) were wrong - fixed
Changes:- Performance boost when searching of pattern. All in all the average time of compacting is half than before.
- If in command line mode, the program checks if the file is read only first. If so, an error message will be shown and the processing will be aborted.
Additions:- Some more tags added to the list of tags not needing surrounding white.
- The maximum number of treatments can be set to each tag. With the default settings the time of compacting is shortened a bit.
- Multiple pattern are possible in command line.
- Improvements to the (very simple) editor: context menu as well as usual editor commands.
- The editor text can be viewed by the standard browser (command View|with default browser).
- HTMSmall pays now attention to the status of the loaded file: if HTMSmall gets focus and the file on the disk has changed meanwhile, the user is asked to reload the file.
- You may now edit the caption of the context menu.
- 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:- The installation/deinstallation is now done by Inno Setup.
- In shared mode the instances of HTMSmall communicate now by using a Mail Slot (a message channel) and not longer by Windows messages. The first launched instance becomes a server to later launched ones. The later launched instances pass their arguments to the server and terminate.
- The context menu entry is now a GUID depending on the version. This leads to a coexistence of different versions of HTMSmall.
Additions:- command line switches -s, -m, -a, -k and -r introduced
Last update: 24/07/2003