[Mono-docs-list] aspx monodoc beginnings

John Luke jluke@cfl.rr.com
08 Jul 2003 23:28:05 -0400

Content-Type: text/plain
Content-Transfer-Encoding: 7bit


Here is the start of an aspx monodoc for those that have xsp to try out.

It just uses monodoc --html and some javascript for the links.
It likely has the same problems as the cgi one, but is only meant for
local testing with xsp.

A couple of known problems:
no checking for non-monodoc urls
maybe insecure so please only run locally
uses Process.Start instead of its own provider/output

what works:
displays the docs at a url like monodocs.aspx?link=T:System.String
internal links work

just plop the two attached file to where you have xsp installed.

Thanks to BenM and tberman for helping out.

Content-Disposition: attachment; filename=monodoc.js
Content-Type: text/plain; name=monodoc.js; charset=UTF-8
Content-Transfer-Encoding: 7bit

	function load ()
    	objs = document.getElementsByTagName("a");
    	for (i = 0; i < objs.length; i++)
    		objs[i].href = "monodoc.aspx?link=" + objs[i].href;
        window.location= "monodoc.aspx?link=" + obj.href;

Content-Disposition: attachment; filename=monodoc.aspx
Content-Type: application/x-asp; name=monodoc.aspx
Content-Transfer-Encoding: 7bit

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Diagnostics" %>
<script runat="server">

	public void Page_Load (object sender, EventArgs e)
		string link = (string) Request.Params["link"];
		if (link == null)
			link = "N:System";
		LoadDocs (link);
	void LoadDocs (string path)
		string args = "--html " + path;
		ProcessStartInfo psi = new ProcessStartInfo ();
		psi.RedirectStandardOutput = true;
		psi.FileName = "monodoc";
		psi.Arguments = args;
		Process p = Process.Start (psi);
		string html = Transform (p.StandardOutput.ReadToEnd () );
		mySpan.InnerText = html;
	string Transform (string input)
		// add xslt stuff here
		string output = input;

		return output;
<script src="monodoc.js" />

<title>Mono Documentation</title>
<body onLoad="load()">
<span id="mySpan" runat="server" />