[Mono-docs-list] Monodoc web browser patch

Fawad Halim fawad@fawad.net
Thu, 09 Oct 2003 16:55:59 -0500

This is a multi-part message in MIME format.
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

    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 
* 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/monodoc.ashx?tlink=6@N%3ASystem in a new window, 
it loads http://localhost:8080/index.aspx?tlink=6@N%3ASystem with 
http://localhost:8080/monodoc.ashx?tlink=6@N%3ASystem in the contents frame.

TODO: Get the navigation tree to open up to the selected element.


Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;

Index: monodoc.ashx
RCS file: /mono/monodoc/browser/web/monodoc.ashx,v
retrieving revision 1.18
diff -r1.18 monodoc.ashx
> 	if (top.location == document.location)
> 	{
> 		top.location.href = 'index.aspx'+document.location.search;
> 	}

Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Collections.Specialized" %>
    <title>Mono Documentation</title>
	<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
			// else, build query for the content frame
			string nQueryString=monodocUrl+"?";
			foreach(string key in qStringParams)
			return nQueryString;
  <frameset cols="20%,80%">
    <frame src="monodoc.ashx?tree=boot">
    <frame src="<% =getContentFrame() %>" name="content">