From: Miguel de Icaza Date: Tue, 9 Feb 2016 03:00:13 +0000 (-0500) Subject: [Docs] Use an external style sheet, prefix the css classes with mapi to isolate,... X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=b2b2db1b458b4617bf8557eeea8eefa334df0888;p=mono.git [Docs] Use an external style sheet, prefix the css classes with mapi to isolate, fix various processing problems --- diff --git a/docs/api-style.css b/docs/api-style.css index a7c0c54b27a..001df1b4c73 100644 --- a/docs/api-style.css +++ b/docs/api-style.css @@ -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); @@ -11,14 +11,20 @@ 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; @@ -26,17 +32,17 @@ 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; @@ -44,15 +50,15 @@ 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; @@ -78,14 +84,14 @@ 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; @@ -96,42 +102,26 @@ 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; @@ -142,7 +132,7 @@ 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); @@ -157,9 +147,10 @@ width: 12px; } - .api-height-container { + .mapi-height-container { left: -25px; padding: 0 25px; position: relative; width: 100%; } + diff --git a/docs/exdoc b/docs/exdoc index 7ee86e7d771..7ce4b9290cc 100644 --- a/docs/exdoc +++ b/docs/exdoc @@ -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 (){ + $css = $css . $_; +} if ($ARGV[0] eq "-t"){ $dir = $ARGV[1]; @@ -51,176 +55,11 @@ if ($html){ $name -
+
EOF @a = split (/\n/, $files_content[$f]); $strikeextra = ""; @@ -230,10 +69,10 @@ EOF ($api,$caption) = $line =~ /

(\w+)<\/a><\/h4>/; if ($api ne ""){ if ($api_shown == 1){ - print OUT "

\n\n"; + print OUT "
\n\n"; if ($deprecated{$api}){ - $strike = "strike"; - $strikeextra = "
Deprecated: " . $deprecated{$api}; + $strike = "mapi-strike"; + $strikeextra = "

Deprecated: " . $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< -
-
$api$strikeextra
-
-
-
-
- -
Syntax
-
$proto
+
+
$api$strikeextra
+
+
+
+
+ +
Syntax
+
$proto

EOF - -# if ($arguments{$api} ne "" && (!($arguments{$api}) =~ /^[ \t]+$/)){ - print OUT "

Parameters
\n"; - print OUT " ".${arguments{$api}}."
"; -# } -# &opt_print ("Parameters", $arguments{$api}, 1); + $ppars = $arguments{$api}; + if ($ppars ne "" && (!($ppars =~ /^[ \t]+$/))){ + print OUT "
Parameters
\n"; + print OUT " ".${arguments{$api}}."
"; + } - &opt_print ("Returns", $returns{$api}, 1); + &opt_print ("Return value", $returns{$api}, 0); &opt_print ("Description", $bodies{$api}, 0); - print OUT "
\n
\n"; + print OUT "
\n
\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 (){ + $line++; s/^\/\/\/\///; + + # Remove the junk wrapper generated by AgilityPack + if ($line==1){ + s///; + } + if (/