Attached is a tiny patch to the monodoc web browser. It's an effort to mimic the behavior of MSDN library docs, i.e. each doc gets a unique URL and that gets rendered in the frameset.
* index.aspx is a replacement of index.html: If passed any arguments on the querystring, they are passed on to the content frame in it's frameset. If no arguments are passed, it loads the root document like index.html
* monodoc.ashx.diff: Diff against the monodoc handler in CVS. I've added 3 lines in the javascript for the tlink: handler that uses index.aspx to put itself in the frameset. For example, if we browse to http://localhost:8080/[EMAIL PROTECTED] in a new window, it loads http://localhost:8080/[EMAIL PROTECTED] with http://localhost:8080/[EMAIL PROTECTED] in the contents frame.
TODO: Get the navigation tree to open up to the selected element.
Regards -fawad
Index: monodoc.ashx
===================================================================
RCS file: /mono/monodoc/browser/web/monodoc.ashx,v
retrieving revision 1.18
diff -r1.18 monodoc.ashx
206a207,211
> if (top.location == document.location)
> {
> top.location.href = 'index.aspx'+document.location.search;
> }
>
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Collections.Specialized" %>
<html>
<head>
<title>Mono Documentation</title>
</head>
<script language="c#" runat="server">
// Get the path to be shown in the content fram
string getContentFrame()
{
// Docs get shown from monodoc.ashx
string monodocUrl="monodoc.ashx";
string defaultParams="?link=root:";
NameValueCollection qStringParams=Request.QueryString;
// If no querystring params, show root link
if(!qStringParams.HasKeys())
return(monodocUrl+defaultParams);
// else, build query for the content frame
string nQueryString=monodocUrl+"?";
foreach(string key in qStringParams)
nQueryString+=(HttpUtility.UrlEncode(key)+"="+HttpUtility.UrlEncode(qStringParams[key]));
return nQueryString;
}
</script>
<frameset cols="20%,80%">
<frame src="monodoc.ashx?tree=boot">
<frame src="<% =getContentFrame() %>" name="content">
</frameset>
</html>
