[Mono-docs-list] Monodoc editing and live preview.

Miguel de Icaza miguel@ximian.com
05 Sep 2003 22:10:29 -0400


--=-+yUZ5tJRrVt6ndd2TZBi
Content-Type: multipart/alternative; boundary="=-wsc6os1aOLqSsNGRw2lV"


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

Hey guys,

   I got a simple patch to do real-time previewing of the text being
entered into the editor as we go:


Mandatory Screenshot





How it works


   This works by creating a small xml document like this:

    <?xml version="1.0"?>
    <docs>
	CONTENTS_OF_THE_EDITOR_WINDOW_GO_HERE
    </docs>

    And then parsing that into an XmlDocument, and passing it to the
EcmaHelpSource.Htmlize routine.  Since the input might very well be
invalid, code is protected with a try/catch.


Problems


   The current solution does work for everything, it fails when:


      * <see cref="SomeType"/> is invoked, the error message I get is:
        
        
                        
                        Error is:
                        System.Xml.XPath.XPathException: function monodoc:MakeNiceSignature not found
                        in [0x00102] (at
                        /cvs/mcs/class/System.XML/System.Xml.XPath/Expression.cs:1312) 00 System.Xml.XPath.ExprFunctionCall:Evaluate (System.Xml.XPath.BaseIterator)
                        in [0x00002] (at
                        /cvs/mcs/class/System.XML/System.Xml.XPath/Expression.cs:392) 00 System.Xml.XPath.Expression:EvaluateString (System.Xml.XPath.BaseIterator)
                        in [0x00007] (at
                        /cvs/mcs/class/System.XML/System.Xml.XPath/Expression.cs:112) 00 System.Xml.XPath.CompiledExpression:EvaluateString (System.Xml.XPath.BaseIterator)
                        in [0x00018] (at
                        /cvs/mcs/class/System.XML/System.Xml.XPath/Expression.cs:115) 00 System.Xml.XPath.CompiledExpression:EvaluateString (System.Xml.XPath.BaseIterator)



      * I guess the above is due to me using the Htmlize function as
        opposed to the Htmlize function with the Extension object.  So I
        need some help here.



      * I would love to give some loving to the various "block" types to
        spice up our rendering.  For example, the informational block
        probably should use a lighbulb like the one above (should be
        easy: we can embed more icons, and we just need some tweaks to
        our stylesheet).  Bonus point: make this work also on the Web
        edition.



      *  The current routine that pulls the text to edit, pulls too
        much.  So the external <para> is removed, so that means that by
        default we are on an error condition.  This is one for Ben:
        could we get for the editor, everything inside the node?  Ie,
        given "<summary><para>Hello!</para></summary>", we should get
        "<para>Hello!</para>" instead of just "Hello!".  


Best wishes,
Miguel.
-- 
Miguel de Icaza <miguel@ximian.com>

--=-wsc6os1aOLqSsNGRw2lV
Content-Type: text/html; charset=utf-8

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.0.8">
</HEAD>
<BODY>
Hey guys,<BR>
<BR>
&nbsp;&nbsp; I got a simple patch to do real-time previewing of the text being entered into the editor as we go:<BR>
<BR>
<H3>Mandatory Screenshot</H3>
<BR>
<IMG SRC="cid:1062812186.4489.293.camel@erandi.boston.ximian.com" ALIGN="top" ALT="" BORDER="0"><BR>
<BR>
<H3>How it works</H3>
<BR>
&nbsp;&nbsp; This works by creating a small xml document like this:<BR>
<BR>
&nbsp;&nbsp;&nbsp; &lt;?xml version=&quot;1.0&quot;?&gt;<BR>
&nbsp;&nbsp;&nbsp; &lt;docs&gt;<BR>
	CONTENTS_OF_THE_EDITOR_WINDOW_GO_HERE<BR>
