AMPLE.HTML(5)

🌸 ample.html(5) β€” the User Manual, but make it cute 🌸

okay so bestie, welcome to the AMPLE.HTML(5) page πŸ’– this is the manual for the ample.html file, and it's giving template energy in the absolute best way.


✨ NAME ✨

ample.html β€” html template for Ample πŸŽ€


πŸ’… DESCRIPTION πŸ’…

So. This file β€” and by default it lives at /etc/ample.html β€” gets read by Ample at startup, and it's used as the base for its HTML pages. Those pages get rendered whenever a webbrowser connects and requests a list of available songs and directories (which, typically, happens when you connect to http://server:port/index.html). slay πŸ¦‹

The file is split into three sections: the header, the middle, and the footer. The header and the footer are literally the same on each page generated, while the "middle" gets copied into the final HTML document once for every single file or directory that's going to be listed. ik it sounds confusing but fr fr it becomes so much more evident once you look at the example below. trust πŸ’œ

Variables are written in uppercase and enclosed within "at" signs (example: @NAME@), and they get replaced dynamically when the page is constructed. Some variables can exist anywhere in the document, and some can only exist in the "middle" section β€” so check the info about each variable for details. no cap πŸ‘‘


🌈 EXAMPLE 🌈

<!-- Beginning of header -->
<!DOCTYPE HTML PUBLIC β€œ-//W3C//DTD HTML 4.01 Transitional//EN”>
<html><head>
<title>@SERVERNAME@</title>
</head><body>
<center>
<p><h1>@SERVERNAME@</h1></p>
<p><h2>Tracks currently available in @PATH@</h2></p>
<p><font size=β€œ-1”>[
<a href=β€œindex.m3u”>playlist for this dir</a> |
<a href=β€œrindex.m3u”>recursive playlist</a> ]
</font></p>
<p><font size=β€œ-1”>
[ <a href=β€œ../index.html”>Up one level</a> ]
</font></p>
<div align=β€œcenter”>
<table border=β€œ1” cellspacing=β€œ0” cellpadding=β€œ0” bordercolor=β€œ#000000”>
<tr><td>
<b>TYPE</b>
</td><td>
<b>URL</b>
</td></tr>
<!-- End of header -->

@BEGIN@

<!-- Beginning of β€œmiddle” -->
<tr><td>
@TYPE@
</td><td>
<a href=β€œ@URL@”>@NAME@</a>
</td></tr>
<!-- End of β€œmiddle” -->

@END@

<!-- Beginning of footer -->
</table>
</div>
<p align=β€œright”><font size=β€œ-1”>
powered by Ample, for more information, see the
<a href=β€œhttp://ample.sourceforge.net”>project homepage</a>
</font></p>
</center>
</body>
</html>
<!-- End of footer -->

πŸŽ€ SUMMARY OF VARIABLES πŸŽ€

SPECIAL β€” only used once

  • BEGIN
  • END

GLOBAL β€” can be used anywhere

  • SERVERNAME
  • PORT
  • PATH

NON-GLOBAL β€” can only be used in the "middle" section

  • NAME
  • URL
  • LENGTH
  • TITLE
  • SIZE
  • TYPE

πŸ‘‘ SPECIAL VARIABLES πŸ‘‘

These can only be used once. one and done, main character behavior πŸ’…

  • BEGIN β€” this variable (when placed in the beginning of a new line) marks the end of the header section and the start of the "middle" section.
  • END β€” this variable (when placed in the beginning of a new line) marks the end of the "middle" section and the start of the footer section.

πŸ¦‹ GLOBAL VARIABLES πŸ¦‹

These can be used anywhere. everywhere, honestly. iconic ✨

  • SERVERNAME β€” the name of the server as given in ample.conf(5).
  • PORT β€” the port that the server is listening to.
  • PATH β€” the current path the user is viewing.

πŸ“ NON-GLOBAL VARIABLES πŸ“

These can only be used in the "middle" section. nowhere else, bestie, that's the rule πŸ™ˆ

  • NAME β€” the name of the song or directory.
  • URL β€” the URL of the song or directory.
  • LENGTH β€” the song length (in seconds) or blank if it is a directory.
  • TITLE β€” the title of the song or "DIR" if it is a directory.
  • SIZE β€” the file size or blank if it is a directory.
  • TYPE β€” "FILE" if it is a file or "DIR" if it is a directory.

πŸ’œ AUTHOR πŸ’œ

David HΓ€rdeman <david@2gen.com>


⭐ SEE ALSO ⭐

ample(1), ample.conf(5)


and that's the whole page, bestie!! go forth and template your heart out 🫢

okay so the sign-off: this is the Ample manual, dated JANUARY 2002, and honestly? it ate. periodt πŸ’–πŸŽ€