<%
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Setup
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
file_type <- function(file) {
  ext <- gsub(".*[.]([^.]*)$", "\\1", basename(file));
  toupper(ext);
}

# Find all vignettes
vigns <- parseVignettes(final=TRUE, source=TRUE, drop="^dummy[.].*$");

# Identify package name
descFile <- file.path("..", "DESCRIPTION");
if (!file.exists(descFile))
  descFile <- file.path("..", descFile);
pkgName <- grep("Package:", readLines(descFile), value=TRUE);
pkgName <- gsub("Package:", "", pkgName);
pkgName <- gsub("[ \t]*", "", pkgName);
pkg <- Package(pkgName);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
 <title><%=getName(pkg)%> User Guides</title>
 <link rel="stylesheet" type="text/css" href="../../R.css">
</head>
<body>

<h1><%=getTitle(pkg)%> <img class="toplogo" src="../../../doc/html/logo.jpg" alt="[R logo]" width="101" height="77"></h1>
<hr>

<h2>User Guides and Package Vignettes</h2>
<ul>
<% for (vign in vigns) { %>
 <li>
 <strong><%=vign$IndexEntry%></strong> 
 [<a href="<%=file <- vign$final%>"><%=file_type(file)%></a>]
 [<a href="<%=file <- vign$pathname%>">source</a>]
<% if (length(file <- vign$source) == 1L) { %>
 [<a href="<%=file%>">R code</a>]
<% } %>
 </li>
<% } # for (vign ...) %>
</ul>
<br>

<hr>
<div align="center"><a href="../html/00Index.html">[Package Contents]</a></div>
<br>
<div align="center"><small>This page was generated by the <a href="http://cran.r-project.org/web/packages/R.rsp/">R.rsp</a> package.</small></div>

</body>
</html>
