home *** CD-ROM | disk | FTP | other *** search
- .-----------.
- |== == == / | .--------------.
- |== ==== / /| ¦ !Text2Html ¦ v 0.17
- |=== == / / |-----. '--------------'
- |== == /_/ =| |
- |==== // == | V Converts a text file into
- '-----------/-----------. an HTML page; changes all
- | | ===== | occurrences of "&<> etc
- | |_ ---------| to the appropriate entity,
- '----->|*¯-. ======| similarly for top-bit-set
- |•*·*\ =====| characters.
- |*•*·*| ====|
- '-----------' Please read Instructions!
- ⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩
- What it’s for:
- =============
- This is not supposed to be a WYSIWIG web-authoring package, because
- it only deals with the textual /content/ of a page, /not/ the fancy
- markup and presentation.
- Its main use will be when you have drafted a significant amount of text,
- possibly using all the keyboard and Alt accented characters, and wish to
- put that up on your site as a Web Page: there will be a number of
- characters that are illegal (eg top-bit-set, and especially the ASCII
- codes from 127 to 159), and MUST be changed into something acceptable.
- After you have done that, you only have to add markup for headings etc
- (which this program can’t guess at on your behalf; but which you can
- easily do in any text editor).
-
- To Run the program:
- ==================
- double-click on the !Text2Html icon.
-
- To process a text file:
- ======================
- drag a text-file (max size 64K ¹) on to the icon-bar icon.
-
- Select the options:
- ------------------
- • In the writable icon labelled “<TITLE>” you should type in the title
- that you want the page to have (that appears in the title-bar of a
- browser’s window).
-
- • From the panel labelled “•Bullet”, select how you want ASCII 143 to be
- represented:
- • as a centre-dot thus ·
- • as an asterisk, thus *
- • as a bold lower-case o
- • or as a “List Item”; which PLEASE NOTE will require you to add by hand
- the necessary <UL> and </UL> around them afterwards ².
-
- • In the bottom-right writable icon, edit the suggested “leaf name” for
- the resulting file, if it is not to your liking ³.
-
- Create the HTML file:
- --------------------
- Drag the HTML-file icon into the directory you want it to go in.
- The conversion now actually takes place, and you get a progress window
- while it is happening.
-
- What you finish up with:
- =======================
- All reserved characters and top-bit-set characters in the original text
- are replaced by entities (such as < for < and © for ©).
-
- A spirited guess is made as to where you meant deliberate line-breaks
- or new paragraphs, and <BR> and <P> tags respectively are inserted
- (actually, it’s a bit over-zealous with <BR> tags, so you may want or
- need to take a few out afterwards).
-
- It will “top-and-tail” the output document with some <HTML>, <HEAD>,
- <TITLE> & <BODY> tags, and </BODY></HTML> tags:
-
- this means the output file should be a valid HTML page/document
- (although you will still need to add “presentational” markup yourself).
-
- Errors and warnings:
- ===================
- You will get an error if the incoming file is larger than 64K ¹.
-
- You will get an error if the incoming file is not a text-file (&FFF).
-
- You will get a warning if you try to drag in another text-file
- before you’ve processed the last one.
-
- You will get a warning if you try to save over an already-existing file.
-
-
-
- Notes:
- =====
- ¹ If you need to process text files longer than 64K, you will have to
- hack the program by loading !RunImage into an editor, searching for
- the the occurrence of “maxSz%=64*1024” (probably around line 54),
- and editing the “64” to the number of K you need.
- You MUST ALSO edit the !Run file to increase the WimpSlot by the
- same amount as you’ve increased maxSz%.
-
- ² Yes I know the program could have automatically inserted a <UL>
- immediately before the first <LI>; but there’s no way it can be sure
- how to recognise the “last” <LI> item to be followed by </UL>: a list
- item /could/ be several sentences or even paragraphs, and/or you might
- have intended to finish one list and immediately start another!
- So tough, you have to tidy that up yourself ;-)
-
- ³ One little “feature” you might spot: The suggested save leaf-name is
- derived from the first six characters of the incoming leaf-name, plus the
- extension “/html”; the mental-arithmeticians and mutants among you may
- spot that this adds up to ELEVEN characters total! If the original leaf
- name was only five characters or less, there will be no problem.
- If the incoming name was six characters or more, the outgoing name will
- be one character too long for a 10-character-max filing system:
- either the name will get truncated, so it finishes up with the shorter
- extension “/htm”, or else you will have to edit out one of the characters.
- If however you save into something like a !Longfiles or !X-files image-
- filing system (which allows longer filenames), the eleven characters will
- be preserved (or you can even lengthen the name up to fifteen characters,
- allowing you to create names such as “DosEight/htm” or “riscos_ten/html”).
-
- More notes for hackers:
- ----------------------
- The text-file “GlyphNames” within the application is used to look up the
- entity names, and/or what to substitute for illegal characters.
- You can:
- • Leave it well alone, and keep your sticky fingers off it;
- • Edit it, eg change entry 144 to ‘‘’ to crash-test a browser;
- • Lose your temper and delete it: the program will still (sort of) work!
-
-
- AFAIK this program should be compatible on anything from RiscOS 2.0 up to
- StrongArm RO3.7 (for all I know, it might even work under Arthur ;-)
-
- John Alldred
- 18 December 1997
- john@protovale.co.uk
- http://www.protovale.co.uk/john/
- http://www.argonet.co.uk/users/protovale/john.html
-