&nbsp;&nbsp;&nbsp; &lt;/docs&gt;<BR>
<BR>
&nbsp;&nbsp;&nbsp; And then parsing that into an XmlDocument, and passing it to the EcmaHelpSource.Htmlize routine.&nbsp; Since the input might very well be invalid, code is protected with a try/catch.<BR>
<BR>
<H3>Problems</H3>
<BR>
&nbsp;&nbsp; The current solution does work for everything, it fails when:<BR>
<BR>
<UL>
    <LI>&lt;see cref=&quot;SomeType&quot;/&gt; is invoked, the error message I get is:
</UL>
<BLOCKQUOTE>
    <BR>
    <TABLE BGCOLOR="#ccccc0" CELLSPACING="0" WIDTH="80%">
<TR>
<TD>
<TABLE BGCOLOR="#fffff0" CELLSPACING="0" CELLPADDING="3" WIDTH="100%">
<TR>
<TD VALIGN="top">
<BLOCKQUOTE>
    <BLOCKQUOTE>
        <IMG SRC="cid:1062812366.4489.297.camel@erandi.boston.ximian.com" VSPACE="2" HSPACE="3" VSPACE="2" ALIGN="bottom" BORDER="0">
    </BLOCKQUOTE>
</BLOCKQUOTE>
</TD>
<TD WIDTH="100%">
<BLOCKQUOTE>
    <BLOCKQUOTE>
        Error is: System.Xml.XPath.XPathException: function monodoc:MakeNiceSignature not found<BR>
        in [0x00102] (at /cvs/mcs/class/System.XML/System.Xml.XPath/Expression.cs:1312) 00 System.Xml.XPath.ExprFunctionCall:Evaluate (System.Xml.XPath.BaseIterator)<BR>
        in [0x00002] (at /cvs/mcs/class/System.XML/System.Xml.XPath/Expression.cs:392) 00 System.Xml.XPath.Expression:EvaluateString (System.Xml.XPath.BaseIterator)<BR>
        in [0x00007] (at /cvs/mcs/class/System.XML/System.Xml.XPath/Expression.cs:112) 00 System.Xml.XPath.CompiledExpression:EvaluateString (System.Xml.XPath.BaseIterator)<BR>
        in [0x00018] (at /cvs/mcs/class/System.XML/System.Xml.XPath/Expression.cs:115) 00 System.Xml.XPath.CompiledExpression:EvaluateString (System.Xml.XPath.BaseIterator)
    </BLOCKQUOTE>
</BLOCKQUOTE>
</TD>
</TR>
</TABLE>

</TD>
</TR>
</TABLE>

</BLOCKQUOTE>
<BR>
<UL>
    <LI>I guess the above is due to me using the Htmlize function as opposed to the Htmlize function with the Extension object.&nbsp; So I need some help here.
</UL>
<BR>
<UL>
    <LI>I would love to give some loving to the various &quot;block&quot; types to spice up our rendering.&nbsp; For example, the informational block probably should use a lighbulb like the one above (should be easy: we can embed more icons, and we just need some tweaks to our stylesheet).&nbsp; Bonus point: make this work also on the Web edition.
</UL>
<BR>
<UL>
    <LI> The current routine that pulls the text to edit, pulls too much.&nbsp; So the external &lt;para&gt; is removed, so that means that by default we are on an error condition.&nbsp; This is one for Ben: could we get for the editor, everything inside the node?&nbsp; Ie, given &quot;&lt;summary&gt;&lt;para&gt;Hello!&lt;/para&gt;&lt;/summary&gt;&quot;, we should get &quot;&lt;para&gt;Hello!&lt;/para&gt;&quot; instead of just &quot;Hello!&quot;.&nbsp; 
</UL>
<BR>
Best wishes,<BR>
Miguel.<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
-- <BR>
Miguel de Icaza &lt;<A HREF="mailto:miguel@ximian.com"><U>miguel@ximian.com</U></A>&gt;
</TD>
</TR>
</TABLE>

</BODY>
</HTML>

--=-wsc6os1aOLqSsNGRw2lV--

