Creating New HTML Files

"-->

The program has extensive setup options that let you pick default values for any new HTML files you create or open . Before you begin, see HTML Document Options on page 434 and Absolute and Relative Paths, and Fixing Broken Links on page 138.

Note

If you want your documents to be read by a browser other than Web, be sure to test your HTML documents in that browser before you distribute them. Web text formatting, especially multiple levels of bulleting, doesn't always translate well. In addition, if you edit the document with another HTML editor, the odds increase that the formatting you originally applied will be changed when you view the file again, in Web or another browser.


Creating a New Blank HTML Document

Choose File > New > HTML Document.

This creates a blank document with the usual styles, including Heading 1 through Heading 6, List Contents, and Horizontal Line.

It also has, by default, a header containing the full path to the file, date, time, and document title. To change either, see Using Headers and Footers on page 467.

Creating a New HTML Document Based on a Template

You can access templates through File > AutoPilot > Web page.

Note

Templates from www.ooextras.org are included in the CD that comes with this book. You can also get old StarOffice 5.2 templates at http://wwws.sun.com/software/star/staroffice/5.2/templates/. All template links as well as templates created by the authors are available at: http://www.getopenoffice.org/templates.html


To create templates, see Creating and Modifying Styles and Templates on page 451.

Using AutoPilot
  1. Choose File > AutoPilot > Web Page.

  2. In the AutoPilot Web Page window (Figure 15-2), select the template you want in the left-hand column. It will be displayed behind the window in the work area.

    Figure 15-2. Selecting a template on which to base a Web page

    graphics/15fig02.jpg

  3. Select the style you want in the right-hand column.

  4. Click Create.

Checking What Template Your Document Is Based On

If your document is acting weird and you want to make sure you created it based on the right template, choose File > Properties and click the General tab. The template used by the document is displayed at the bottom of the window.

Changing Defaults for New Documents

You can change the default font (not the font size) for Standard, Heading, List, Caption, and Index styles. Choose Tools > Options > Text Document > Default Font. Select the defaults you want. Don't select the Current heading only option if you want this to apply to all subsequent documents.

To change the attributes of styles that appear in each new document you create, or to add styles, see Styles on page 453.

Extensive file and template information is also included in Writer, since Writer and Web have very similar functions. See Creating and Modifying Styles and Templates on page 451, and Styles on page 453.

Changing Existing Documents to HTML

You can get virtually anything you create or import into HTML format.

Exporting Presentations and Drawings

You can easily convert Impress and Draw documents to HTML. See Creating an HTML Version of Your Presentation on page 733 for more information.

Saving Files in HTML Format

You also can choose File > Save As to save in an HTML format. Calc, for instance, has the HTML (Calc) format.

Publishing HTML Files With Embedded Documents

You can insert a spreadsheet, Writer document, or other file in an HTML document, and post the HTML document on the Web.

Opening any Text File in HTML

Select the file in Beamer and choose Open With, then select HTML or HTML (Writer).

The program will give you an error message sometimes, though not consistently, when you do this. If it happens, just sigh and open the file, then use Save As to pick the format you want.

Saving a Writer File in HTML

You can easily convert Writer files, or any file you can open in Writer, to HTML. (If you need to get a document into Writer, the best way is to save it in .RTF format, then choose File > Open in OpenOffice.org.)

  1. Open the Writer document.

  2. Choose File > Save As.

  3. Select the HTML (Writer) format and enter a new name if you want. Click Save.

Note

The document icon in the task bar will change to the HTML icon, but you won't see the HTML-specific toolbars and menu commands until you close the file and reopen it. It doesn't work to choose File and then select the name of the file, to reopen ityou have to close it, then choose File > Open to open it as a true HTML file.


Opening an HTML Document

Before you start opening files, it's a good idea to set options for opening Web pages created using other browsers. See HTML Document Options on page 434.

Choose File > Open to open another HTML file.

What OpenOffice.org HTML Is Like

To see the source, choose View > Source in a Web document.

When you Save As HTML in Writer, you only get the Web (Writer) option, which is not in fact actual HTML. Not even if you make sure you add an HTML file extension. One main tipoff is that the View > Source option is not available. They often look the same way when viewed in a browser, but not always.

The HTML is created, in Writer and again even if you paste the same content into a new HTML page, very lazily with lots of <style> tags. If you like your HTML clean, don't rely on the program. However, it's a decent place to start, especially if you have a lot of tables to make. The tables come out relatively well.

Figure 15-3 through Figure 15-5 show the HTML output for a sample file:

  • Figure 15-3 shows the document in Netscape.

  • Figure 15-4 shows the HTML for a new HTML page in the program with the same content typed in, not pasted (this is normal HTML the way it was intended).

    Figure 15-4 The HTML for a new HTML page in OpenOffice.org with the same content typed in, not pasted
     <P>Go to the following URLs for great OpenOffice.org and Java information and training:</P> <P><A HREF="http://www.softcorejava.com/">http://www.softcorejava.com</A><P> <P><A HREF="http://www.lastturtle.com/">http://www.lastturtle.com</A></P> <P><A HREF="http://www.javaranch.com/">http://www.javaranch.com</A></P> <P><BR><BR> </P> </BODY> </HTML> 
  • Figure 15-5 shows the HTML source of a Writer page saved as Web (Writer), viewed in Netscape, and the same content copied and pasted into a new Web page in Writer:

    Figure 15-5 The HTML source of a Writer page saved as Web (Writer), viewed in Netscape, and the same content copied and pasted into a new Web page in Writer
    [View full width]
     <P STYLE="margin-bottom: 0cm"><BR></P> <P STYLE="margin-right: 5.52cm; margin-bottom: 0cm">Go to the following URLs for great graphics/ccc.gif OpenOffice.org and Java information and training:</P> <P STYLE="margin-right: 5.52cm; margin-bottom: 0cm"><BR> </P> <P STYLE="margin-right: 5.52cm; margin-bottom: 0cm"><A HREF="http://www.softcorejava.com/ graphics/ccc.gif ">http://www.softcorejava.com</A></P> <P STYLE="margin-right: 5.52cm; margin-bottom: 0cm"><A HREF="http://www.lastturtle.com/ graphics/ccc.gif ">http://www.lastturtle.com</A></P> <P STYLE="margin-right: 5.52cm; margin-bottom: 0cm"><A HREF="http://www.javaranch.com/ graphics/ccc.gif ">http://www.javaranch.com</A></P> <P STYLE="margin-right: 5.52cm; margin-bottom: 0cm"><BR> </P> 
Figure 15-3. Document viewed in Netscape

graphics/15fig03.jpg

Exporting the HTML Source Code

Choose View > HTML Source, then choose File > Export Source.

The HTML you get is dependent on HTML compatibility setup options; see Setting Up How the Program Reads and Exports HTML Files on page 142.



OpenOffice. org 1.0 Resource Kit
OpenOffice.Org 1.0 Resource Kit
ISBN: 0131407457
EAN: 2147483647
Year: 2005
Pages: 407

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net