[mono-api-html] Make it possible to hide/show non-breaking changes in the html output.
[mono.git] / mcs / tools / corcompare / mono-api-html / ClassComparer.cs
index 761f87a5552472fa51199f84daa48f8a369dbd87..1e19ab4b38efbc79a5a3d20ec1ee5d8fd5105bbf 100644 (file)
@@ -72,11 +72,13 @@ namespace Xamarin.ApiDiff {
                        string name = target.Attribute ("name").Value;
                        if (State.IgnoreNew.Any (re => re.IsMatch (name)))
                                return;
+                       Output.WriteLine ("<div> <!-- start type {0} -->", name);
                        Output.WriteLine ("<h3>New Type {0}.{1}</h3>", State.Namespace, name);
-                       Output.WriteLine (State.Colorize ? "<pre style='color: green'>" : "<pre>");
+                       Output.WriteLine ("<pre class='added' data-is-non-breaking>");
                        State.Indent = 0;
                        AddedInner (target);
                        Output.WriteLine ("</pre>");
+                       Output.WriteLine ("</div> <!-- end type {0} -->", name);
                }
 
                public void AddedInner (XElement target)
@@ -226,17 +228,17 @@ namespace Xamarin.ApiDiff {
                        var s = (Output as StringWriter).ToString ();
                        State.Output = output;
                        if (s.Length > 0) {
+                               var tn = GetTypeName (target);
+                               Output.WriteLine ("<!-- start type {0} --> <div>", tn);
                                Output.WriteLine ("<h3>Type Changed: {0}.{1}</h3>", State.Namespace, GetTypeName (target));
                                Output.WriteLine (s);
+                               Output.WriteLine ("</div> <!-- end type {0} -->", tn);
                        }
                }
 
                public override void Removed (XElement source)
                {
-                       var style = string.Empty;
-                       if (State.Colorize)
-                               style = "style='color: red'";
-                       Output.Write ("<h3>Removed Type <span {0}>{1}.{2}</span></h3>", style, State.Namespace, GetTypeName (source));
+                       Output.Write ("<h3>Removed Type <span class='breaking' data-is-breaking>{0}.{1}</span></h3>", State.Namespace, GetTypeName (source));
                }
 
                public virtual string GetTypeName (XElement type)