--=-+yUZ5tJRrVt6ndd2TZBi
Content-ID: <1062812366.4489.297.camel@erandi.boston.ximian.com>
Content-Disposition: attachment; filename=info_bulb.png
Content-Type: image/png; name=info_bulb.png
Content-Transfer-Encoding: base64

iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA6ADoAOjox9wzAAAKGklE
QVR42u2aa2wcVxXHf/fO7sbP+BHHjp1HbTdNnTqhCQEhBFHLo6gUoaIK6CtNW0VVUwJIlRASpeoH
viBQBAiQqtIiXlIj9UOqSjzVF4KQQhKapI9kE0vbNPH6sY63633vzL3n8mFm/SgSapsNNRIjX89q
Z2f2/7vnf86cuTb8j2+qERdJp9Mun8+Ty+WYm5ujUqkgIgAkEgna2tro7Oyko6OD4eFhtWwAUqmU
S6VSTExM0dm5it7eAbq6VtHc3IbWGmsNxWKBmZkM58+fI5MZp7+/l9HRUXp7exkYGFDvC0A6nXZn
zpzhzTcvMDq6jcHBjdERByhEBBEQcTjncA6sDV+PjSU5fPg51q1bw86dOxkZGVH/VYBUKuUOHTrE
wMAVbN/+YTxPoVR4mbpYYwRrl0JYuwgIOHb0EC+++Fv27NnD+vXr6e/vV5cdYGxszL3wwp+57rpP
0dfXTyym8DyN1grnQoFBYAkCWSI83DusOEQchD9kMpP8/IkfctttX2Lr1q3vCUK/m5l/4YU/c+ON
n6e/f4B4XJNIxIjHPTxPo9RCBJQCpVQ0w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6L7xvEFKmUs9igTK3mE2vqI9HSw6YRR6l8GJHs8gAAqE7/
jkTHtawevplebwUKhalN4ZenEeMTGIvDo5i/SOrUH8hkpaF/oblkAK9lkNnJk6wsX8BLdCG2iq3N
UC1dpFrJ4/s+hWKNas2QnlE0NTcvL4BY8yBda7rIZy+QTaewLo41Rcpzs9SqeWo1n6pvGBjcybXb
HH8//KflBVCceo7EyhFWrf84vcMrcc5HrMFUZ6mUphFjELWCzPhxJt44QWamuLwA4h1byGbGWBlU
UFpj/SJBLUelOEO5nMOvBRhjKZQDJmcKvDVXXl4AidZBuvvbKRWyZGczVKsVKoVpysWL1KpF/MBQ
8w0DG3awddsKCoXneOmVmeUBEI/H+ckPHuLOL36K9r4ddA98EJxQyV/ABGWM8YE4+fwUM+lTvH7y
KN/50fPsvO4zywNgw4YN/OoXeW78ZAYjR0C9As7iV/OUCzNUqnmMMQS+MD1b4Ikn/0Fbezd79uzh
6aeffv8Benp6+OznbuGur/2YwXXdfOFzH6Szox3jF5maPEe+UGQyE3Dk5bP4AVzMCXfeuYuhoaGG
RaAh/cjZs2fds88+y1NPPUUmk+GOO+6gUChw8OBBSqUSHR0dPPjgg3R3d7N9+3Y2btyolk0SA2za
tEkBHDt2zD3yyCOkUik6OjoIggDnHHfffTf3339/Q//FoKERqG8TExMumUzy+OOPc+7cOZqamrjh
hhu49dZbufLKKy8LwP+393v7FwySAXi2mRMXAAAAAElFTkSuQmCC

--=-+yUZ5tJRrVt6ndd2TZBi
Content-ID: <1062812186.4489.293.camel@erandi.boston.ximian.com>
Content-Disposition: attachment; filename=Screenshot-LiveEdit.png
Content-Type: image/png; name=Screenshot-LiveEdit.png
Content-Transfer-Encoding: base64


--=-+yUZ5tJRrVt6ndd2TZBi--