Part_1 | - Hyperlink Generation for HTML documents created by MS WORD |
Part_2 | - Converting Legacy Text Documentation to HTML |
Part_3 | - "uvhitctr2.pl" free hit counter from UV Software |
Part_4 | - HTML tips & techniques |
- embedding Google Map Links in your web site HTML coding |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Part 1 documents the Vancouver Utility method of automatically generating hyperlinks in HTML files that have been written out from MS WORD documents.
1A1. | Introduction & Overview |
1B1. | Hyperlink Identification & Coding Rules |
1B2. | Trigger Codes for Hyperlink Insertions |
1C1. | Directories Required for Hyperlink Generation |
1C2. | Directory Conventions, Recommendations,& Caveats |
1C3. | Uvcopy jobs used to generate Hyperlinks |
1C4. | Installing updated uvcopy jobs & scripts for hyperlink generation |
1D1. | Operating Instructions for uvcopy jobs to generate hyperlinks |
1D3. | Operating Instructions for scripts (easy way) to generate hyperlinks |
1E1. | Verify hyperlink target NAMEs defined once only & not doubly defined |
1F1. | Hyperlink Analysis (Summary Table Reports) |
- count hyperlink NAMEs & HREFs by format | |
- might use to find non-standard hyperlinks |
1G1. | Hyperlink Generations Illustrated |
1G2. | Sample illustrations for Chapter NAME Definitions & HREF References |
1G3. | Item Heading definition & Keyword Index generation |
1H1. | scripts to generate hyperlinks (easy way to run uvcopy jobs) |
- dochts21,dochts22 for Unix,Linux,& Windows/SFU |
1I1. | - dochts21.bat,dochts22.bat for Windows/DOS |
1J1. | index.htm Home-Page sample |
Part_2 | - Converting Legacy Text Documentation to HTML |
- see the detailed contents listing at the begining of Part_2. |
Part_3 | - "uvhitctr2.pl" free hit counter from UV Software |
- see the detailed contents listing at the begining of Part_3. |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
This documents the Vancouver Utility method of automatically generating HTML hyperlinks in HTML files that have been written out from MS WORD documents.
The first major advantage is that you can continue to maintain your documentation in MS WORD. Whenever you wish to update your web site, you use these Vancouver Utility jobs to automatically generate the hyperlinks & upload the resulting HTML to your web site. This saves you from being locked in to the HTML documents as you would be, if you started adding hyperlinks manually using HTML editors.
The second major advantage of this system is that we can generate hundreds or thousands of hyperlinks that would not be possible using HTML editors. This is especially true for the permuted index inserted at the end of each document & for the master cross-reference. The master cross-reference is a separate file containing the keyword hyperlinks from all documents.
Automatic hyperlink generation does of course require unique patterns to identify 'Chapter codes' & 'Item Headings' where we should generate the hyperlink 'NAMEs (targets) & the 'HREF's (references).
Our sample documents use chapter chapter codes of 2 UPPER case alphas followed by 2 numeric digits (BA01, BA02, etc). We distinguish between a NAME & an HREF by prefixing with a '_' or a '#'. For example the chapter heading might contain 'Chapter_BA01'. When we wish to reference that chapter we might say 'see chapter #BA01'.
Our 'Item Headings' are identified by the commonly used 'decimal point' system (1.1, 1.2, 1.3, etc). The significant words from the item headings are used to build a 'permuted keyword index' (cross-reference) which is inserted at the end of the document.
'Permuted' means that we generate a separate line for each significant word from the Item Heading lines. Each significant word is inserted at the begining of the heading line & all lines are sorted into alpha sequence by the leading significant words. These lines include a hyperlink reference back to the original item heading line within the originating chapter.
You probably will have to spend some time modifying your 'Chapter codes' & 'Item heading ID codes' to make this system work, but there is a huge payoff when you consider the value of the automatic generation of thousands of hyperlink references in the document indexes & the master cross-reference.
Also note that the Vancouver Utility jobs could be adapted to your coding conventions if you already have some logical method that permit the necessary identifications.
If you would like some help with document modifications, we recommend our business partner Smart-Text Solutions https://www.smart-text.com. You can also see some full length documents with hundreds of hyperlinks on the Smart-Text web site: https://www.smart-text.com/portal2
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here is a summary of the coding rules used in the sample documents. If you modify your MS WORD documents to these standards, you can use the Vancouver Utility hyperlink generation jobs as is. Alternatively, if your documents already have unique coding patterns, UV Software may be able to modify the jobs to confrom to your standards.
Book codes |
|
Chapter codes |
|
Chapter Definitions |
|
Chapter References |
|
Book and Chapter |
|
Item Heading |
|
Keyword Reference |
|
Image Definitions |
|
Image References |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
MS WORD reads the .doc files from subdir doc & writes HTML files in subdir doc. uvcopy job dochtm24 will insert hyperlinks as it copies the HTML files from subdir doc to subdir htm.
uvcopy job dochtm24 inserts various hyperlinks at various points in the HTML files depending on predefined & agreed upon codes (mostly chapter codes). This page describes the default codes. These could be changed if you wish to use different chapter codes.
<BODY - standard HTML code to define begining of document text - triggers dochtm24 to insert following: - bgcolor="#FFFF80" text="black" - <FONT face="arial"> - <A NAME="page1"></A>
_AA99 |
|
Return to: Begin Document, Home-Page, Keyword Cross-Ref, Master Cross-Ref, Table of Contents, Table of Inserts
Return links |
|
_BA01 |
|
_BA30 |
|
_ZZ99 |
|
1.1,etc - Item Headings are identified by decimal point numbers at begin line. - 1.0, 1.1,... 2.0, 2.1,...etc to 99.99 - trigger inserting NAME definitions for the Keyword Cross-Ref links - the NAME def consists of the current chapter code + decimal number - to make the hyperlink unique (since decimal codes repeat in chapters)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
I recommend you set up a separate directory, containing the sub-directories shown below. If you are using unix or linux, you might setup a separate user (hyperlink) or just make the hyperlink directory within your /home dir.
If you are using Windows (& the Windows UV programs that run in a DOS command window), you could setup the superdir at C:\hyperlink. If you are using Windows, I recommend SFU (Services for Unix) downloadable from www/microsoft/windows/sfu. SFU is a unix/linux emulator for Windows 2000 or Windows XP.
/home/hyperlink <-- for unix/linux or Windows/SFU C:\hyperlink <-- for native Windows :-----doc <-- Microsoft Word documents : + HTML written out from MS Word :-----htm <-- HTML with Hyperlinks inserted by UV jobs :-----tmp <-- temporary files misc :-----tmp1 <-- temporary files for cross-ref generation :-----htmsave <-- save dir for manually written HTML (index.htm)
/home/hyperlink :-----doc <-- Microsoft Word documents : :----ab01.doc - multiple documents named like this : :----ab02.doc : + HTML written out from MS Word : :----ab01.htm - multiple documents named like this : :----ab01_files - subdirs of files for each document : : :--------- image001.gif <-- images written by MSWORD : : :--------- image002.jpg : : :--------- ....etc... : :----ab02.htm : :----ab02_files : : :--------- image001.gif/jpg/png/mso : : :--------- image002.xxx : : :-----htm <-- HTML with Hyperlinks inserted by UV jobs : :----ab01.htm - documents copied from doc inserting hyperlinks : :----ab01_files - images copied from doc (for easy zip/FTP to web) : : :--------- image001.xxx : :----ab02.htm : :----ab02_files : : :--------- image001.xxx : :----mxrf.xrf - master index (hyperlinks on keywords) : :----index.htm - copied from htmsave by script dochts22 : : :-----htmsave <-- save dir for manually written HTML & images : :----index.htm : :----ab01-0100-01.jpg
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
/home/hyperlink <-- for unix/linux or Windows/SFU C:\hyperlink <-- for native Windows :-----doc <-- Microsoft Word documents : + HTML written out from MS Word :-----htm <-- HTML with Hyperlinks inserted by UV jobs :-----tmp <-- temporary files misc :-----tmp1 <-- temporary files for cross-ref generation :-----htmsave <-- save dir for index.htm & misc HTML files
doc - Microsoft Word documents (could be maintained elsewhere if desired) + HTML files written out by MS WORD from the .doc files (includes subdirs of images linked to the .htm file)
htm |
|
tmp1 |
|
htmsave |
|
We will use aa99.htm as our sample file to illustrate the operating instructions for our hyperlink generation jobs. Please review the directories shown on the previous page. We will copy our MS WORD document to the 'doc' subdir before we run our UV jobs. MS Word will be used to write out the HTML version to the 'doc' subdir & the UV jobs will copy to the 'htm' subdir while inserting the hyperlinks.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
MS WORD |
|
dochtm21 |
|
dochtm22 |
|
dochtm23 |
|
dochtm24 |
|
uvsort |
|
dochtm25 |
|
dochtm26 |
|
dochtm27 |
|
IE/Netscape |
|
FTP |
|
dochts21 |
|
dochts21.bat |
|
dochts22 |
|
dochts22.bat |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Please see install.htm for the instructions to install the entire package of Vancouver Utilities for Unix/Linux (or WindowsDOS.htm for Windows).
This is intended to help you if need to install just the uvcopy jobs & scripts used for the hyperlink generation system.
An updated set of jobs & scripts could be requested by email or on diskette & this page shows you where they should be installed.
/home/uvadm <-- Vancouver Utilities superdir for Unix/Linux C:\uvwin <-- Vancouver Utilities superdir for Windows/DOS :-----batDOS <----- Windows/DOS scripts (batch files) : : - dochts21.bat, dochts22.bat :-----bin <-- unix/linux utility programs (uvcopy,uvsort,etc) :-----binDOS <-- Windows/DOS utility programs (uvcopy,uvsort,etc) :-----doc <-- text documentation for Vancouver Utilities :-----pf <-- Parameter Files (jobs) for uvcopy (interpreter) : :-----adm - subdirectories : :-----demo : :-----IBM : :-----util <----- hyperlink generation uvcopy jobs (dochtm21-27) :-----sf <-- Unix/Linux Script Files (korn shell scripts) : :-----adm - subdirectories : :-----demo : :-----IBM : :-----util <----- hyperlink generation scripts (dochts21,dochts22) :-----src <-- source code for C programs (uvcopy,uvsort,etc) :-----tmp
The extra length arrows '<-----' identifies subdirs to receive updated uvcopy jobs or scripts. The following instructions assume the updated uvcopy jobs & scripts are on diskette. We will use the 'mcopy' command for unix/linux & the 'copy' command for Windows/DOS.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
We will use aa99.htm as our sample file to illustrate the operating instructions for our hyperlink generation jobs. We will assume this MS WORD document exists in the 'doc' subdir. Please review the directories shown previously on page '1C1'.
First we will show you the step by step method, running the uvcopy jobs separately. Then we will show you the easy way using the 'dochts21' script which runs 4 uvcopy jobs with 1 command.
#1. use MS WORD to add hyperlink codes as described on page '1B1'.
#2. use MS WORD to write out the HTML version to doc/aa99.htm
#3. uvcopy dochtm21,fili1=doc/aa99.htm,filo1=tmp/aa99.xrf0 ======================================================= - extract keywords from Item Headings in HTML (to tmp1/aa99.xrf1)
#4. uvsort "fili1=tmp1/$1.xrf0,typ=LSTt,rcs=128,filo1=tmp1/$1.xrf1,key1u1=0(15)" ===========================================================================
#5. uvcopy dochtm22,fili1=tmp1/aa99.xrf1,filo1=tmp1/aa99.xrf2 ========================================================= - generate permuted keyword index (tmp1/aa99.xrf2)
#6. uvcopy dochtm23,fili1=tmp1/aa99.xrf2,filo1=tmp1/aa99.xrf3 ========================================================= - convert permuted keyword index to HTML (tmp1/aa99.xrf3)
#7. uvcopy dochtm24,fili1=doc/aa99.htm,filo1=htm/aa99.htm ======================================================= - copy HTML doc inserting hyperlinks & keyword index
Note |
|
uvcopy job 'dochtm26' will check all hyperlinks in all hTML documents in a directory & create a report showing undefined or multiply defined links. See sample report on page '1E1'.
#8a. uvcopy dochtm26,fild1=htm,filo1=tmp/hyperlink.errs <-- generate report ===================================================
#8b. uvlp14 tmp/hyperlink.errs <-- print report =========================
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here is the step by step method of creating the master cross-reference. Better to use the 'scripts' described on the next page.
#9. uvsort "fili1=tmp1/*xrf2,typ=LSTt,rcs=200,filo1=tmp1/mxrf.xrf,key1=16(40),rop=f2" ===================================================================================== - sort all tmp1/*xrf2 files together for the master cross-reference - write out to tmp1/mxrf.htm
#10. uvcopy dochtm25,fili1=tmp1/mxrf.xrf,filo1=htm/mxrf.htm ======================================================= - create the master keyword cross-reference - tmp1/mxrf.xrf is converted to HTML & written to htm/mxrf.htm
#11. cp -r doc/*files htm ====================== - copy the *files subdirs from doc (written by MS WORD) to htm
#12. Test locally by pointing your browser to /home/hyperlink/htm IE/Netscape --> file:///home/hyperlink/htm ===========================================
#13. Upload (FTP) the contents of htm to your web site
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
dochts21 |
|
dochts22 |
|
There are 2 versions of these scripts. One set is for Unix, Linux,& Windows/SFU and these may be found in /home/uvadm/sf/util/... The 2nd set is for Windows/DOS and these may be found in C:\uvwin\batDOS\...
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
These scripts make it easy to run the hyperlink generations, especialy if you have multiple files. We will illustrate the Operating Instructions assuming 2 files (ab01 & ab02). Please review the directories on page '1C1'.
#1. use MS WORD to add hyperlink codes as described on page '1B1'.
#2. use MS WORD to write out HTML files (in subdir doc/...) doc/ab01.doc --> doc/ab01.htm doc/ab02.doc --> doc/ab02.htm
#3. use script 'dochts21' to generate hyperlinks (outputs in htm subdir) Specify only the base filename without directory or extension
#3a. dochts21 ab01 <-- copy doc/ab01.htm to htm/ab01.htm ============= - inserting hyperlinks
#3b. dochts21 ab02 ... etc ... for as many documents as you have ... =============
#4a. uvcopy dochtm26,fild1=htm <-- generate report ==========================
#4b. uvlp14 tmp/hyperlink.errs <-- print report =========================
Note |
|
#5. use script 'dochts22' to generate the master cross-reference in htm Also copies image files & index.htm to htm Also generates statistics (counts hyperlinks by format)
#5a. dochts22 <-- generate master cross-ref, statistics, & copy files ========
#6. IE/Netscape/Mozilla --> file:///home/hyperlink/htm ===================================================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#7. Zip all files & subdirs in htm directory (for FTP to web site)
#7a. cd htm <-- change into htm for zip =======
#7b. zip -r htm.zip . <-- create zip archive for FTP to web site =================
#8. FTP to your web site
#8a. | ftp www.yourwebsite.com |
--> userID/password | |
--> binary | |
--> put htm.zip |
#9. telnet (or putty/ssh) www.yoursebsite.com --> userID/password --> cd public_WWW --> unzip htm.zip
#10. IE/Netscape/Mozilla https://www.yourwebsite.com ==============================================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here is a uvcopy job that you can use on your HTML code to verify that all HREFs have corresponding NAMEs (targets for HREFs) & that NAMEs are not multiply defined. This job is intended to check HREF/NAME tags 'within' each document (vs HREF/NAMEs to external documents). This is because the internal tags were much higher in volume & much harder to verify manually. The external check could also be done automatically if anybody requested.
BOF: dochtml/vsejcl.htm ** NAMEs multiply defined ** 1stLine# NAMEs <A NAME="0A5"> <FONT color="darkblue">0A5<...: 27 2 <A NAME="7D1"> <FONT color="darkblue">7D1<...: 834 2
** HREFs with NAMEs Undefined or Multiply defined ** 1stLine# HREFs NAMEs <A HREF="#1K7"> 1K7</A>. Op. Instrns to Con...: 450 1 0 <A HREF="#2P1"> 2P1</A>. alldiff - powerf...: 6612 1 0 <A HREF="#2Q1"> 2Q1</A>. CrossRefs - See s...: 2815 2 0 <A HREF="#2S1"> 2S1</A>. vtocr1 - create...: 2873 1 0 <A HREF="#2T1"> 2T1</A>. scans/reps - gener...: 2878 1 0 <A HREF="#2U1"> 2U1</A>. alldiff - powerf...: 2884 1 0 <A HREF="#2V1"> 2V1</A>. listrec2 - uvcopy...: 2891 1 0 <A HREF="#4C5"> 4C5</A>' as step #5 & i...: 6243 1 0 <A HREF="#4D4"> 4D4</A>. Converting & C...: 5143 3 0 <A HREF="#8A0"> 8A0</A>. File definitions m...: 9159 1 0 <A HREF="#9B2"> 9B2</A>. 'uvlp??' scripts f...: 9691 1 0 EOF: dochtml/vsejcl.htm Totals: Lines=12104, NAMEs=497, NAMEerrs=2, HREFs=5175, HREFerrs=11,
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
uvcopy dochtm26,fild1=htm,filo1=tmp/hyperlink.errs ===================================================
uvcopy dochtm26,fild1=htm <-- same as above (output file defaults as above) ==========================
vi tmp/hyperlink.errs - view report =====================
uvlp12 tmp/hyperlink.errs - print report =======================
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
uvcopy job 'dochtm27' can be used to creaate hyperlink summary table reports. This job reads all .htm files in the directory, scans for hyperlink NAMEs & HREFs, and builds summary tables. It summarizes the hyperlinks by converting lower case alphas to 'a's, UPPER case alphas to 'A's,& numeric digits to '9's.
dochtm27 2005/06/09_10:44:11 HTML link Analysis tbl#001 pg#001 -argument- line# count % counts by NAME/HREF/SRC
1 414 10 HREF="#AA99" 2 28 0 HREF="#AA99_99.99" 3 681 17 HREF="#AA99_99.9_" 4 654 17 HREF="#AAA" 5 328 8 HREF="#aaaa9" 6 546 14 HREF="aa99.htm#AA99_999.9" 7 327 8 HREF="aaaa.htm" 8 329 8 HREF="index.htm" 9 11 0 NAME=" _99.9_" 10 92 2 NAME="AA99" 11 3 0 NAME="AA99_99.9%" 12 74 1 NAME="AA99_99.99" 13 288 7 NAME="AA99_99.9_" 14 2 0 NAME="AAA" 15 3 0 NAME="aaaa9" 16 1 0 href="./aa-aaa_aaaaa/aaaaaaa.mso" 17 2 0 href="./aa-aaa_aaaaa/aaaaaaaa.mso" 18 2 0 href="./aa-aaa_aaaaa/aaaaaaaa.xml" 19 1 0 name="_Aaa999999999" 20 2 0 src="./aa-aaa_aaaaa/aaaaa999.aaa" 21 7 0 src="./aa-aaa_aaaaa/aaaaa999.gif" 22 22 0 src="./aa-aaa_aaaaa/aaaaa999.jpg"
3,817*100 *TOTAL*
As well as providing counts of the various hyperlink formats, you can see if there are any hyperlinks that do not conform to your desired formats.
There are 2 other reports (not shown) that can help yu find out where the non-standard hyperlinks are. Report #2 inserts the filename in front of the hyperlink patterns & report #3 inserts both filename & chapter code.
Note that (except for report #3), this hyperlink analysis can be run on any HTML file (not just those conforming to the UV standards).
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
'dochtm27' reads all .htm files in a directory & creates 3 reports. The following command shows the default input directory (htm) & the default output report filenames (in the tmp subdir).
uvcopy dochtm27,fild1=htm,filo1=tmp/hyperlinks1,filo2=hyperlinks2\ ================================================================== ,filo3=tmp/hyperlinks3 ======================
If you are happy with the default input directory & output report names, then you can run the job as follows:
uvcopy dochtm27 <-- default indir htm, default outdir tmp ==============
vi tmp/hyperlinks1 <-- examine 1st report with vi ==================
uvlp12 tmp/hyperlinks1 <-- print 1st report using UV script uvlp12 ====================== (prints on laser at 12 cpi)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
We will illustrate Hyperlink Generation by showing the Before & After for a few lines of text selected from the 'TABLE OF CONTENTS' of a typical document. We cant show the MS WORD document since it is a complex binary file, but we will show the text equivalent & the HTML Before & After converting the chapter codes to hyperlinks (NAMEs & HREFs).
TABLE OF CONTENTS Chapter_BA01
#BA01 - About This Document: Administrative Instructions
#BA02 - About Airfare Agents Ticketing: Introduction
<p class=MsoNormal align=right style='text-align:right'><b><u><span lang=EN-GB style='font-size:16.0pt;mso-bidi-font-size:12.0pt'>TABLE OF CONTENTS</span></u></b> <b><span lang=EN-GB style='font-size:16.0pt;mso-bidi-font-size:12.0pt'> <span style="mso-spacerun: yes">| | | | | | | | </span></span></b><b> <span lang=EN-GB style='mso-bidi-font-size:16.0pt' >Chapter_BA01</span></b> <b><u><span lang=EN-GB style='font-size:16.0pt;mso-bidi-font-size:12.0pt'> <o:p></o:p></span></u></b></p>
<p class=MsoNormal><u><span lang=EN-GB style='mso-bidi-font-size:16.0pt'> <![if !supportEmptyParas]> <![endif]><o:p></o:p></span></u></p>
<p class=MsoNormal><span lang=EN-GB style='mso-bidi-font-size:16.0pt'> <![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p>
<p class=MsoHeader style='text-indent:.5in;tab-stops:.5in'><b><span lang=EN-GB style='font-size:14.0pt'>#BA01 <span style='mso-tab-count:1'>| | | </span></span></b><b> <span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size:10.0pt'>–</span></b><b> <span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size:12.0pt'> <span style='mso-tab-count:1'>| | | | | | | </span>About This Document: <span style="mso-spacerun: yes">| </span>Administrative Instructions <o:p></o:p></span></b></p>
<p class=MsoNormal><b><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size: 12.0pt'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></b></p>
<p class=MsoNormal style='text-indent:.5in'><b><span lang=EN-GB style='font-size:14.0pt'>#BA02 <span style='mso-tab-count:1'>| | | </span></span></b><b> <span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size:10.0pt'>–</span></b> <b><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size:12.0pt'> <span style='mso-tab-count:1'>| | | | | | | </span>About Airfare Agents Ticketing: <span style="mso-spacerun: yes">| </span>Introduction<o:p></o:p></span></b></p>
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
<A NAME="TOC"></A> <p class=MsoNormal align=right style='text-align:center'><b><u><span lang=EN-GB style='font-size:16.0pt;mso-bidi-font-size:12.0pt'>TABLE OF CONTENTS</span></u></b> <b><span lang=EN-GB style='font-size:16.0pt;mso-bidi-font-size:12.0pt'> <span style="mso-spacerun: yes"> </span></span></b><b> <span lang=EN-GB style='mso-bidi-font-size:16.0pt' ><A NAME="BA01"><FONT color="darkblue">Chapter_BA01</FONT></A></span></b> <b><u><span lang=EN-GB style='font-size:16.0pt;mso-bidi-font-size:12.0pt'> <o:p></o:p></span></u></b></p>
<p class=MsoNormal><u><span lang=EN-GB style='mso-bidi-font-size:16.0pt'> <![if !supportEmptyParas]> <![endif]><o:p></o:p></span></u></p>
<p class=MsoHeader style='text-indent:.5in;tab-stops:.5in'><b><span lang=EN-GB style='font-size:14.0pt'>#<A HREF="#BA01">BA01</A> <span style='mso-tab-count:1'> </span></span></b><b> <span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size:10.0pt'>–</span></b><b> <span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size:12.0pt'> <span style='mso-tab-count:1'> </span>About This Document: <span style="mso-spacerun: yes"> </span>Administrative Instructions <o:p></o:p></span></b></p>
<p class=MsoNormal style='text-indent:.5in'><b><span lang=EN-GB style='font-size:14.0pt'>#<A HREF="#BA02">BA02</A> <span style='mso-tab-count:1'> </span></span></b><b> <span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size:10.0pt'>–</span></b> <b><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size:12.0pt'> <span style='mso-tab-count:1'> </span>About Airfare Agents Ticketing: <span style="mso-spacerun: yes"> </span>Introduction<o:p></o:p></span></b></p>
Here are the conversions of the 1 chapter 'NAME' definition & the 2 chapter 'HREF' references from the 'BEFORE' & 'AFTER' samples above. Note that chapter 'NAME's are identified by the leading '_' & chapter 'HREF's are identified by the leading '#'.
>Chapter_BA01< <--BEFORE ><A NAME="BA01"><FONT color="darkblue">Chapter_BA01</FONT></A>< <--AFTER
style='font-size:14.0pt'>#BA01 <--BEFORE style='font-size:14.0pt'>#<A HREF="#BA01">BA01</A> <--AFTER
style='font-size:14.0pt'>#BA02 <--BEFORE style='font-size:14.0pt'>#<A HREF="#BA02">BA02</A> <--AFTER
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The objective is to create a hyperlinked keyword index (inserted at the end of the document) to allow quick access to any desired topic by clicking on the selected keyword. We will assume that the item heading lines conform to the decimal point standard (1.1, 1.2, 1.3, etc) as illustrated in the following example:
DISPLAY TICKET MASK Chapter_BA04
1.1 Input for a single-party ticket
>TPN:XX/P1
1.2 Input for a multi-party ticket
>TPN:XX/P3/5-7/9/11-12
1.3 Input for infant ticket
>TPN:XX/INF1
ab01-BA04 1.1 Input: Input for a single-party ticket ab01-BA04 1.2 Input: Input for a multi-party ticket ab01-BA04 1.3 Input: Input for infant ticket ab01-BA04 1.3 Infant: Input for infant ticket
ab01-BA04 1.2 Multi-party: Input for a multi-party ticket
ab01-BA04 1.1 Single-party: Input for a single-party ticket
ab01-BA04 1.1 Ticket: Input for a single-party ticket ab01-BA04 1.2 Ticket: Input for a multi-party ticket ab01-BA04 1.3 Ticket: Input for infant ticket
'Permuted' means that we generate a separate line for each significant word in the Item Heading lines. Each significant word is inserted at the begining of the heading line & all lines are sorted into alpha sequence by the leading significant words.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
HTML Hyperlinks require 2 things: the 'NAME' (definition or target) & the 'HREF' (reference). The 'NAME's are generated prior to the Item Heading lines (identified by the 1.1, 1.2, etc). For example:
1.1 Input for a single-party ticket <-- Item Heading line
<A NAME="BA04_01.10"><FONT color="darkblue">1.1</FONT></A> <-- NAME Generated
This is an extracted text equivalent of the HTML which is more complex. You can see the actual HTML 'BEFORE' & 'AFTER' (NAME insertion) on the following 2 pages.
Please see the sample permuted keyword index listed on the previous page. Several steps & temporary work files are required. For example we will assume our input document is xx99.htm in subdir doc.
<p> BA04_01.10 1.1 Input: Input for a single-party ticket
BA04_01.20 1.2 Input: Input for a multi-party ticket
BA04_01.30 1.3 Input: Input for infant ticket
BA04_01.30 1.3 Infant: Input for infant ticket
</p><p> BA04_01.20 1.2 Multi-party: Input for a multi-party ticket
</p><p> BA04_01.10 1.1 Single-party: Input for a single-party ticket
</p><p> BA04_01.10 1.1 Ticket: Input for a single-party ticket
BA04_01.20 1.2 Ticket: Input for a multi-party ticket
BA04_01.30 1.3 Ticket: Input for infant ticket
</p>
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
<p class=MsoHeading9><b style='mso-bidi-font-weight:normal'><u><span lang=EN-GB style='font-family:"Times New Roman"'>DISPLAY TICKET MASK: MANUAL</span></u></b> <span lang=EN-GB style='font-family:"Times New Roman"'> <span style="mso-spacerun: yes">||||||||||||| </span></span> <b style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:12.0pt; mso-bidi-font-size:16.0pt;font-family:"Times New Roman"' >Chapter_BA04</span></b> <span lang=EN-GB style='font-family:"Times New Roman"'><o:p></o:p></span></p>
<p class=MsoHeader style='tab-stops:.5in'><b style='mso-bidi-font-weight:normal'> <span lang=EN-GB>1.1<span style="mso-spacerun: yes">|||| </span> Input for a single-party ticket<o:p></o:p></span></b></p>
<p class=MsoNormal style='margin-left:.5in;border:none;mso-border-alt: solid windowtext .5pt; padding:0in;mso-padding-alt:1.0pt 4.0pt 1.0pt 4.0pt'> <span lang=EN-GB>>TPN:XX/P1 <span style="mso-spacerun: yes">|||| </span>(enter)</span></p>
<p class=MsoHeader style='tab-stops:.5in'><b style='mso-bidi-font-weight:normal'> <span lang=EN-GB>1.2<span style="mso-spacerun: yes">|||| </span> Input for a multi-party ticket<o:p></o:p></span></b></p>
<p class=MsoNormal style='margin-left:.5in;border:none;mso-border-alt: solid windowtext .5pt; padding:0in;mso-padding-alt:1.0pt 4.0pt 1.0pt 4.0pt'> <span lang=EN-GB>>TPN:XX/P3/5-7/9/11-12 <span style="mso-spacerun: yes">|||| </span>(enter)</span></p>
<p class=MsoHeader style='tab-stops:.5in'><b style='mso-bidi-font-weight:normal'> <span lang=EN-GB>1.3<span style="mso-spacerun: yes">|||| </span> Input for infant ticket<o:p></o:p></span></b></p>
<p class=MsoNormal style='margin-left:.5in;border:none;mso-border-alt: solid windowtext .5pt; padding:0in;mso-padding-alt:1.0pt 4.0pt 1.0pt 4.0pt'> <span lang=EN-GB>>TPN:XX/INF1 <span style="mso-spacerun: yes">||| </span>(enter)</span></p>
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
<p class=MsoHeading9><b style='mso-bidi-font-weight:normal'><u><span lang=EN-GB style='font-family:"Times New Roman"'>DISPLAY TICKET MASK: MANUAL</span></u></b> <span lang=EN-GB style='font-family:"Times New Roman"'> <span style="mso-spacerun: yes"> </span></span> <b style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:12.0pt; mso-bidi-font-size:16.0pt;font-family:"Times New Roman"' ><A NAME="BA04"><FONT color="darkblue">Chapter_BA04</FONT></A></span></b> <span lang=EN-GB style='font-family:"Times New Roman"'><o:p></o:p></span></p>
<p class=MsoHeader style='tab-stops:.5in'><b style='mso-bidi-font-weight:normal'> <span lang=EN-GB><A NAME="BA04_01.10"><FONT color="darkblue">1.1</FONT></A> <span style="mso-spacerun: yes"> </span> Input for a single-party ticket<o:p></o:p></span></b></p>
<p class=MsoNormal style='margin-left:.5in;border:none;mso-border-alt: solid windowtext .5pt; padding:0in;mso-padding-alt:1.0pt 4.0pt 1.0pt 4.0pt'> <span lang=EN-GB>>TPN:XX/P1 <span style="mso-spacerun: yes"> </span>(enter)</span></p>
<p class=MsoHeader style='tab-stops:.5in'><b style='mso-bidi-font-weight:normal'> <span lang=EN-GB><A NAME="BA04_01.20"><FONT color="darkblue">1.2</FONT></A> <span style="mso-spacerun: yes"> </span> Input for a multi-party ticket<o:p></o:p></span></b></p>
<p class=MsoNormal style='margin-left:.5in;border:none;mso-border-alt: solid windowtext .5pt; padding:0in;mso-padding-alt:1.0pt 4.0pt 1.0pt 4.0pt'> <span lang=EN-GB>>TPN:XX/P3/5-7/9/11-12 <span style="mso-spacerun: yes"> </span>(enter)</span></p>
<p class=MsoHeader style='tab-stops:.5in'><b style='mso-bidi-font-weight:normal'> <span lang=EN-GB><A NAME="BA04_01.30"><FONT color="darkblue">1.3</FONT></A> <span style="mso-spacerun: yes"> </span> Input for infant ticket<o:p></o:p></span></b></p>
<p class=MsoNormal style='margin-left:.5in;border:none;mso-border-alt: solid windowtext .5pt; padding:0in;mso-padding-alt:1.0pt 4.0pt 1.0pt 4.0pt'> <span lang=EN-GB>>TPN:XX/INF1 <span style="mso-spacerun: yes"> </span>(enter)</span></p>
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# dochts21 - insert Chapter Hyperlinks & Keyword Cross-Ref in HTML doc # - input HTML doc was converted to HTML by MS Word # - by Owen Townsend UVSI, July 2004 # - 1st of 2 scripts used in hyperlink generation # dochts21 - is used to generate hyperlinks in each of multiple documents # dochts22 - is then used once to generate the master cross-reference # # This script (dochts21) runs 4 uvcopy jobs & 1 uvsort # dochtm21 - extracts keywords from HTML (from doc/xx99.htm to tmp1/xx99.xrf0) # uvsort - sort/drop dups on chptr#+item# from tmp1/xx99.xrf0 -> xx99.xrf1 # dochtm22 - generates permuted keywords cross-ref (tmp1/xx99.xrf2) # dochtm23 - converts permuted keyword xref to HTML (tmp1/xx99.xrf3) # dochtm24 - insert Chapter hyperlinks & keyword xref # - while copying MSWORD html from subdir doc to subdir htm # cp - copy the ???_files subdir from .doc to .htm # if [[ ! -f doc/$1.htm ]]; then echo "usage: dochts21 basefilename [options]" echo " ===============================" echo "example: dochts21 ab01 <-- input will be doc/ab01.htm" echo " =============" echo "- arg1 must be a file in subdir doc, will be copied to htm" echo "- arg1 file must be HTML converted from MS Word" echo "- arg2 [options] 'h1' for Return to HOME-Page ../index.htm" exit 1; fi # if [[ ! -d tmp1 ]]; then mkdir tmp1; fi #ensure tmp1 subdir present # echo "copy each doc/_?_.htm to htm/_?_.htm inserting hyperlinks & gen xref" echo "arg1=$1, inputfile=doc/$1.htm, outputfile=htm/$1.htm" echo " - xrefs are stored in tmp1 subdir for master xref (dochts22)" echo " - clear tmp & tmp1 subdirs ? (on 1st of multiple docs) ? y/n" reply=n; read reply until [[ "$reply" == "y" || "$reply" == "n" ]] do echo "clear tmp & tmp1 subdirs ? (on 1st of multiple docs) ? y/n" read reply; done if [[ "$reply" == "y" ]] then rm -f tmp/*; rm -f tmp1/*; fi # # run the jobs: # note - only fili1=... matters, output filenames derived from input in jobs uvcopy dochtm21,fili1=doc/$1.htm,filo1=tmp1/$1.xrf0,uop=q0$2 uvsort "fili1=tmp1/$1.xrf0,typ=LSTt,rcs=128,filo1=tmp1/$1.xrf1,key1u1=0(15)" uvcopy dochtm22,fili1=tmp1/$1.xrf1,filo1=tmp1/$1.xrf2,uop=q0$2 uvcopy dochtm23,fili1=tmp1/$1.xrf2,filo1=tmp1/$1.xrf3,uop=q0$2 uvcopy dochtm24,fili1=doc/$1.htm,filo1=htm/$1.htm,fili2=tmp1/$1.xrf3,uop=q0$2 cp -rf doc/${1}_files htm # copy _files subdir of images exit 0
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# dochts22 - final step of WORD documents conversion to HTML # - this script run after all documents converted & includes: # - by Owen Townsend, UVSI, Sep2004, updt Jun2005 # # uvsort - sort all keyword cross-reference files together # dochtm25 - convert the master cross-reference to HTML # - copy all *files subdirs from doc to htm # - copy htmsave/* (index.htm & any gifs etc) to htm # (so htm complete for zip & FTP put) # dochtm26 - run hyperlink ERROR report (leave in tmp/hyperlink.errs) # dochtm27 - run statistics reports (leave in tmp subdir) # # - 2nd of 2 scripts to generate hyperlinks # dochts21 - was used to generate hyperlinks in each of multiple documents # dochts22 - (this) is then used once to generate the master cross-reference # - for all documents # echo "dochts22 - sort all keyword crossrefs together & create master xref" if [[ -d doc && -d htm && -d tmp1 && "$1" == "all" ]]; then : else echo "usage: dochts22 all [options]" echo " ======================" echo "- arg1 must be 'all'" echo "- arg2 [options] 'h1' for Return to HOME-Page ../index.htm" echo "- must be run in superdir with subdirs doc,htm,tmp1" exit 1; fi # uvsort "fili1=tmp1/*xrf2,typ=LSTtb1,rcs=200,filo1=tmp1/mxrf.xrf,key1=16(40),rop=f2" #=============================================================================== # - sort all keyword indexes into 1 master cross-reference file # uvcopy dochtm25,fili1=tmp1/mxrf.xrf,filo1=htm/mxrf.xrf,uop=q0$2 #============================================================== # - convert master cross-reference to HTML # cp -rf doc/*_files htm # copy *_files subdirs(images) from doc to htm #===================== # cp -f htmsave/* htm # copy htmsave files (index.htm,etc) to htm #================== # uvcopy dochtm26,fild1=htm,uop=q0$2 # gen ERR report tmp/hyperlink.errs #================================= # uvcopy dochtm27,fild1=htm,uop=q0$2 # gen link analysis tmp/hyperlink1,2,3 #================================= exit 0
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# dochts23 - generate hyperlinks in MSWORD HTML files & generate master crossref # - processes all *.htm files in subdir doc into subdir htm # - this script combines scripts dochts21 & dochts22 # - by Owen Townsend, UVSI, September 2004 # # dochts21 - generates hyperlinks in each of multiple documents # dochts22 - generates the master cross-reference for all documents # - also copies index.htm (& any other files) from htmsave to htm # dochts23 - combines above 2 scripts (1 command does it all) # - works Korn shell scripts under unix,linux,& Windows/SFU # - not available as a batch file for Windows/DOS command window # if [[ -d doc && -d htm && -d tmp1 ]]; then : else echo "dochts23 - gen hyperlinks in MSWORD HTML files & gen master xref" echo " - no arguments required" echo " - must be run in superdir with subdirs doc,htm,tmp1" exit 1; fi # # run dochts21 for each *.htm file in subdir doc (output in subdir htm) for dfx in doc/*.htm { fx=$(basename $dfx) f=${fx%.htm} dochts21 $f } # now gen master xref for all htms & copy index.htm,etc from htmsave to htm dochts22 exit 0
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
@echo off rem dochts21.bat - insert Chapter Hyperlinks & Keyword Cross-Ref in HTML doc rem - input HTML doc was converted to HTML by MS Word rem - by Owen Townsend UVSI, September 2004 rem - 1st of 2 scripts used in hyperlink generation rem dochts21 - is used to generate hyperlinks in each of multiple documents rem dochts22 - is then used once to generate the master cross-reference rem rem This script (dochts21) runs 4 uvcopy jobs & 1 uvsort rem dochtm21 - extracts keywords from HTML (doc/xx99.htm to tmp1/xx99.xrf0) rem uvsort - sort/drop dups on chptr#+item# from tmp1/xx99.xrf0 -> xx99.xrf1 rem dochtm22 - generates permuted keywords cross-ref (tmp1/xx99.xrf2) rem dochtm23 - converts permuted keyword xref to HTML (tmp1/xx99.xrf3) rem dochtm24 - copies HTML doc inserting Chapter hyperlinks & keyword xref rem if "%1" == "" goto error if exist "doc/%1.htm" goto process :error echo "usage: dochts21 basefilename [options]" echo " ===============================" echo "example: dochts21 ab01 <-- input will be doc/ab01.htm" echo " =============" echo "- arg1 file must be HTML converted from MS Word" echo "- arg2 [options] 'h1' for Return to HOME-Page ../index.htm" echo "- arg1 must be a file in subdir doc, will be copied to htm" goto end :process rem echo "copy each doc/_?_.htm to htm/_?_.htm inserting hyperlinks & gen xref" echo "arg1=%1, input-file=doc\%1.htm, output-file=htm\%1.htm" echo "- xrefs are stored in tmp1 subdir for master xref (dochts22)" echo "- should clear tmp & tmp1 subdirs on 1st of multiple docs !!!" echo "- if 1st of multiple, --> ^C (cancel), --> del tmp1\* ,& rerun " echo " - else enter to continue" pause rem ensure tmp1 subdir present & run the 4 uvcopy jobs if not exist tmp1 mkdir tmp1 rem note - only fili1=... matters, output filenames derived from input in jobs uvcopy dochtm21,fili1=doc/%1.htm,filo1=tmp1/%1.xrf0,uop=q0%2 uvsort "fili1=tmp1/%1.xrf0,typ=LSTt,rcs=128,filo1=tmp1/%1.xrf1,key1u1=0(15)" uvcopy dochtm22,fili1=tmp1/%1.xrf1,filo1=tmp1/%1.xrf2,uop=q0%2 uvcopy dochtm23,fili1=tmp1/%1.xrf2,filo1=tmp1/%1.xrf3,uop=q0%2 uvcopy dochtm24,fili1=doc/%1.htm,filo1=htm/%1.htm,fili2=tmp1/%1.xrf3,uop=q0%2 rem rem - we must also copy the *_files (images) written by MSWORD in doc rem deltree /Y htm\%1_files rem NOTE - deltree unrecogized by Win XP DOS mkdir htm\%1_files copy doc\%1_files\* htm\%1_files :end
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
@echo off rem dochts22.bat - sort all keyword cross-reference files together rem - convert the master cross-reference to HTML rem - copy htmsave/* (index.html + any gifs, etc) to htm rem - so htm complete for local test & zip/FTP to web site rem - run hyperlink error report (leave in tmp subdir) rem - run hyperlink analysis reports (leave in tmp subdir) rem - by Owen Townsend, UVSI, September 2004 rem - 2nd of 2 scripts to generate hyperlinks rem rem dochts21 - was used to generate hyperlinks in each of multiple documents rem dochts22 - (this) is then used once to generate the master cross-reference rem - for all documents rem echo "dochts22.bat - sort all keyword crossrefs together & create master xref" if not exist doc goto error if not exist htm goto error if not exist tmp1 goto error if "%1" == "all" goto process :error else echo "usage: dochts22 all [options]" echo " ======================" echo "- arg1 must be 'all'" echo "- arg2 [options] 'h1' for Return to HOME-Page ../index.htm" echo "- must be run in superdir with subdirs doc,htm,tmp1" goto end :process uvsort "fili1=tmp1/*xrf2,typ=LSTt,rcs=200,filo1=tmp1/mxrf.xrf,key1=16(40),rop=f2" rem ============================================================================ rem - sort all keyword indexes into 1 master cross-reference file rem uvcopy dochtm25,fili1=tmp1/mxrf.xrf,filo1=htm/mxrf.xrf,uop=q0%2 rem =========================================================== rem - convert master cross-reference to HTML rem copy htmsave\* htm rem ============== rem - copy index.html, etc from htmsave to htm rem uvcopy dochtm26,fild1=htm,uop=q0%2 rem ============================== rem - create hyperlink error report in tmp subdir uvcopy dochtm27,fild1=htm,uop=q0%2 rem ============================== rem - create statistics hyperlink counts in tmp subdir :end
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
This sample is presented here in case you want to create your own Home_page with a text editor (vs an HTML editor).
<HTML><HEAD> <TITLE> Testing Hyperlink Generation in HTML from MS WORD </TITLE> <style> body {background-color: #FFFF80; color: black} h1, h2, h3 {font: bold arial; text-align: center; color: black} p {font-family: arial; font-size: 14pt; font-weight: 400} ol {font-family: arial; font-size: 14pt; font-weight: 400} ul {font-family: arial; font-size: 14pt; font-weight: 400} pre {font-family: courier, monospace; font-size: 14pt; font-weight: 500} table {font-family: arial; font-size: 14pt; font-weight: 600, color: black} </style> </HEAD> <BODY> <A NAME="page1"></A> <H2 ALIGN=center> Testing Hyperlink Generation in HTML from MS WORD </H2> <UL> <LI> <A HREF="ps01.htm"> Professional Services </A> <LI> <A HREF="ps02.htm"> PS Test File </A> <LI> <A HREF="ro01.htm"> Retail Operations </A> <LI> <A HREF="mxrf.htm"> Master Cross-Reference </A> </UL>
<P>Hyperlink Generation is a joint venture of UV Software and Smart-Text Solutions, both of which have been in business for over 20 years. Please see more information on their web sites listed below.
<P><A href="https://www.uvsoftware.ca/"> <span style="text-decoration: none">UV Software </span> </A> provides data manipulation & sorting utilities for Unix, Linux,& Windows. UV Software specializes in converting mainframe JCL, COBOL, and DATA to lower cost Unix, Linux,& Windows systems.
<P><A href="https://www.smart-text.com/"> <span style="text-decoration: none">Smart-Text Solutions</span></A> provides Knowledge Management, Technical Publishing, and Corporate Portal development and management services and solutions to major corporations worldwide.</p>
<H2> Visitor Counters for ThisYear and LastYear </H2>
<B> <!--#exec cgi="/cgi-bin/uvhitctr2.pl"--> </B> <HR> </BODY> </HTML>
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
2A1. | Converting Legacy text documentation to HTML - Overview |
2B1. | Sample TEXT to HTML conversion (Before & After) |
2C1. | Jobs & Scripts to convert Vancouver Utility Legacy Documentation to HTML |
(uvhtm11, uvhtm21, uvhtm31, uvhtmA, uvhtm2X) |
2D1. | htmlchk1 - verify HTML HREFs & report missing NAMEs (targets for HREFs). |
- htmlchk1 (here in Part 2) is same as dochtm26 (in Part 1) |
2E1. | unhtml1 - convert HTML documents to text (strip out <---->) |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
This section describes how the UV Software text documentation is automatically converted to HTML & FTP'd to the website. This may be of interest to other sites with legacy documentation perhaps maintained with mainframe editors. If your legacy documentation has a clear set of rules for page headings & section/chapter references, then you (or UV Software) could write a uvcopy job to automatically convert your legacy documentation to HTML.
Over 99.8% of the HTML you see here on the UV Software web site was generated automatically. Only a few small files such as index.htm were coded manually. The voluminous documentation (99.8%) continues to be maintained via the UNIX 'vi' editor. When website updates are made (monthly or whatever) the 99.8% is reconverted & merged with the few small hand coded files. The result is 'tar'd, compressed,& FTP'd to the webserver.
The major labour saving comes from the automatic generation of the HREF and NAME tags. UV Software was already using a coding technique that lent itself to automatic genration. Please note the contents & page heading codes: A1, A2, B1, B2, etc ... If these codes appear in the table of contents (or anywhere other than a heading), then an HTML HREF hyperlink is generated. If these codes appear in a page or paragraph heading, then an HTML NAME tag (target for an HREF) is generated.
Vancouver Utility text documents use 2 different conventions for hyperlinks (NAME definitions/targets & HREF references/links). The first convention uses 1 UPPER case alpha followed by 1 or 2 digits (A1,A2...,B1,B2).
The second convention uses 1 or 2 digits + 1 UPPER alpha + 1 or 2 digits (1A1,1A2,...,1B1,1B2...etc,2A1,2A2...,2B1,2B2...etc). This is used for longer more important docuements with multiple parts (1st digit of code).
Note that the first convention is used for the examples in this document, but this document is coded using the 2nd convention (since it has 2 parts).
For longer more important documents (such as MVSJCL.doc), we also generate a 'permuted keyword index' (cross-reference) & insert it at the end. Keywords are extracted from the ** headings, permuted, sorted,& converted to HTML hyperlinks. "permuting" shows each word in turn at the begining of the original sentence & sorts on these keywords. Insignificant words are dropped by a table which is easily updated.
Each page (about every 50 lines) of the main document includes a link to the keyword index, so you can quickly get to the index & then to the 1st letter of the desired keywords.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#1. Inserts initial <HTML> <HEAD> <TITLE> ... </TITLE> <STYLE> ................. </STYLE> </HEAD> <BODY> <A NAME="page1"> </A>
#2. Generates HREF hyperlinks & NAME targets for UVdoc section/page# references. - UVdoc uses unique codes for page# references: A1. A2. B1. B2. C01. C02... that allow automatic generation of HREF/NAME hyperlinks - these codes generate HREFs when found in non-headings, as in table of contents (or anywhere as long as not a heading). <A HREF="#C1">C1</A>. ----description of C1---- - these codes generate NAMEs when found in page or paragraph headingsC1. ----description of C1----
#3. Generates HTML centered heading code for UVdoc headings - inserts <H2 ALIGN=center>...</H2> hdr ID's on 1st text line on page - inserts <H3 ALIGN=center>...</H3> hdr ID's on ** ... ** mid-page headings
#4. Inserts <p>...</p> markers around text paragraphs (paras WITHOUT multiple embedded blanks or special characters)
#5. Inserts <pre>...</pre> markers around code paragraphs (paras WITH multiple embedded blanks or special characters)
#6. At end of each page, insert HREF's & NAME: <A HREF="#page1"> return to first page </A> <A HREF="index.htm"> return to UVSI Home-Page </A>
#7. At end of file generate: </BODY> </HTML>
#8. On all lines, convert special HTML characters: '<' to '<', '>' to '>', '&' to '&', etc
#9. Optionally (for longer more important files such as MVSJCL.doc) - generate & a keyword index & append at the end of the HTML document - performed by optional script 'uvhtm2X' (listed on page '2C4').
This conversion is illustrated on the next 2 pages. Please see the sample UVdoc text INPUT on the next page (lines numbered from 01 thru 32). Please compare this to the automatically generated HTML OUTPUT 2 pages ahead (lines numbered from 01 thru 38).
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
01 **************************************************************************** 02 Part_9 Free Hit Counter from UV Software 03 **************************************************************************** 04 05 ** Part 9 Hit Counter - Contents ** 06 07 9A1. Hit Counter Description & Example 08 09 9B1. Instructions to Download & Install 10 11 9C1. Hit Counter source code listing (perl) 12 13 *Eject 14 **************************************************************************** 15 9A1. Free Hit Counter from UV Software 16 **************************************************************************** 17 18 "uvhitctr2.pl" is a CGI Perl program that you may download from UV Software. 19 It displays counts month by month for this year & last year, for example: 20 21 ** Visitor Counter for This Year and Last Year ** 22 23 ThisYear=000016 (J=0,F=0,M=0,A=0,M=0,J=0,J=16,A=0,S=0,O=0,N=0,D=0) 24 LastYear=000078 (J=1,F=2,M=3,A=4,M=5,J=6,J=7,A=8,S=9,O=10,N=11,D=12) 25 26 ** 2 lines of code required in your HTML documents ** 27 28 <H2 align=center> Visitor Counters for This Year and Last Year </H2> 29 <!--#exec cgi="/cgi-bin/uvhitctr2.pl" --> 30 31 At UV Software the documentation is maintained as text files so it can be 32 edited with unix/linux editors such as 'vi'. The HTML is automatically 33 generated from the text files. The automatic conversion inserts the SSI 34 call to uvhitctr2.pl at the end of every document. 35 36 ** Requirements for Hit Counter ** 37 38 1. Server Side Includes (SSIs) must be active on your web server 39 40 2. SSI's should be active for .htm documents. Some ISP's restrict SSI's 41 to '.shtml's, but on request they should be able to expand to .htms. 42
See corresponding HTML output on the next page --->
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
01 <HTML><HEAD> 02 <TITLE> Free Hit Counter from UV Software </TITLE> 03 <style> 04 body {background-color: lightblue; color: black} 05 h1,h2,h3 {font: bold arial; text-align: center; color: black} 06 p {font-family: arial; font-size: 14pt; font-weight: 400} 07 ol {font-family: arial; font-size: 14pt; font-weight: 400} 08 ul {font-family: arial; font-size: 14pt; font-weight: 400} 09 pre {font-family: courier, monospace; font-size: 14pt; font-weight: 500} 10 table {font-family: arial; font-size: 14pt; font-weight: 600, color: black} 11 </style> </HEAD> 12 <BODY> 13 <A NAME="page1"> </A> 14 15 <H2 ALIGN=center> <A NAME="Part_9"><FONT color="darkblue">Part_9</FONT></A> Free Hit Counter from UV Software </H2 16 17 <H2 ALIGN=center> Part 9 Hit Counter - Contents </H2> 18 19 <p> <A HREF="#9A1">9A1</A>. Hit Counter Description & Example </p> 20 <p> <A HREF="#9B1">9B1</A>. Instructions to Download & Install </p> 21 <p> <A HREF="#9C1">9C1</A>. Hit Counter source code listing (perl) </p> 22 23 <p>Goto: 24 <A HREF="#page1"> Begin this doc </A> , 25 <A HREF="#hitctrs"> End this doc </A> , 26 <A HREF="#kwindex"> Index this doc </A> , 27 <A HREF=" .htm"> Contents this library </A> , 28 <A HREF="index.htm"> UVSI Home-Page </A> </p> 29 30 <H2 ALIGN=center> <A NAME="9A1"><FONT color="darkblue">9A1</FONT></A>. Free Hit Counter from UV Software </H2> 31 32 <p> "uvhitctr2.pl" is a CGI Perl program that you may download from UV Software. 33 It displays counts month by month for this year & last year, for example: </p> 34 35 <H2 ALIGN=center> Visitor Counter for This Year and Last Year </H2> 36 37 <pre> ThisYear=000016 (J=0,F=0,M=0,A=0,M=0,J=0,J=16,A=0,S=0,O=0,N=0,D=0) 38 LastYear=000078 (J=1,F=2,M=3,A=4,M=5,J=6,J=7,A=8,S=9,O=10,N=11,D=12)</pre> 39 40 <H2 ALIGN=center> 2 lines of code required in your HTML documents </H2> 41 42 <pre> <H2 align=center> Visitor Counters for This Year and Last Year </H2> 43 <!--#exec cgi="/cgi-bin/uvhitctr2.pl" --></pre> 44 45 <p> At UV Software the documentation is maintained as text files so it can be 46 edited with unix/linux editors such as 'vi'. The HTML is automatically 47 generated from the text files. The automatic conversion inserts the SSI 48 call to uvhitctr2.pl at the end of every document. </p> 49 50 <H2 ALIGN=center> Requirements for Hit Counter </H2> 51 <OL START="01"> 52
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
These jobs are customized to the Vancouver Utility style of documentation. There are 3 versions of the UVdoc to HTML converter, differing mostly in the HTML HREF/NAME tag identifiers.
uvhtm11 - for most VU documents with only 1 major topic (1 part) - HREF/NAME tags ID patterns "A9" & "A99" (where 'A' represents UPPER case alphas,& '9'represents digits) - NAME is assumed if A9/A99 occurs in a page heading or item heading - NAME Examples: A1 A2 B1 B2 C01 C02 etc - HREF is assumed if "A9." or "A99." found at begining of line or anywhere on line when enclosed in single quotes 'A9' or 'A99' (in which case the period can be omitted). - HREF Examples: A1. A2. B1. B2. B10. or 'A1' 'A2' 'B1' 'B2' 'B10'
uvhtm21 - for MVSJCL.doc, MVSDATA.doc, ..., HTMLjobs.doc (this doc) - HREF/NAME tags ID patterns "9A9" or "9A99" or "99A99" (where 'A' represents UPPER case alphas,& '9'represents digits) - NAME assumed if 9A9...99A99 occurs in a page heading or item heading - NAME Examples: 1A1 1A2... 1B1 1B2... 2A1 2A2... 10A01 99Z99 - HREF assumed if "9A9." to "99A99." found at begining of line or anywhere on line when enclosed in single quotes '9A9' or '99A99' - HREF Examples: 1A1 1A2... 1B1 1B2... 2A1 2A2... 10A01 99Z99 - also generates NAME & HREFs for: Part_1, Part_2, ... Part_9
uvhtm31 - for uvcopy3.doc (the uvcopy instruction reference manual) - HREF/NAME tags ID patterns = instruction IDs in backquotes `add`, `mvc`, etc (anything in backquotes up to 28 bytes)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
uvcopy uvhtm11,fili1=doc/uvintro.doc,filo1=tmp/uvintro.htm <- convert 1 file ===========================================================
The entire website can be regenerated monthly (or as desired). First the the high volume text documentation (maintained with UNIX editor) is converted to HTML (as previously described). The HTML output files are then merged with the low volume hand-coded HTML files (such as index.htm). The result is then 'tar'd, compressed,& FTP'd to the web server. The relevant subdirectories are:
doc |
|
htmlcode |
|
dochtml |
|
See the 'uvhtmA' script to convert & merge all files required for website --->
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#!/bin/ksh # uvhtmA - Korn shell script from UVSI stored in: /home/uvadm/sf/util/ # uvhtmA - convert selected files from uvadm/doc to uvadm/dochtml # - by Owen Townsend, Sept 2002 # 0. login as uvadm &/or cd /home/uvadm # 1. erase all files from subdir dochtml # 2. copy the non-auto generated HTML files & .jpgs from subdir htmlcode # 3. convert selected UV doc text files to HTML # using uvcopy jobs uvhtm11,uvhtm21,uvhtm22,uvhtm23,uvhtm31 # see uvadm/doc/HTMLjobs.doc # 4. optionally add Keyword Index to selected files (such as MVSJCL.doc) # using optional script 'uvhtm2X' # rm -rf dochtml/* # remove all files & subdirs from outdir cp -r htmlcode/* dochtml # copy hand-coded,phots,ppt,etc to outdir cp htmlcode/uvhitctr2.pl dochtml/uvhitctr.txt # rename prgm for download cp binDOS/uvhd.exe dochtml # copy WindowsDOS version of uvhd chmod 777 dochtml/uvhd.exe # ensure execute permissions for all cp src/uvhd.c dochtml # copy uvhd source cp dat1/custmas1 dochtml # copy demo file for uvhd cp dat1/custmas1E dochtml # EBCDIC version cp dat1/sales2 dochtml/sales2.txt # copy demo file for uvhd cp dat1/sales3 dochtml/sales3.txt # copy demo file for uvhd cp src/testll1.c dochtml # test 32 bit integer max values cp src/testll2.c dochtml # test 64 bit integer max values # rm -rf tmp1 # remove tmp1 subdir (to clear all contents) mkdir tmp1 # create tmp1 (required to generate keyword index crossrefs) # uvcopy uvhtm21,fili1=doc/MVSJCL.doc,fild2=tmp1,fild3=tmp1,uop=q0i7x1 uvhtm2X mvsjcl libcnv uvcopy uvhtm21,fili1=doc/VSEJCL.doc,fild2=tmp1,fild3=tmp1,uop=q0i7x1 uvhtm2X vsejcl libcnv uvcopy uvhtm21,fili1=doc/MVSCOBOL.doc,fild2=tmp1,fild3=tmp1,uop=q0i7x1 uvhtm2X mvscobol libcnv uvcopy uvhtm21,fili1=doc/VSECOBOL.doc,fild2=tmp1,fild3=tmp1,uop=q0i7x1 uvhtm2X vsecobol libcnv uvcopy uvhtm21,fili1=doc/DATAcnv1.doc,fild2=tmp1,fild3=tmp1,uop=q0i7x1 uvhtm2X datacnv1 libcnv uvcopy uvhtm21,fili1=doc/MVSDATA.doc,fild2=tmp1,fild3=tmp1,uop=q0i7x1 uvhtm2X mvsdata libcnv uvcopy uvhtm21,fili1=doc/VSEDATA.doc,fild2=tmp1,fild3=tmp1,uop=q0i7x1 uvhtm2X vsedata libcnv uvcopy uvhtm21,fili1=doc/DATAcnv3.doc,fild2=tmp1,fild3=tmp1,uop=q0i7x1 uvhtm2X datacnv3 libcnv uvcopy uvhtm11,fili1=doc/install.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/WindowsSFU.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm21,fili1=doc/CygwinUwin.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/WindowsDOS.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/TestDemo.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/uvcopy1.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/uvcopy2.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm31,fili1=doc/uvcopy3.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/uvcopy4.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/uvcopy5.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/uvcopy6.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/uvcopy7.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/uvcp.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/uvhd.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/uvhdcob.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/uvintro.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/uvlist.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/versions.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 #Jun2005 - uvprices, added option s1 to generate .shtml (vs .htm) for hitctr #Jul2005 - remove option s1, Uniserve now allows SSIs on .htms OK uvcopy uvhtm11,fili1=doc/uvprices.doc,fild2=dochtml,fild3=tmp1,uop=q0i7s0 uvcopy uvhtm11,fili1=doc/uvqrpg.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/uvsort.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/uvtrain.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/SQLjobs.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/TABLEjobs.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm21,fili1=doc/HTMLjobs.doc,fild2=tmp1,fild3=tmp1,uop=q0i7x1 uvhtm2X htmljobs libjobs uvcopy uvhtm11,fili1=doc/SCANjobs.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/REPjobs.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/COBaids1.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/ADMjobs.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/XREFjobs.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/scripts1.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/uvprofil.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm11,fili1=doc/REFORMjobs.doc,fild2=dochtml,fild3=tmp1,uop=q0i7 uvcopy uvhtm21,fili1=doc/WORDjobs.doc,fild2=dochtml,fild3=tmp1,uop=q0i7
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# uvhtm2X - script to generate/append keyword index on UV HTML documents # - by Owen Townsend, Feb 2005 # - optional script, called by primary script 'uvhtmA' # - as a 2nd line following 'uvcopy uvhtm21' # # uvhtm2X xxx <-- arg1 must be basename of files to be processed # ============ # # This script 'uvhtm2X' is called from the primary script 'uvhtmA' # - optional, used for longer vital documents (such as MVSJCL.doc) # - optional uvhtm2X must follow the 'uvcopy uvhtm21' conversion # - which reads the UV text file & writes the HTML file + the cross-reference # - the HTML file is written to subdir 'tmp1/' (vs dochtml/ if no index req'd) # # ----------- example given for MVSJCL.doc ------------- # 1. doc/MVSJCL.doc - UV text documentation # 2. tmp1/mvsjcl.htm - UV doc converted to HTML # 3. tmp1/mvsjcl.xrf1 - keyword index from text ** headings # 4. tmp1/mvsjcl.xrf2 - keyword index permuted & sorted # 5. tmp1/mvsjcl.xrf3 - keyword index converted to HTML # 6. dochtml/mvsjcl.htm - HTML doc with keyword index inserted at end # if [[ -f tmp1/$1.htm && -f tmp1/$1.xrf1 ]]; then : else echo "usage: uvhtm2X basename (arg1 is basename of files in tmp1)" echo " ================= (tmp1/basename.htm, tmp1/basename.xrf1)" echo "sample: uvhtm2X mvsjcl" echo " ===============" exit 1 fi # uvcopy uvhtm22,fili1=tmp1/$1.xrf1,fild2=tmp1 # permute keywords & sort #============================================ # uvcopy uvhtm23,fili1=tmp1/$1.xrf2,fild2=tmp1 # convert keyword index to HTML #============================================ # uvcopy uvhtm24,fili1=tmp1/$1.htm,fili2=tmp1/$1.xrf3,filo3=dochtml/$1.htm #======================================================================== # - copy HTML doc, inserting keyword index near end of file # exit 0 #
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here is a uvcopy job that you can use on your HTML code to verify that all HREFs have corresponding NAMEs (targets for HREFs) & that NAMEs are not multiply defined. This job is intended to check HREF/NAME tags 'within' each document (vs HREF/NAMEs to external documents). This is because the internal tags were much higher in volume & much harder to verify manually. The external check could also be done automatically if anybody requested.
BOF: dochtml/vsejcl.htm ** NAMEs multiply defined ** 1stLine# NAMEs <A NAME="0A5"> <FONT color="darkblue">0A5<...: 27 2 <A NAME="7D1"> <FONT color="darkblue">7D1<...: 834 2
** HREFs with NAMEs Undefined or Multiply defined ** 1stLine# HREFs NAMEs <A HREF="#1K7"> 1K7</A>. Op. Instrns to Con...: 450 1 0 <A HREF="#2P1"> 2P1</A>. alldiff - powerf...: 6612 1 0 <A HREF="#2Q1"> 2Q1</A>. CrossRefs - See s...: 2815 2 0 <A HREF="#2S1"> 2S1</A>. vtocr1 - create...: 2873 1 0 <A HREF="#2T1"> 2T1</A>. scans/reps - gener...: 2878 1 0 <A HREF="#2U1"> 2U1</A>. alldiff - powerf...: 2884 1 0 <A HREF="#2V1"> 2V1</A>. listrec2 - uvcopy...: 2891 1 0 <A HREF="#4C5"> 4C5</A>' as step #5 & i...: 6243 1 0 <A HREF="#4D4"> 4D4</A>. Converting & C...: 5143 3 0 <A HREF="#8A0"> 8A0</A>. File definitions m...: 9159 1 0 <A HREF="#9B2"> 9B2</A>. 'uvlp??' scripts f...: 9691 1 0 EOF: dochtml/vsejcl.htm Totals: Lines=12104, NAMEs=497, NAMEerrs=2, HREFs=5175, HREFerrs=11,
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
uvcopy htmlchk1,fild1=dochtml,filo1=tmp/htmlchk1.rpt ====================================================
vi tmp/htmlchk1.rpt - view report ===================
uvlp12 tmp/htmljobs.chk - print report =======================
Note |
|
In case you are interested in the details, the coding for the htmlchk1 uvcopy job is listed on the following pages. This job illustrates the power & conciseness of the uvcopy language.
uvcopy is an 'interpretive assembler'. It has the power of an assembly language (based on the IBM 360 series), but it is interpretive (load & go). uvcopy is especially applicable for mainframe conversions since most IBM mainframe sites have personnel that are already familiar with the assembly language instructions formats.
In addition to the usual assembler instructions, there are many powerful extensions such as:
'rtb' - reads an entire file into a memory table
'rep' - search for and replace patterns with alternates
'sts' - search the memory table by patterns
'srt' - sort a memory table with options to drop & count duplicates
The 'htmlchk1' uvcopy job illustrates these instructions. 'uvcopy' just might be the most concise language on planet earth. Most other languages would require thousands of lines to perform the logic contained in the following two pages of code. Note that all uvcopy instructions are documented in uvcopy3.htm.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
See uvcopy code listed on the next 2 pages --->
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# htmlchk1 - uvcopy Parameter File from UVSI stored in: /home/uvadm/pf/util/ # htmlchk1 - check HTML code for missing 'NAME' targets for 'HREF's # opr='$jobname - check HTML code for missing NAMEs(targets) for HREFs' #opr='uop=q1e1n1 - option defaults' #opr=' e0 - report HREFs regardless of internal(leading #) or external' #opr=' e1 - report only internal HREFs (omit external HREFs)' #opr=' n0 - report HREFs for NAMEs(targets) defined or not' #opr=' n1 - report HREFs only if NAME undefined or multiply defined' #opr=' e1n1 - recommended options to report errors only' #uop=q1e1n1 # option defaults was=a40000000 # expand area 'a' for 200,000 lines of 200 bytes each was=h400000 # expand area 'h' for 4000 HREFs of 100 bytes each was=n400000 # expand area 'n' for 4000 NAMEs of 100 bytes each was=k8000 # expand area 'k' for page headings fild1=?indir,typ=DIR,rcs=80 fili1=xxxxxx,typ=LST,rcs=256 filo1=?tmp/htmlchk1.rpt,typ=LSTt,rcs=256 # # load tables of report headers & trailers lod=k0(100) BOF: $fili1 ** NAMEs multiply defined ** 1stLine# NAMEs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # at each BOF: following moved to above to expand $fili1 lod=k500(100) BOF: $fili1 ** NAMEs multiply defined ** 1stLine# NAMEs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # lod=k1000(100) ** HREFs with NAMEs Undefined or Multiply defined ** 1stLine# HREFs NAMEs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # lod=k2000(100) EOF: $fili1 Totals: Lines=$ca1, NAMEs=$ca2, NAMEerrs=$ca3, HREFs=$ca4, HREFerrs=$ca5,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # at each EOF: following moved to above to expand $ca_ ctrs with values lod=k2500(100) EOF: $fili1 Totals: Lines=$ca1, NAMEs=$ca2, NAMEerrs=$ca3, HREFs=$ca4, HREFerrs=$ca5,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
@run opn fild1 open input directory opn filo1 open output file # # begin outer loop to read directory for next filename # - process only files with suffix '.htm' man10 get fild1,f0 get next filename in directory skp> man90 (cc > at end directory) skp< man10 (cc < to bypass subdirs) scn f0(80),'.htm ' suffix .htm ? skp! man10 mvnx9 $ca1,0 clear ctrs for total NAMEs,HREFs,etc # # create input filename concatenate: dirname + '/' + filename clr g0(300),' ' mvu g100(80),$fild1,x'00' move dirname until ending null cat g100(80),'/' append '/' cata8 g100(80),f0(50) concat current filename (a8 null terms) mvc $fili1,g100 store input filename before open opn fili1 open input file rtb fili1,a0(200),a0(200) read entire file into memory table mvn $ca1,$ci1 save total lines for rpt ttl line # # write initial output report heading mvfv1 k0(100),k500(100) refresh hdngs & expand filename wtbe filo1,k0(100),k0(100) write report headers mvn $ra,0 init rgstr for input file table mvn $rh,0 init rgstr for HREF table mvn $rn,0 init rgstr for NAME table #
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# begin loop to search HTML file in memory table(area 'a') for 'NAME's # - store NAME's in a table in area 'n' man20 sts aa0(200),a0(200),'<A NAME="' skp! man30 # # NAME found - add to NAME table for subsequent sort & test for multiples # - format entries with key in 1st 30 blank filled & description in 31-60 # <A NAME="#xxxxx"> xxxxx description ...: line# count man24 clr b0(200),' ' clear work space mvc b0(50),ax0 store NAME in work area mvua7 b100(30),b0,'>' reformat with NAME key in 1st 30 mvc b130(30),by0 NAME description in 31-60 mvc b160(1),':' mark end 60 bytes of NAME cmc b157(3),' ' bytes 57-59 blank ? skp= 1 mvc b157(3),'...' indicate excess cleared div $ru,200 calc line# in table#1 from found dsplcmnt add $ru,1 +1 since rgstr zero relative edt b161(6),$ru,'zzzzz9' insert line# in NAME table entry mvc nn0(100),b100 store current NAME in table 'n' add $rn,100 up NAME table rgstr for next entry man28 add $ra,200 up input table rgstr to search for next NAME add $ca2,1 count NAMEs for totals skp man20 repeat loop until no more NAMEs found # # end search input table 'a' - all NAMEs stored in table 'n' # now sort NAME table, dropping duplicates (NAME key 1st 30 bytes) # srt optns d5 = (d1=drop dups) + (d4=insert cnt in last 5 bytes of entry) # n1 = end of table marked by all tildes entry (vs max count) # b7 = sort any blank entries high & eliminate dups man30 clr nn0(200),'~' mark end table with all tildes entry srtd5n1b7 n0(100),n0(30),2000 sort table of NAMEs (key 1st 30 bytes) # # loop thru NAME table reporting NAMES multiply defined mvn $rn,0 init rgstr to step thru NAME table man32 cmc nn0(1),'~' end of NAME table ? skp= man40 cmn nn95(5),2 multiple NAMEs ? skp< man36 mvf d0(80),nn0(66) move to output record format area edt d68(5),nn95(5),'zzzz9' edit NAME count put filo1,d0(80) add $ca3,1 count NAME errors man36 add $rn,100 up to next table entry skp man32 #
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# search input file in memory table (area 'a') for HREFs & store in area h # - omit external HREFs (no leading #) man40 mvn $ra,0 reset input table register # # begin loop to search for HREF's until no more found man42 sts aa0(200),a0(200),'<A HREF="' skp! man50 man43 cmc ax9(1),'#' internal HREF ? skp! man48 # # internal HREF found - add to HREF table for subsequent sort & NAME search # - format entries with key in 1st 30 blank filled & description in 31-60 # <A HREF="#xxxxx"> xxxxx description ...: line# matches man44 clr b0(200),' ' clear work space mvc b0(50),ax0 store HREF in work area mvua7 b100(30),b0,'>' reformat with HREF key in 1st 30 mvc b130(30),by0 HREF description in 31-60 mvc b160(1),':' mark end 60 bytes of HREF cmc b157(3),' ' bytes 57-59 blank ? skp= 1 mvc b157(3),'...' indicate excess cleared div $ru,200 calc line# in table#1 from found dsplcmnt add $ru,1 +1 since rgstr zero relative edt b161(6),$ru,'zzzzz9' insert line# in HREF table entry mvc hh0(100),b100 store current HREF in table in area 'h' add $rh,100 up HREF table rgstr for next entry man48 add $ra,200 up input table rgstr to search for next HREF add $ca4,1 count HREFs for totals skp man42 repeat loop until no more HREFs found # # end search input table - all HREFs stored in table in area 'h' # now sort HREF table, dropping duplicates (HREF key 1st 30 bytes) # srt optns d5 = (d1=drop dups) + (d4=insert cnt in last 5 bytes of entry) # n1 = end of table marked by all tildes entry (vs max count) # b7 = sort any blank entries high & eliminate dups man50 clr hh0(200),'~' mark end table with all tildes entry srtd5n1b7 h0(100),h0(30),2000 sort table of HREFs (key 1st 30 bytes) # # use loop to process each HREF in HTML file table (area 'h') # - searching for matches in NAMEs table (area 'n') # - writing report lines if no matching NAME found # - 1st print page headings for HREF errors man60 wtbe filo1,k1000(100),k1000(100) write HREF report headers mvn $rh,0 init rgstr to step thru HREF table man62 cmc hh0(2),'~~' end of HREF table ? skp= man80 mvc d0(80),hh0 store current tbl entry in work area mvn $ca7,hh95(5) save dup count for later edt mvc d100(30),d0 copy to 2nd area to create NAME search key rep d100(30),'HREF=','NAME=' chg HREF to NAME, remove # rep d100(30),'="#','="' chg HREF to NAME, remove # mvn $ca6,0 clear acum for match count mvn $rn,0 init rgstr 'a' for NAME search table #
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# begin loop to search NAME table for match to current HREF table entry man70 stsg4 nn0(200),n0(200),d100(30) search NAME tbl for current HREF skp! man74 add $ca6,1 count matches add $rn,200 up table rgstr (bypass current NAME match) skp man70 # # end NAME matches for current HREF # - report HREFs with no matching NAME or multiple matching NAMEs man74 cmn $ca6,1 HREF for NAME defined once ? skp= man78 # # insert counts folwng 1st 60 bytes of stored HREF & write to report man76 edt d68(5),$ca7,'zzzz9' count of HREFs (multiples to 1 NAME) edt d74(5),$ca6,'zzzz9' count of NAMEs for this HREF (err if 0) put filo1,d0(80) write HREF & count to report add $ca5,1 count HREF errors man78 add $rh,100 up table rgstr (bypass current HREF) skp man62 # # end HREF table & end current file # - write report total line with filename & total line count & matches man80 mvfv1 k2000(100),k2500(100) mvfv1 k2100(100),k2600(100) wtbe filo1,k2000(100),k2000(100) # # close current file & return to get next filename from indir man85 cls fili1 close current input file skp man10 # man90 cls all eoj #
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
'unhtml1' is a simple job to convert HTML code to plain text by removing the <--...--> sequences. It does not have much practical value since there are now man other tools to do this. It is listed here in case you are interested in another sample of the uvcopy instruction coding. Note that you can access the reference manual for the uvcopy instructions at uvcopy3.htm.
# unhtml1 - convert HTML document back to plain text # - ie, remove all <...> sequences - from '<' to following '>' # was=a2000b2000 fili1=?input,typ=LST,rcs=512 filo1=?output,typ=LSTt,rcs=512 @run opn all # begin loop to get/process/put until EOF loop get fili1,a0(512) get next record skp> eof (cc set > at EOF) mvc b0(512),a0 move input data to output area mvn $ra,0 clear rgstrs for a to b move mvn $rb,0 # begin loop to move until '<', then scan until '>', until no more '<' loop2 mvue3 bb0(512),aa0,'<' move until next '<' skp! put1 if no more <, goto output scne aa0(512),'>' scan until following '>' skp! err1 if nofind, goto errmsg add $ra,1 bypass the ending '>' skp loop2 put1 put filo1,b0(512) write to output file skp loop repeat loop until EOF # # EOF - close files & end job eof cls all eoj # # error - closing '>' not found err1 msg a0(78) show input record in error msgw 'ERR - unbalanced <...> closing > not found, may continue' skp put1 output partial rec & continue #
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
3A1. | Hit Counter Description & Example |
3B1. | Instructions to Download & Install |
3C1. | Hit Counter source code listing (perl) |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
"uvhitctr2.pl" is a CGI Perl program that you may download from UV Software. It displays counts month by month for this year & last year, for example:
ThisYear=000016 (J=0,F=0,M=0,A=0,M=0,J=0,J=16,A=0,S=0,O=0,N=0,D=0) LastYear=000078 (J=1,F=2,M=3,A=4,M=5,J=6,J=7,A=8,S=9,O=10,N=11,D=12)
<H2 align=center> Visitor Counters for This Year and Last Year </H2> <!--#exec cgi="/cgi-bin/uvhitctr2.pl" -->
At UV Software the documentation is maintained as text files so it can be edited with unix/linux editors such as 'vi'. The HTML is automatically generated from the text files (as explained in Part_2 of this HTMLjobs.doc).
The automatic conversion inserts the SSI call to uvhitctr2.pl at the end of every document.
The hit counter files are periodically FTP'd from the ISP website to UV Software's computer for analysis & charting. We can see which documents have the most hits & which months have the most hits.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
1. | Click https://www.uvsoftware.ca/uvhitctr.txt to display the hit counter |
program. |
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The source code is listed below, but you should download the perl program from the link provided in '3B1' above since this listing may be out of date whereas the link will always give you the latest version.
#!/usr/bin/perl # uvhitctr2.pl - counter program for HTML pages # - by Owen Townsend, July 2005 # - shows hitctrs by month for thisyr & lastyr # - internet server must allow SSI's (Server Side Includes) in .htms # - hitctr filename made from docname_YYYY & stored in subdir cgi-bin/ctrs # - eg: ctr file in 2005 for index.htm would be cgi-bin/ctrs/index.htm_2005 # - sample coding to call the program & response created as follows: # # <H2 align=center> Visitor Counters for ThisYear & LastYear </H2> # <!--#exec cgi="/cgi-bin/uvhitctr2.pl" --> # # ----- generates following ----- # # ** Visitor Counters for ThisYear & LastYear ** # # ThisYear=000016 (J=0,F=0,M=0,A=0,M=0,J=0,J=16,A=0,S=0,O=0,N=0,D=0) # LastYear=000078 (J=1,F=2,M=3,A=4,M=5,J=6,J=7,A=8,S=9,O=10,N=11,D=12) # # get year,month,day,date for use as part of ctr filenames @dates = getdate(); $year1 = $dates[0]; $month = $dates[1]; $month0 = ($month -1); $year2 = ($year1 -1); # # create ctr filenames for thisyear & lastyear # - use DOCUMENT_URI as ctr filename (within subdir ctrs) # - extract right hand segment based on '/' delimiters # - append current year & lastyear $docurl = $ENV{"DOCUMENT_URI"}; $docuri = rindex($docurl,"/"); $docfile = substr($docurl,$docuri+1,30); $ctr1name = sprintf("%s_%s",$docfile,$year1); $ctr2name = sprintf("%s_%s",$docfile,$year2); if ($ctr1name eq "") { $ctr1name = "ctrname1ERR"; } if ($ctr2name eq "") { $ctr2name = "ctrname2ERR"; } $ctr1file = "ctrs/$ctr1name"; $ctr2file = "ctrs/$ctr2name"; # # write HTTP hdr block info required before any print output # - either the counter value or error messages print "content-type: text/html\n\n"; #
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# open thisyear ctr1file & read current values # if we cant open (1st time called) - write initial value of zeros unless (open(THISYR,"$ctr1file")) # open ctr1file for input { open(THISYR,">$ctr1file"); # if failure - open for output print(THISYR "0|0|0|0|0|0|0|0|0|0|0|0|\n"); close(THISYR); # - close open(THISYR,"$ctr1file"); # - reopen for reading print "$ctr1file open input err, open output,write zeros,close,reopen
"; } # $ctr1s = <THISYR>; # read thisyr ctrvalues @ctr1a = split(/\|/,$ctr1s); # split string via '|' seps into array $ctr1a[$month0]++; # increment this month's ctr # # sum thisyr 12 month ctr to get total for current year $thisyr = 0; for ($ii=0; $ii < 12; $ii++) { $thisyr += $ctr1a[$ii]; } # $ctr1s = join("\|",@ctr1a,""); # recreate array string for write # # reopen file for writing & write new value unless (open(THISYR,">$ctr1file")) { die "cannot open thisyr ctrfile $ctr1file to write new ctrvalues"; } flock(THISYR,2); # lock file before write print(THISYR $ctr1s); # write new value flock(THISYR,8); # unlock file close(THISYR); # close ctr1file # # format thisyr output string with month ID's $ctr1sp = sprintf( "ThisYear=%06d (J=%d,F=%d,M=%d,A=%d,M=%d,J=%d,J=%d,A=%d,S=%d,O=%d,N=%d,D=%d)" ,$thisyr,$ctr1a[0],$ctr1a[1],$ctr1a[2],$ctr1a[3],$ctr1a[4],$ctr1a[5],$ctr1a[6] ,$ctr1a[7],$ctr1a[8],$ctr1a[9],$ctr1a[10],$ctr1a[11],$ctr1a[12]); #
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# open lastyear ctr2file & read lastyear values # if we cant open - just store zero values unless (open(LASTYR,"$ctr2file")) # open ctr1file for input { $ctr2s = "0|0|0|0|0|0|0|0|0|0|0|0|\n"; } else { $ctr2s = <LASTYR>; # read lastyr ctrvalues } # @ctr2a = split(/\|/,$ctr2s); # split lastyr string via '|' seps into array # # sum lastyr 12 month ctr to get total for last year $lastyr = 0; for ($ii=0; $ii < 12; $ii++) { $lastyr += $ctr2a[$ii]; } # # format thisyr output string with month ID's $ctr2sp = sprintf( "LastYear=%06d (J=%d,F=%d,M=%d,A=%d,M=%d,J=%d,J=%d,A=%d,S=%d,O=%d,N=%d,D=%d)" ,$lastyr,$ctr2a[0],$ctr2a[1],$ctr2a[2],$ctr2a[3],$ctr2a[4],$ctr2a[5],$ctr2a[6] ,$ctr2a[7],$ctr2a[8],$ctr2a[9],$ctr2a[10],$ctr2a[11],$ctr2a[12]); # print "$ctr1sp
\n$ctr2sp\n"; # output counter values # exit(0); # exit program # #------------------------------ subroutines ---------------------------- # getdate - get current date formatted as YYYY-MM-DD # sub getdate { local ($ltSS,$ltMM,$ltHH,$ltdd,$ltmm,$ltyy,$ltwd,$ltyd,$ltis); local ($year,$month,$day,$today); ($ltSS,$ltMM,$ltHH,$ltdd,$ltmm,$ltyy,$ltwd,$ltyd,$ltis) = localtime; $year = $ltyy + 1900; $month = $ltmm + 1; $day = $ltdd; $date = sprintf("%04s-%02s-%02s",$year,$month,$day); return($year,$month,$day,$date); } #---------------------------- end of uvhitctr2.pl -------------------------
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
HTMLjobs.doc is intended to document unique ways that Vancouver Utilities can convert text to HTML code, and not for general purpose HTML tips & techniques.
I do not pretend to be an HTML expert & will not have a lot of general purpose HTML tips. I added Part 4 as a place to document the few worthwhile tips that I do encounter.
4A1. | Embedding Google Maps on your web-site |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
This is a relatively new feature that may be of interest to you. In August 2007, Google provided 'HTML code Links' that allow you to embed Google maps into your web-site. Here is how to do it:
For a sample 'Google map' embedded on my web site, please see:
https://www.uvsoftware.ca/photos.htm <-- sample Google map on uvsoftware.ca ===================================== - map of Vancouver, Canada
https://www.uvsoftware.ca/htmljobs.htm#4A1 <-- link to this documentation =========================================== (how to embed map link in HTML)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Owen lives near "Lynn Canyon Park" in North Vancouver, BC Canada
<iframe width="680" height="540" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.ca/maps?hl=en&ie=UTF8& ll=49.296248,-123.058891&spn=0.149563,0.263672&z=12& output=embed&s=AARTsJpnOA3ioEtcI9rx_v7gyZqlolGTYw"> </iframe><br /> <small><a href="https://maps.google.ca/maps?hl=en&ie=UTF8& ll=49.296248,-123.058891&spn=0.149563,0.263672&z=12& source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small> </p>
<iframe width="425" height="350" ... <-- original <iframe width="680" height="540" ... <-- my changes
ll=49.296248,-123.058891&... <-- original ll=49.306248,-123.048891&... <-- modified
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page