| OLD | NEW |
| 1 /** |
| 2 * Creates database.html, examples.html, and obsolete.html. |
| 3 */ |
| 4 |
| 1 #library("prettyPrint"); | 5 #library("prettyPrint"); |
| 2 | 6 |
| 7 #import("dart:io"); |
| 3 #import("dart:json"); | 8 #import("dart:json"); |
| 4 #import("util.dart"); | 9 #import("util.dart"); |
| 5 | 10 |
| 6 String orEmpty(String str) { | 11 String orEmpty(String str) { |
| 7 return str == null ? "" : str; | 12 return str == null ? "" : str; |
| 8 } | 13 } |
| 9 | 14 |
| 10 List<String> sortStringCollection(Collection<String> collection) { | 15 List<String> sortStringCollection(Collection<String> collection) { |
| 11 final out = <String>[]; | 16 final out = <String>[]; |
| 12 out.addAll(collection); | 17 out.addAll(collection); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 39 } | 44 } |
| 40 | 45 |
| 41 addMissingHelper('properties'); | 46 addMissingHelper('properties'); |
| 42 addMissingHelper('methods'); | 47 addMissingHelper('methods'); |
| 43 addMissingHelper('constants'); | 48 addMissingHelper('constants'); |
| 44 return total; | 49 return total; |
| 45 } | 50 } |
| 46 | 51 |
| 47 void main() { | 52 void main() { |
| 48 // Database of code documentation. | 53 // Database of code documentation. |
| 49 final Map<String, Map> database = JSON.parse(fs.readFileSync( | 54 final Map<String, Map> database = JSON.parse( |
| 50 » 'output/database.filtered.json', 'utf8')); | 55 new File('output/database.filtered.json').readAsTextSync()); |
| 51 | 56 |
| 52 // Types we have documentation for. | 57 // Types we have documentation for. |
| 53 matchedTypes = new Set<String>(); | 58 matchedTypes = new Set<String>(); |
| 54 int numMissingMethods = 0; | 59 int numMissingMethods = 0; |
| 55 int numFoundMethods = 0; | 60 int numFoundMethods = 0; |
| 56 int numExtraMethods = 0; | 61 int numExtraMethods = 0; |
| 57 int numGen = 0; | 62 int numGen = 0; |
| 58 int numSkipped = 0; | 63 int numSkipped = 0; |
| 59 final sbSkipped = new StringBuffer(); | 64 final sbSkipped = new StringBuffer(); |
| 60 final sbAllExamples = new StringBuffer(); | 65 final sbAllExamples = new StringBuffer(); |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 <ul> | 330 <ul> |
| 326 $sbSkipped | 331 $sbSkipped |
| 327 </ul> | 332 </ul> |
| 328 </div> | 333 </div> |
| 329 """); | 334 """); |
| 330 sb.add(""" | 335 sb.add(""" |
| 331 </body> | 336 </body> |
| 332 </html> | 337 </html> |
| 333 """); | 338 """); |
| 334 | 339 |
| 335 fs.writeFileSync("output/database.html", sb.toString()); | 340 writeFileSync("output/database.html", sb.toString()); |
| 336 | 341 |
| 337 fs.writeFileSync("output/examples.html", """ | 342 writeFileSync("output/examples.html", """ |
| 338 <html> | 343 <html> |
| 339 <head> | 344 <head> |
| 340 <style type="text/css"> | 345 <style type="text/css"> |
| 341 body { | 346 body { |
| 342 background-color: #eee; | 347 background-color: #eee; |
| 343 margin: 10px; | 348 margin: 10px; |
| 344 font: 14px/1.428 "Lucida Grande", "Lucida Sans Unicode", Lucida, Arial, | 349 font: 14px/1.428 "Lucida Grande", "Lucida Sans Unicode", Lucida, Arial, |
| 345 Helvetica, sans-serif; | 350 Helvetica, sans-serif; |
| 346 } | 351 } |
| 347 | 352 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 369 </style> | 374 </style> |
| 370 <title>All examples</title> | 375 <title>All examples</title> |
| 371 </head> | 376 </head> |
| 372 <body> | 377 <body> |
| 373 <h1>All examples</h1> | 378 <h1>All examples</h1> |
| 374 $sbAllExamples | 379 $sbAllExamples |
| 375 </body> | 380 </body> |
| 376 </html> | 381 </html> |
| 377 """); | 382 """); |
| 378 | 383 |
| 379 fs.writeFileSync("output/obsolete.html", """ | 384 writeFileSync("output/obsolete.html", """ |
| 380 <html> | 385 <html> |
| 381 <head> | 386 <head> |
| 382 <style type="text/css"> | 387 <style type="text/css"> |
| 383 body { | 388 body { |
| 384 background-color: #eee; | 389 background-color: #eee; |
| 385 margin: 10px; | 390 margin: 10px; |
| 386 font: 14px/1.428 "Lucida Grande", "Lucida Sans Unicode", Lucida, | 391 font: 14px/1.428 "Lucida Grande", "Lucida Sans Unicode", Lucida, |
| 387 Arial, Helvetica, sans-serif; | 392 Arial, Helvetica, sans-serif; |
| 388 } | 393 } |
| 389 | 394 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 415 <th>Description</th> | 420 <th>Description</th> |
| 416 <th>IDL</th> | 421 <th>IDL</th> |
| 417 <th>Status</th> | 422 <th>Status</th> |
| 418 </tr> | 423 </tr> |
| 419 $sbObsolete | 424 $sbObsolete |
| 420 </tbody> | 425 </tbody> |
| 421 </table> | 426 </table> |
| 422 </body> | 427 </body> |
| 423 </html> | 428 </html> |
| 424 """); | 429 """); |
| 425 } | 430 } |
| OLD | NEW |