HTML and DocBook output

If you need to produce documentation with SQL source code, pgEdit has several commands you might find useful. The Copy for HTML command copies the selected source text to the clipboard in HTML format. The HTML consists of a PRE element with SPAN elements to describe the syntax coloring. The CSS From Syntax Colors command can be used to copy a cascading style sheet (CSS) fragment to the clipboard with your current color settings. This allows you to modify the syntax coloring used in any HTML page by having them all refer to the same CSS file.

The Copy for DocBook command performs a similar function in creating a DocBook ProgramListing element with syntax coloring information on the clipboard. The XSL From Syntax Colors command puts the XSL style sheet information for the current color settings on the clipboard. This information, along with the CSS style information, allows DocBook to be used to produce syntax colored program listings for both HTML and PDF output.

Here is a short trigger function to illustrate the HTML output:

-- trigger to fold all names to lowercase, ensure both columns are not null
create or replace function tg_address_biu() returns trigger as $$
    if new.domain_name is null and new.ip is null then
        raise exception 'Both the domain_name and ip columns cannot be null.';
    end if;
    if new.domain_name is not null then
        new.domain_name = lower(new.domain_name);
    end if;
    return new;
$$ language plpgsql;