[Mono-docs-list] [PATCH] Fixing namespace edit (#319116)

Mario Sopena Novales mario.sopena at gmail.com
Fri Feb 22 13:49:41 EST 2008


Hi,

   I fixed all the indentation mess. More comments below:

On 22/02/2008, Jonathan Pryor <jonpryor at vt.edu> wrote:
> On Fri, 2008-02-22 at 18:08 +0100, Mario Sopena Novales wrote:
>  > Index: provider.cs
>  > ===================================================================
>  > --- provider.cs (revisión: 96411)
>  > +++ provider.cs (copia de trabajo)
>  > @@ -609,9 +609,13 @@
>  >                 }
>  >         }
>  >
>  > -       public void PackXml (string fname, XmlDocument doc)
>  > +       public void PackXml (string fname, XmlDocument doc, string real_path)
>  >         {
>  > -               zip_output.PutNextEntry (new ZipEntry (fname));
>  > +        ZipEntry entry = new ZipEntry (fname);
>  > +        if (real_path != null)
>  > +            entry.ExtraData = ConvertToArray(real_path);
>  > +
>  > +               zip_output.PutNextEntry (entry);
>
>  Please fix your indenting.
>
>  > Index: mono-ecma-css.xsl
>  > ===================================================================
>  > --- mono-ecma-css.xsl   (revisión: 96411)
>  > +++ mono-ecma-css.xsl   (copia de trabajo)
>  > @@ -684,7 +684,7 @@
>  >                                 <xsl:apply-templates select="summary" mode="notoppara"/>
>  >                                 <xsl:if test="monodoc:MonoEditing()">
>  >                                         <xsl:value-of select="' '" />
>  > -                                       <a href="{monodoc:EditUrlNamespace ($namespace, 'summary')}">[Edit]</a>
>  > +                                       [<a href="{monodoc:EditUrlNamespace (., $namespace, 'summary')}">Edit</a>]
>
>  Any particular reason you don't want the '[' and ']' as part of the link
>  text?  I'd prefer to keep them as part of the link.

Because the other Edit links are like this, so I though it would be
better to keep all unified.


>
>  > Index: ecma-provider.cs
>  > ===================================================================
>  > --- ecma-provider.cs    (revisión: 96411)
>  > +++ ecma-provider.cs    (copia de trabajo)
>  > @@ -184,6 +184,7 @@
>  >                                         if (File.Exists (ns_summary_file)) {
>  >                                                 XmlDocument nsSummaryFile = new XmlDocument ();
>  >                                                 nsSummaryFile.Load (ns_summary_file);
>  > +                        namespace_realpath [tn] = ns_summary_file;
>
>  Fix indentation.
>
>  > @@ -869,16 +871,16 @@
>  >
>  >                         match_node = ns_node;
>  >                         string ns_name = nsurl.Substring (2);
>  > -
>  > -                       XmlReader summary = GetNamespaceDocument (ns_name);
>  > -                       if (summary == null)
>  > +
>  > +            XmlDocument doc = GetHelpXmlWithChanges("xml.summary." + ns_name);
>  > +            if (doc == null)
>  >                                 return null;
>
>  Shouldn't this fall-back to using GetNamspaceDocument() if
>  GetHelpXmlWithChanges() fails?

Well, the reason is that GetNamespaceDocument calls GetHelpXml() which
is a function copy&pasted to GetHelpXmlWithChanges except for the
later calling one extra method to detect whether there are changes and
applying them. In fact, I think we should remove
GetNamespaceDocument... well, I think the monodoc "library" need a
heavy refactoring because it is a little mess, I just don't find
enough free time to do it, ;-P


>
>  > @@ -1181,10 +1183,12 @@
>  >                         return "";
>  >                 }
>  >
>  > -               public string EditUrlNamespace (string ns, string section)
>  > +               public string EditUrlNamespace (XPathNodeIterator itr, string ns, string section)
>  >                 {
>  >                         if (hs is EcmaUncompiledHelpSource)
>  >                                 return "edit:file:" + Path.Combine(((EcmaUncompiledHelpSource)hs).BasePath, ns + ".xml") + "@/Namespace/Docs/" + section;
>  > +            else if (itr.MoveNext ())
>  > +                return EditingUtils.FormatEditUri(itr.Current.BaseURI, "/elements/" + section);
>
>  Indentation.
>
>  Thanks,
>   - Jon



Thanks,  Mario
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ns.diff
Type: text/x-patch
Size: 4882 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-docs-list/attachments/20080222/e99252a8/attachment-0001.bin 


More information about the Mono-docs-list mailing list