-------------------------------------------------------------------------------
--
-- This file is part of AdaBrowse.
--
-- Copyright (c) 2002 by Thomas Wolf.
--
-- AdaBrowse is free software; you can redistribute it and/or modify it
-- under the terms of the GNU General Public License as published by the
-- Free Software Foundation; either version 2, or (at your option) any
-- later version. AdaBrowse is distributed in the hope that it will be
-- useful, but without any warranty; without even the implied
-- warranty of merchantability or fitness for a particular purpose.
-- See the GNU General Public License for more details. You should have
-- received a copy of the GNU General Public License with this distribution,
-- see file "GPL.txt". If not, write to the Free
-- Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-- USA.
--
--
-- -
-- Author:
-
-- Thomas Wolf (TW)
-- twolf@acm.org
--
-- -
-- Purpose:
-
-- HTML output helper routines.
--
--
-------------------------------------------------------------------------------
pragma License (GPL);
with Ada.Text_IO;
package AD.HTML is
pragma Elaborate_Body;
procedure Header
(File : in Ada.Text_IO.File_Type;
Title : in String);
procedure Footer
(File : in Ada.Text_IO.File_Type);
procedure Subtitle
(File : in Ada.Text_IO.File_Type;
Text : in String);
function HTMLize
(S : in String;
Keep_Entities : in Boolean := True)
return String;
function Find_Tag_End
(S : in String;
Is_End : in Boolean := False)
return Natural;
-- Assuming that S starts with a legal HTML tag, finds the closing ">" of
-- the tag. Do not use for comments! If no closing ">" can be found,
-- returns zero.
function Attributes
(Source : in String)
return String;
-- Strips leading and trailing white space and replaces all other white
-- space by ' '.
function Character_Set
return String;
----------------------------------------------------------------------------
type HTML_Tag_Kind is (Before, After);
function Get_Keyword
(What : in HTML_Tag_Kind)
return String;
function Get_Attribute
(What : in HTML_Tag_Kind)
return String;
function Get_Definition
(What : in HTML_Tag_Kind)
return String;
function Get_Comment
(What : in HTML_Tag_Kind)
return String;
function Get_Literal
(What : in HTML_Tag_Kind)
return String;
----------------------------------------------------------------------------
procedure Set_Char_Set
(Id : in String);
procedure Set_Style_Sheet
(URL : in String);
procedure Set_Body
(S : in String);
procedure Set_Title
(What : in HTML_Tag_Kind;
S : in String);
procedure Set_Subtitle
(What : in HTML_Tag_Kind;
S : in String);
procedure Set_Keyword
(What : in HTML_Tag_Kind;
S : in String);
procedure Set_Attribute
(What : in HTML_Tag_Kind;
S : in String);
procedure Set_Definition
(What : in HTML_Tag_Kind;
S : in String);
procedure Set_Comment
(What : in HTML_Tag_Kind;
S : in String);
procedure Set_Literal
(What : in HTML_Tag_Kind;
S : in String);
end AD.HTML;