BBEdit HTML Tools ©1995 Lindsay Davies - (Last updated: 1/6/95)

BBEdit Tools 1.3 Documentation

  • Overview
  • Installation
  • Tools
  • Template Files
  • Creating custom markup routines
  • Other Useful Stuff
  • Mirroring a Un*x Web
  • Tools Used
  • Updates/Feedback/Bugs

  • Overview

    This set of tools assists you in the creation and editing of HTML documents. The tools are written as extensions for BBEdit and BBEdit Lite. As well as the standard support for HTML markup, the tools enable you to check your documents for errors, use template files and create custom markup routines.

    Please note that the documentation that comes with these tools does not attempt to explain how to compose HTML documents, and therefore will presume some existing knowledge of HTML. (see CERN's introductory text for more information about HTML)


    Installation

    Requirements: System 7, BBEdit, a Web Browser (for graphical previews).
    1. Drag the files from the 'for BBEdit Extensions Folder', and place them (you guessed it) in BBEdit's 'Extensions' folder, which should be in the same folder as your BBEdit application.
    2. You may at this stage wish to increase the amount of memory BBEdit uses. The default is 640K, but it doesn't do any harm to up this by 50-100K or so. This will give some of the tools such a 'Preview' more room to work in.
    3. In versions of BBEdit and BBEdit Lite prior to 3.1.1, you will find the tools installed in the 'Extensions' menu. In BBEdit 3.1.1 (or later) the tools will appear in the 'Internet' menu.
    4. You now need to set your preferences for the tools. Go to BBEdit's 'Extensions' menu, select 'Utilities'. From the dialog, select 'Preferences'. You should then set your preferred Web client etc.
    5. Most of the functions have command-key equivalents. Just hold down the command (puppy-paw) key and each item will display the appropriate key to press.
    6. Explore the tools and have fun! Balloon help is available for almost everything, so have a look at that if you have any problems. Either click on the balloon help icon, or use Command-? to turn it on or off.

    Tools

    Anchor
    Use this tool to create the start or end points of an anchor. A list is kept of the 10 most recent anchors used, and these are available from a popup menu. You can also select an item from your chosen hotlist.

    If you wish to make a local link to a file, you can select 'File...'. The form of the resulting URL depends upon the addressing method selected.

    Tip: Holding down the option key when using the popup menu will give you a list of the available named anchors in your current document. This is useful when making links to named anchors within a document.

    Document
    The document tool provides access to the main building blocks of an HTML document - the HTML, HEAD and BODY tags. If you have set up a template, this is the place to use it.

    Tip: If you regularly use a template, you can make the 'Insert Template' option the default by Option-clicking on it (you can make 'OK' the default again by Option-clicking it). Using the Return or Enter keys will then be equivalent to clicking on the default button.

    Form Elements
    Use this tool to create all the markup you need for a form.

    Heading
    Use this tool to mark your current selection as a heading. There are six levels of heading available in HTML.

    Image
    Using this tool you can insert markup for inline or externalimages (those that will be viewed via a 'helper' application). As with the anchor tool, the 10 most recently used images are available from the popup menu. Links to local image files can also be selected.

    Line Breaks
    This tool allows you to insert line, paragraph and rule breaks into your document.

    Tip: If you have made a selection, then choosing either line or paragraph breaks will mark-up your selection appropriately. For example, if you have selected 3 paragraphs, then choosing Line Breaks/Paragraph will insert 3 <P> tags in the appropriate places.

    Lists
    All lists can be marked-up using this tool. There are options to ignore white space and indent.

    Preview
    Preview allows you to choose between a textual or graphical preview of your current document. For the graphical preview to work, you will need to have either MacWeb or Mosaic running. The textual preview is a simple attemp to give you a Lynx-like view of your document.

    Tip:You can set your preferred default preview by Option-clicking on either the 'Text' or 'Graphical' preview buttons.

    Note: There are some cases where invalid markup will cause the text preview routine to loop around trying to make sense of the tags. If you notice the cursor stop moving for a long period of time then use Command-. to break out of the loop.

    Note: Not all browsers support the correct interaction with HTML editors.

    Netscape
    has the best interaction.
    Mosaic
    insists on opening a new window every time you preview a document.
    MacWeb
    will open the document first time, but will not subsequently reload it - you will need to explicitly tell it to reload your document.

    Style
    Logical and physical styles can be added to the current selection using this tool. Note that HTML level 1 and 2 styles are supported. If you want HTML level 2 styles available, you must check the 'HTML-2' box.

    Translate
    If you have an existing text file, you can run the Translate tool over it to ensure that all the characters are in a suitable form for subsequent marking up.

    Conversely, this tool can be used to translate an HTML document back into a text document. (You may prefer to use the 'Preview->Text' option, as this attempts to format the HTML document as a text file.)

    User's Markup
    While most of the markup can be done using the other tools, there are occasions when marking up text can be tedious and repetetive. This tool will assist you in marking up your document by providing 10 'custom markup routines' that you can use on your documents. See 'Creating custom markup routines' for more information.

    Utilities
    A collection of useful utilities to aid you in your document creation.
    Insert Hotlist
    This utility will insert the currently selected hotlist into your document as a list of HTML anchors.
    Link Summary
    To append a list of all links within your document, use this tool.
    Open URL
    If the insertion point is within a URL, then this tool will select the URL, and get the currently running Web client to open it.
    Remove Tags
    If you have not selected any text, then the tags either side of the insertion point will be found and removed. If a selection is made, then all tags within the selection will be removed.
    Comment
    Your selected text will be made into a comment. Although comments are slightly frowned upon in HTML documents, they can be very useful. One drawback is that it is not possible (or legal) to comment out text containing valid HTML tags. This tool will convert all angle brackets into guillemots (eg '>' becomes '>>'). To uncomment your previously commented text, select it and hold the Option key down when clicking on the 'Comment' button.
    Check Markup
    will check your HTML document for errors. This uses the HTML Level 2 DTD. Don't be surprised if you are told that certain tags are constructions are illegal, that's what the DTD says!
    Preferences
    You set your template file, preferred Web browser and other things here.

    Template Files

    You can create a document that will serve as a template for further HTML documents. You can specify which file you want to use as your template in the Preferences. To make using templates more useful, there are a number of placeholders that you can use. These will allow the insertion of relevant data into any document created from your template file. A template and supporting files is included with this archive. Have a look at them to get some idea of how they work.

    Creating custom markup routines

    See the accompanying document 'UserStylesInfo.txt', in the Documentation folder that came with the tools archive. Examples:
    Make all Glossary Terms (<DT>s) in your document STRONG.
    !FA"<DT>"!@E!FN"\r"!IS"<STRONG>"!IE"</STRONG>"

    1. !FA"<DT>" - Find all occurences of "<DT>"
    2. !@E - Move insertion point to end of selection
    3. !FS"\r" - Find and select to next return character
    4. !IS"<STRONG>" - Insert at the start of the selection "<STRONG>"
    5. !IE"</STRONG>" - Insert at the end of the selection "</STRONG>"

    Other Useful Stuff

    Setting Defaults
    Some tools allow you to change the default button (outlined in black - you can use the Return or Enter keys to select the default item). The preview tool allows you to set either the Text or Graphical buttons as the default simply by clicking on them while holding down the option key. The same operation can be done with the Document tool, with the possible defaults being Insert Template and OK.
    Netscape Enhanced Markup Support?
    This set of tools does not currently support Netscape's enhanced markup. While I am currently working on version 2 of the tools, which will be aimed at HTML-3, there may be some Netscape-specific markup that I might not support. The main reason for this is that Netscape haven't got a DTD for their markup, and so I cannot add in this markup to the HTML checker. I don't like the idea of some tools generating markup that the syntax checker can't check.
    Inconsistent Command keys?
    A note just in case anyone might notice certain command-keys change from machine to machine. This is because there is a slight 'problem' in BBEdit and BBEdit Lite version 3.x where pressing command-O in a dialog box causes a crash on machines prior to the MacIIci (ie 32 bit dirty ROMs). So on those early machines, alternative command-key combinations are patched in. Just thought I'd mention it.
    Netscape Bookmarks
    If you have MacWeb or Mosaic Hotlists, you can easily transfer this information to your Netscape Bookmark file by using 'Insert Hotlist' from the 'Utilities' tool (Tip: Holding the option key down allows you to select any hotlist file). You can then simply import this file in Netscape. Tip2: You can actually use any text file as a hotlist, as long as it contains valid anchors. This means that you can quickly import all the anchors from an HTML file by Option-clicking on the 'Import Hotlist' button (which actually changes to 'Select Hotlist' when you hold the option key down).
    Checking Your Documents
    You may well find it useful to use the HTML Checker to ensure that your document does not contain any errors. One thing to be aware of is that errors early on in the document can sometime propagate further errors, so always fix the early ones first. Another thing to bear in mind is that the as a general rule, Web Browsers should be very tolerant of illegal markup, whereas HTML Editors need to be as strict as possible. This means that although your document may appear to work fine with Web Browsers, it may well still contain 'errors' as defined by the HTML specification.
    Netscape and BASE HREFs
    If you are using Netscape to preview your documents, then be aware that Netscape will try to use the BASE HREF to complete any relative/partial URLs you may have in your document. This means that every time you preview your document, it will try fetch the components from the URL sepecified in the BASE, rather than locally - which is a pain if you only have dial-up access to the internet. My suggestion is that you _do_ have a BASE HREF defined, but that you keep it commented out while developing the document offline. The tools are designed to still recognise the BASE HREF even when commented, but Netscape will ignore it.

    Mirroring a Un*x Web

    (just notes at the moment - I'll expand on them when I have time)
    Case is significant, so ensure that all your URLs match the case of you Un*x file names.

    Set your server address in prefs.

    Set your (local) root folder (that is the mirror to you Un*x structure) in the prefs.

    Set any path prefix that you need to access the files when they are transferred. eg my Unix address is 'http://www.york.ac.uk/', but my web area is in 'http://www.york.ac.uk/~ld11/'. I can mount this area on my desktop Mac, so my 'local' root is in effect the folder that I can mount - I don't have access to the whole hierarchy on the Un*x machine. Therefore I need to enter '~ld11/' as my root prefix so that all files I select will work correctly.


    Tools Used:

    Mac IIx, Synchronize, CodeWarrior, Think Reference, Resorcerer, Aladdin's DropStuff/Stuffit Expander, BBEdit 3.1, Voodoo Lite, MacWeb, Mosaic, Netscape Navigator.

    Updates, Feedback and Bug Reports

    If you have any comments about the tools, then feel free to contact me. Also, if you wish to receive updates of these tools, then you can email me, and I will add you to the update list. (You'll probably get a quicker repsonse if put 'BBEdit Tools' in the subject line of your message.)

    If you come across any bugs, errors, missing features etc, then please do not hesitate to get in touch, and I will do my best to sort it out for you. If you are reporting an error, please enclose reasonably precise information about what the problem is, when it occurs, with what version of BBEdit etc.


    Thanks!!!

    And of course finally, I'd like to thank everyone who has helped in the development of these tools. There are so many people that it is difficult to list them all, but you know who you are!
    Lindsay Davies -- Lindsay.Davies@sheffield.ac.uk