| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 1 library docgen.mdn; | 5 library docgen.mdn; |
| 2 | 6 |
| 3 import 'dart:convert'; | 7 import 'dart:convert'; |
| 4 import 'dart:io'; | 8 import 'dart:io'; |
| 5 | 9 |
| 6 import 'package:logging/logging.dart'; | 10 import 'package:logging/logging.dart'; |
| 7 import 'package:path/path.dart' as p; | 11 import 'package:path/path.dart' as p; |
| 8 | 12 |
| 9 // TODO(janicejl): Make MDN content generic or pluggable. | 13 // TODO(janicejl): Make MDN content generic or pluggable. |
| 10 | 14 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 if (mdnType['summary'] == null || mdnType['summary'] == "") return ''; | 56 if (mdnType['summary'] == null || mdnType['summary'] == "") return ''; |
| 53 if (mdnType['srcUrl'] == null) return ''; | 57 if (mdnType['srcUrl'] == null) return ''; |
| 54 return _htmlifyMdn(mdnType['summary'], mdnType['srcUrl']); | 58 return _htmlifyMdn(mdnType['summary'], mdnType['srcUrl']); |
| 55 } | 59 } |
| 56 | 60 |
| 57 /// Encloses the given content in an MDN div and the original source link. | 61 /// Encloses the given content in an MDN div and the original source link. |
| 58 String _htmlifyMdn(String content, String url) { | 62 String _htmlifyMdn(String content, String url) { |
| 59 return '<div class="mdn">' + content.trim() + '<p class="mdn-note">' | 63 return '<div class="mdn">' + content.trim() + '<p class="mdn-note">' |
| 60 '<a href="' + url.trim() + '">from Mdn</a></p></div>'; | 64 '<a href="' + url.trim() + '">from Mdn</a></p></div>'; |
| 61 } | 65 } |
| OLD | NEW |