.\" $Id: ample.html.5.in,v 1.1 2002/02/07 01:02:47 alphix Exp $
.\" 
.\" This file is part of Ample.
.\" 
.\" Ample 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 of the License, or
.\" (at your option) any later version.
.\" 
.\" Ample 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
.\" along with Ample; if not, write to the Free Software
.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
.\"
.\"
.\" Process this file with something like
.\" groff -man -Tascii foo.1
.\"

.TH AMPLE.HTML 5 "JANUARY 2002" Ample "User Manual"
.SH NAME 
ample.html \- html template for Ample

.SH DESCRIPTION
This file, by default
.IR "@sysconfdir@/ample.html" ","
is read by Ample at startup and used as a base for it's HTML pages.
These pages are rendered whenever a webbrowser connects and requests a 
list of available songs and directories (typically done by connecting to 
.BR "http://server:port/index.html" ")."
.P
The file is divided into three sections, the header, the middle and the
footer. The header and the footer are the same on each page generated 
while the \*(lqmiddle\*(rq is copied into the final HTML document once for each
file or directory that is going to be listed. Although this may sound 
confusing, it will probably become much more evident once you look at the
example below.
.P
Variables are written in uppercase and enclosed within \*(lqat\*(rq signs 
(example: 
.BR "@NAME@" ")" 
and are replaced dynamically when the page is constructed.
Some variables can exist anywhere in the document and some can only exist
in the \*(lqmiddle\*(rq section, see the information about each variable for details.

.SH EXAMPLE
.IP "" 0
.nf
<!-- Beginning of header -->
<!DOCTYPE HTML PUBLIC \*(lq-//W3C//DTD HTML 4.01 Transitional//EN\*(rq>
<html><head>
.RB "<title>" "@SERVERNAME@" "</title>"
</head><body>
<center>
.RB "<p><h1>" "@SERVERNAME@" "</h1></p>"
.RB "<p><h2>Tracks currently available in " "@PATH@" "</h2></p>"
<p><font size=\*(lq-1\*(rq>[
<a href=\*(lqindex.m3u\*(rq>playlist for this dir</a> | 
<a href=\*(lqrindex.m3u\*(rq>recursive playlist</a> ]
</font></p>
<p><font size=\*(lq-1\*(rq>
[ <a href=\*(lq../index.html\*(rq>Up one level</a> ]
</font></p>
<div align=\*(lqcenter\*(rq>
<table border=\*(lq1\*(rq cellspacing=\*(lq0\*(rq cellpadding=\*(lq0\*(rq bordercolor=\*(lq#000000\*(rq>
<tr><td>
<b>TYPE</b>
</td><td>
<b>URL</b>
</td></tr>
<!-- End of header -->
.P
.B @BEGIN@
.P
<!-- Beginning of \*(lqmiddle\*(rq -->
<tr><td>
.B @TYPE@
</td><td>
.RB "<a href=\*(lq" "@URL@" "\*(rq>" "@NAME@" "</a>"
</td></tr>
<!-- End of \*(lqmiddle\*(rq -->
.P
.B @END@
.P
<!-- Beginning of footer -->
</table>
</div>
<p align=\*(lqright\*(rq><font size=\*(lq-1\*(rq>
powered by Ample, for more information, see the
<a href=\*(lqhttp://ample.sourceforge.net\*(rq>project homepage</a>
</font></p>
</center>
</body>
</html>
<!-- End of footer -->

.SH SUMMARY OF VARIABLES
.P
.IP "" 0
.nf
.B SPECIAL - Only used once
BEGIN
END
.P
.IP "" 0
.nf
.B GLOBAL - Can be used anywhere
SERVERNAME
PORT
PATH
.P
.IP "" 0
.nf
.B NON-GLOBAL - Can only be used in the \*(rqmiddle\*(lq section
NAME
URL
LENGTH
TITLE
SIZE
TYPE

.SH SPECIAL VARIABLES
These can only be used once.

.TP
.B BEGIN
This variable (when placed in the beginning of a new line) marks the end of the
header section and the start of the \*(rqmiddle\*(lq section.

.TP
.B END
This variable (when placed in the beginning of a new line) marks the end of the
\*(rqmiddle\*(lq section and the start of the footer section.

.SH GLOBAL VARIABLES
These can be used anywhere.

.TP
.B SERVERNAME
The name of the server as given in 
.BR "ample.conf" "(5)."

.TP
.B PORT
The port that the server is listening to.

.TP
.B PATH
The current path the user is viewing.

.SH NON-GLOBAL VARIABLES
These can only be used in the \*(lqmiddle\*(rq section.

.TP 
.B NAME
The name of the song or directory.

.TP
.B URL
The URL of the song or directory.

.TP
.B LENGTH
The song length (in seconds) or blank if it is a directory.

.TP
.B TITLE
The title of the song or \*(lqDIR\*(rq if it is a directory.

.TP
.B SIZE
The file size or blank if it is a directory.

.TP 
.B TYPE
\*(lqFILE\*(rq if it is a file or \*(lqDIR\*(rq if it is a directory.

.SH AUTHOR
David Härdeman <david@2gen.com>

.SH "SEE ALSO"
.BR "ample" "(1), " "ample.conf" "(5)"
