[Docs] Use an external style sheet, prefix the css classes with mapi to isolate,...
authorMiguel de Icaza <miguel@gnome.org>
Tue, 9 Feb 2016 03:00:13 +0000 (22:00 -0500)
committerMiguel de Icaza <miguel@gnome.org>
Tue, 9 Feb 2016 03:00:13 +0000 (22:00 -0500)
13 files changed:
docs/api-style.css
docs/exdoc
docs/sources/mono-api-assembly.html
docs/sources/mono-api-domains.html
docs/sources/mono-api-exc.html
docs/sources/mono-api-gc.html
docs/sources/mono-api-gchandle.html
docs/sources/mono-api-image.html
docs/sources/mono-api-jit.html
docs/sources/mono-api-methods.html
docs/sources/mono-api-object.html
docs/sources/mono-api-string.html
docs/sources/mono-api-type.html

index a7c0c54b27a136bfedc150c9fa3568befadc3753..001df1b4c738cccb60266974c3a20a2df7b76b32 100644 (file)
@@ -1,9 +1,9 @@
-    body {
+    .mapi-docs {
        line-height: 1.5;
        padding-left: 2em;
        padding-right: 2em;
     }
-    body code {
+    .mapi-description code {
         font-family: "Consolas", "Courier", monospace;
         border: 1px solid rgba(214,214,214,1);
        background-color: rgba(249,249,249,1);
        padding-right: 3px;
     }
 
-    .api-entry code {
+    .mapi-header {
+        padding: 0 0 5pt 5pt;
+        margin: 10pt;
+        white-space: pre;
+        font-family: monospace;
+        border: 1px solid rgba(233,233,233,1);
+    }
+
+    .mapi-entry code {
         border: none;
         background-color: transparent;
     }
-    h3 { 
-    }
     
-    .api-parameters {
+    .mapi-parameters {
         border-collapse: collapse;
         border-spacing: 0;
         empty-cells: hide;
         margin: 5px 0 26px;        
     }
 
-    .api-parameters td {
+    .mapi-parameters td {
         border: 1px solid rgba(214,214,214,1);
          border-left-style: none;
        padding: 5px 25px 5px 10px;
     }
 
-    .api-parameters tr>td:last-child  {
+    .mapi-parameters tr>td:last-child  {
         border-right: 0;
     }
        
-    .api-parameters td:first-of-type {
+    .mapi-parameters td:first-of-type {
         text-align: right;
         padding: 7px;
         vertical-align: top;
         width: 40px;
     }
 
-    .api-parameters tr:last-child>td {
+    .mapi-parameters tr:last-child>td {
         border-bottom: 0;
     }
 
-    .api-parameters tr:first-child>td {
+    .mapi-parameters tr:first-child>td {
         border-top: 0;
     }
 
-    .api-parameters tr td:first-of-type {
+    .mapi-parameters tr td:first-of-type {
         text-align: right;
         padding: 7px;
         vertical-align: top;
@@ -60,7 +66,7 @@
         width: 40px;
     }
 
-   .api {
+   .mapi {
         left: -25px;
         margin: 0;
         padding: 13px 25px 0;
@@ -68,7 +74,7 @@
         width: 100%;
     } 
 
-    .api-description {
+    .mapi-description {
         background: rgba(249,249,249,1);
         border-bottom: 1px solid rgba(233,233,233,1);
         left: -25px;
         width: 100%;    
     }
 
-     .api-entry {
+     .mapi-entry {
          background: transparent;
      }
 
-     .api-docs {
+     .mapi-docs {
      }
        
-     .prototype {
+     .mapi-prototype {
          border-left: 5px solid rgba(205,233,244,1);
          padding: .5em;
          margin-top: 5pt;
          background-color: #f9f9f9;
     } 
 
-    .header {
-        padding: 0 0 5pt 5pt;
-        margin: 10pt;
-       white-space: pre;
-        font-family: monospace;
-       border: 1px solid rgba(233,233,233,1);
-    }
-    
-    .code {
-        border: 1px solid;
-       padding: 0 0 5pt 5pt;
-       margin: 10pt;
-       white-space: pre;
-       font-family: monospace;
-    }
-
-    .declaration {
+    .mapi-declaration {
        margin-top: 21px;
     }
 
-    .api-section {
+    .mapi-section {
         font-size: smaller;
        font-weight: bold;
        margin-top: 21px;
        line-height: 1.5;
     }
        
-    .strike {
+    .mapi-strike {
         text-decoration: line-through;
     }
 
-    .deprecated {
+    .mapi-deprecated {
         color: red;
     }
 
-    .api-ptr-container {
+    .mapi-ptr-container {
         background: white;
        border-bottom: 1px solid rgba(233,233,233,1);
         left: -25px;
         width: 100%;
     }
 
-    .api-ptr {
+    .mapi-ptr {
         background: rgba(249,249,249,1);
        border-left: 1px solid rgba(233,233,233,1);
        border-top: 1px solid rgba(233,233,233,1);
         width: 12px;
     }
 
-    .api-height-container {
+    .mapi-height-container {
         left: -25px;
         padding: 0 25px;
         position: relative;
         width: 100%;
     }
+       
index 7ee86e7d7712c81da5165eb1d4abd9951a288c12..7ce4b9290cca64805d7655ad68b3d071c4d686ff 100644 (file)
@@ -7,6 +7,10 @@ if ($ARGV[0] eq "-h"){
     shift @ARGV;
     shift @ARGV;
 }
+open (FILE, "$dir/api-style.css" || die "Did not find $dir/api-style.css");
+while (<FILE>){
+    $css = $css . $_;
+}
 
 if ($ARGV[0] eq "-t"){
     $dir = $ARGV[1];
@@ -51,176 +55,11 @@ if ($html){
 <head>
     <title>$name</title>
     <style type="text/css">
-    body {
-       line-height: 1.5;
-       padding-left: 2em;
-       padding-right: 2em;
-    }
-    body code {
-        font-family: "Consolas", "Courier", monospace;
-        border: 1px solid rgba(214,214,214,1);
-       background-color: rgba(249,249,249,1);
-       padding-left: 3px;
-       padding-right: 3px;
-    }
-
-    .api-entry code {
-        border: none;
-        background-color: transparent;
-    }
-    h3 { 
-    }
-    
-    .api-parameters {
-        border-collapse: collapse;
-        border-spacing: 0;
-        empty-cells: hide;
-        border: 0;
-        margin: 5px 0 26px;        
-    }
-
-    .api-parameters td {
-        border: 1px solid rgba(214,214,214,1);
-         border-left-style: none;
-       padding: 5px 25px 5px 10px;
-    }
-
-    .api-parameters tr>td:last-child  {
-        border-right: 0;
-    }
-       
-    .api-parameters td:first-of-type {
-        text-align: right;
-        padding: 7px;
-        vertical-align: top;
-        word-break: normal;
-        width: 40px;
-    }
-
-    .api-parameters tr:last-child>td {
-        border-bottom: 0;
-    }
-
-    .api-parameters tr:first-child>td {
-        border-top: 0;
-    }
-
-    .api-parameters tr td:first-of-type {
-        text-align: right;
-        padding: 7px;
-        vertical-align: top;
-        word-break: normal;
-        width: 40px;
-    }
-
-   .api {
-        left: -25px;
-        margin: 0;
-        padding: 13px 25px 0;
-        position: relative;
-        width: 100%;
-    } 
-
-    .api-description {
-        background: rgba(249,249,249,1);
-        border-bottom: 1px solid rgba(233,233,233,1);
-        left: -25px;
-        margin: 0;
-        padding: 13px 25px 0;
-        position: relative;
-        width: 100%;    
-    }
-
-     .api-entry {
-         background: transparent;
-     }
-
-     .api-docs {
-     }
-       
-     .prototype {
-         border-left: 5px solid rgba(205,233,244,1);
-         padding: .5em;
-         margin-top: 5pt;
-         margin-bottom: 5pt;
-         font-family: "Consolas", "Courier", monospace;
-         display: block;
-         overflow: auto;
-         background-color: #f9f9f9;
-    } 
-
-    .header {
-        padding: 0 0 5pt 5pt;
-        margin: 10pt;
-       white-space: pre;
-        font-family: monospace;
-       border: 1px solid rgba(233,233,233,1);
-    }
-    
-    .code {
-        border: 1px solid;
-       padding: 0 0 5pt 5pt;
-       margin: 10pt;
-       white-space: pre;
-       font-family: monospace;
-    }
-
-    .declaration {
-       margin-top: 21px;
-    }
-
-    .api-section {
-        font-size: smaller;
-       font-weight: bold;
-       margin-top: 21px;
-       line-height: 1.5;
-    }
-       
-    .strike {
-        text-decoration: line-through;
-    }
-
-    .deprecated {
-        color: red;
-    }
-
-    .api-ptr-container {
-        background: white;
-       border-bottom: 1px solid rgba(233,233,233,1);
-        left: -25px;
-        padding-left: 25px;
-        padding-right: 25px;
-        padding-bottom: 13px;
-        position: relative;
-        width: 100%;
-    }
-
-    .api-ptr {
-        background: rgba(249,249,249,1);
-       border-left: 1px solid rgba(233,233,233,1);
-       border-top: 1px solid rgba(233,233,233,1);
-        height: 12px;
-        left: 37px;
-        top: -7px;
-        -webkit-transform: rotate(45deg);
-        -moz-transform: rotate(45deg);
-        -o-transform: rotate(45deg);
-        transform: rotate(45deg);
-        position: absolute;
-        width: 12px;
-    }
-
-    .api-height-container {
-        left: -25px;
-        padding: 0 25px;
-        position: relative;
-        width: 100%;
-    }
-       
+$css
    </style>
 </head>
 <body>
-<div class="api-docs">
+<div class="mapi-docs">
 EOF
        @a = split (/\n/, $files_content[$f]);
        $strikeextra = "";
@@ -230,10 +69,10 @@ EOF
            ($api,$caption) = $line =~  /<h4><a name=\"api:(\w+)\">(\w+)<\/a><\/h4>/;
            if ($api ne ""){
                if ($api_shown == 1){
-                   print OUT "</div> <!-- class=api -->\n\n";
+                   print OUT "</div> <!-- class=mapi -->\n\n";
                    if ($deprecated{$api}){
-                       $strike = "strike";
-                       $strikeextra = "</div><br><div class='deprecated'><b>Deprecated:</b> " . $deprecated{$api};
+                       $strike = "mapi-strike";
+                       $strikeextra = "</div><br><div class='mapi-deprecated'><b>Deprecated:</b> " . $deprecated{$api};
                    } else {
                        $strike = "";
                        $strikeextra = "";
@@ -242,32 +81,31 @@ EOF
                $api_shown = 1;
                $proto = $prototype{$api};
                if ($proto eq ""){
-                   $proto = "Prototype: $api";
+                   $proto = "$api";
                }
 
                 print OUT<<EOF;
 <a name="api:$api"></a>
-<div class="api">
-    <div class="api-entry $strike"><code>$api$strikeextra</code></div>
-    <div class="api-height-container">
-        <div class="api-ptr-container"></div>
-        <div class="api-description">
-            <div class="api-ptr"></div>
-
-            <div class="declaration api-section">Syntax</div>
-            <div class="prototype">$proto</div>
+<div class="mapi">
+    <div class="mapi-entry $strike"><code>$api$strikeextra</code></div>
+    <div class="mapi-height-container">
+        <div class="mapi-ptr-container"></div>
+        <div class="mapi-description">
+            <div class="mapi-ptr"></div>
+
+            <div class="mapi-declaration mapi-section">Syntax</div>
+            <div class="mapi-prototype">$proto</div>
             <p>
 EOF
-
-#              if ($arguments{$api} ne "" && (!($arguments{$api}) =~ /^[ \t]+$/)){
-                   print OUT "            <div class=\"api-section\">Parameters</div>\n";
-                   print OUT "            <table class=\"api-parameters\"><tbody>".${arguments{$api}}."</tbody></table>";
-#              }
-#              &opt_print ("Parameters", $arguments{$api}, 1);
+                $ppars = $arguments{$api};
+               if ($ppars ne "" && (!($ppars =~ /^[ \t]+$/))){
+                   print OUT "            <div class=\"mapi-section\">Parameters</div>\n";
+                   print OUT "            <table class=\"mapi-parameters\"><tbody>".${arguments{$api}}."</tbody></table>";
+               }
            
-               &opt_print ("Returns", $returns{$api}, 1);
+               &opt_print ("Return value", $returns{$api}, 0);
                &opt_print ("Description", $bodies{$api}, 0);
-               print OUT "        </div><!--api-description-->\n    </div><!--height container-->\n";
+               print OUT "        </div><!--mapi-description-->\n    </div><!--height container-->\n";
            } else {
                if ($line =~ /@API_IDX@/){
                    $apis_toc = &create_toc ($apis[$f]);
@@ -290,13 +128,30 @@ EOF
        close OUT;
        system ("$ENV{runtimedir}/mono-wrapper convert.exe $dir/html/$name $dir/html/x-$name");
 
+
        # clean up the mess that AgilityPack does, it CDATAs our CSS
        open HACK, "$dir/html/x-$name" || die "Could not open $dir/html/x-$name";
        open HACKOUT, ">$dir/deploy/$name" || die "Could not open output";
 
+       $line = 0;
        while (<HACK>){
+           $line++;
            s/^\/\/<!\[CDATA\[//;
            s/^\/\/\]\]>\/\///;
+
+           # Remove the junk <span> wrapper generated by AgilityPack
+           if ($line==1){
+               s/<?span>//;
+           }
+           if (/<style type/){
+               # Replace the CSS in the XHTML output with the original CSS
+               print HACKOUT $_;
+               print HACKOUT $css;
+               while (<HACK>){
+                   last if (/<\/style>/);
+               }
+           }
+
            print HACKOUT $_;
        }
        #system ("cp.exe $dir/html/$name $dir/deploy/$name");
@@ -411,6 +266,9 @@ sub create_toc {
        chop;
        $p = $prototype{$line};
        ($ret, $xname, $args) = $p =~ /(.*)\n(\w+)[ \t](.*)/;
+       if ($xname eq ""){
+           $xname = $line;
+       }
        
        $rspace = " " x ($type_size - length ($ret));
        $nspace = " " x ($name_size - length ($xname));
@@ -454,11 +312,7 @@ sub opt_print {
     my ($caption, $opttext, $quote) = @_;
 
     if ($opttext ne "" && (!($opttext =~ /^[ \t]+$/))){
-       print OUT "             <div class=\"api-section\">$caption</div>\n";
-       if ($quote == 1){
-           print OUT "             <blockquote>$opttext</blockquote>\n";
-       } else {
-           print OUT "             <p>$opttext\n";
-       }
+       print OUT "             <div class=\"mapi-section\">$caption</div>\n";
+        print OUT "             <div>$opttext</div>\n";
     }
 }
index 15e295839999457500091500cadfab8268e2ed66..979a74c5246f347e23b4129acf9e29041c20b360 100644 (file)
@@ -2,7 +2,7 @@
 
 <h3>Synopsis</h3>
 
-       <div class="header">
+       <div class="mapi-header">
 #include &lt;metadata/assembly.h&gt;
 
 typedef struct _MonoImage MonoImage;
index 9ae0bd1449774229af1b6d952694b64759afee67..ceef8893bf50542b9818ab85c0dd4a82e170f797 100644 (file)
@@ -2,7 +2,7 @@
 
 <h3>Synopsis</h3>
 
-<div class="header">
+<div class="mapi-header">
 #include &lt;metadata/appdomain.h&gt;
 
 /* Managed AppDomain */
index d0ab2032fd1b1227f94b37dbf21a1760fbe8f4cc..f6504355ebcf3c8bd06f898ae80b8349bd063fe0 100644 (file)
@@ -1,6 +1,6 @@
 <h2>Exception Handling</h2>
 
-<div class="header">
+<div class="mapi-header">
 @API_IDX@
 </div>
 
index e70e821be8ac7adc15d97dfc1879bf64e9002a11..20d6cb9dc9b3566f7408862163ea6c0c98b30666 100644 (file)
@@ -61,7 +61,7 @@
        bridged objects are not nulled.  This might be considered a
        bug.
 
-<div class="header">
+<div class="mapi-header">
 enum {
         SGEN_BRIDGE_VERSION = 4
 };
index e07be50b5946e648c78d0c395ec5e82181667221..ccd468823fb13b520686ef5c77ebc92b59f9e3a0 100644 (file)
@@ -2,7 +2,7 @@
 
 <h3>Synopsys</h3>
 
-       <div class="header">
+       <div class="mapi-header">
 @API_IDX@
        </div>
        
index f0640ce9dce5837536cb4481cb01270fa7d65111..764f2a4a9c9041896b4b8c53ba9827d3b631a193 100644 (file)
@@ -6,7 +6,7 @@
 
 <h3>Synopsis</h3>
 
-       <div class="header">
+       <div class="mapi-header">
 #include &lt;metadata/image.h&gt;
 
 typedef struct _MonoImage MonoImage;
index 14548c4e9d3ed81fb927c3f460472bdd709c1e7f..ee9836cd116f630a6f849d1d2acd5313701aeca2 100644 (file)
@@ -1,6 +1,6 @@
 <h2>Synopsis</h2>
 
-<div class="header">
+<div class="mapi-header">
 @API_IDX@
 </div>
 
index ae12de2fbb5780ef7d60195c9fdf3152e307b168..bd3e04759e9ccbf8f3adc2cdad8782cb1bb5baf7 100644 (file)
@@ -14,7 +14,7 @@
        managed implementation of System.Version, creating an instance
        of the object, and then invoking the constructor on it.
 
-       <div class="header">
+       <div class="mapi-header">
 MonoObject*
 create_version (MonoDomain *domain, guint32 major, guint32 minor, guint32 build, guint32 revision)
 {
index da421e45743ee738739a3496862a530b9e15214b..92e8963dbf3f2066755bcd6427b70d10ee8f9cc6 100644 (file)
@@ -16,7 +16,7 @@
        
 <h2>Synopsis</h2>
 
-<div class="header">
+<div class="mapi-header">
 #include &lt;metadata/object.h&gt;
 
 typedef struct MonoVTable MonoVTable;
index f5956dd51b82d58b2d25cc0efb8ba6206af027f3..be70faf606a3e7a69d35862678c84e163dd209b7 100644 (file)
@@ -4,7 +4,7 @@
 
 <h3>Synopsis</h3>
 
-       <div class="header">
+       <div class="mapi-header">
 #include &lt;metadata/object.h&gt;
 
 typedef struct {
index a5a98c99c7509752e0e1346939125c4fc82e6b73..1fa9feee33281c8830df74232d56bf6e8468f077 100644 (file)
@@ -2,7 +2,7 @@
 
 <h3>Synopsis</h3>
 
-       <div class="header">
+       <div class="mapi-header">
 #include &lt;metadata/metadata.h&gt;
 #include &lt;metadata/class.h&gt;