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 <[EMAIL PROTECTED]> |
<<attachment: info_bulb.png>>
<<attachment: Screenshot-LiveEdit.png>>