| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library docgen.models.library; | 5 library docgen.models.library; |
| 6 | 6 |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 | 8 |
| 9 import 'package:markdown/markdown.dart' as markdown; | 9 import 'package:markdown/markdown.dart' as markdown; |
| 10 | 10 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 135 |
| 136 String get packagePrefix => packageName == null || packageName.isEmpty ? | 136 String get packagePrefix => packageName == null || packageName.isEmpty ? |
| 137 '' : '$packageName/'; | 137 '' : '$packageName/'; |
| 138 | 138 |
| 139 Map get previewMap { | 139 Map get previewMap { |
| 140 var map = {'packageName': packageName}; | 140 var map = {'packageName': packageName}; |
| 141 map.addAll(super.previewMap); | 141 map.addAll(super.previewMap); |
| 142 if (packageIntro != null) { | 142 if (packageIntro != null) { |
| 143 map['packageIntro'] = packageIntro; | 143 map['packageIntro'] = packageIntro; |
| 144 } | 144 } |
| 145 var version = packageVersion(mirror); | |
| 146 if (version != '' && version != null) map['version'] = version; | |
| 147 return map; | 145 return map; |
| 148 } | 146 } |
| 149 | 147 |
| 150 String get name => docName; | 148 String get name => docName; |
| 151 | 149 |
| 152 String get docName => getLibraryDocName(mirror); | 150 String get docName => getLibraryDocName(mirror); |
| 153 | 151 |
| 154 /// Generates a map describing the [Library] object. | 152 /// Generates a map describing the [Library] object. |
| 155 Map toMap() => { | 153 Map toMap() => { |
| 156 'name': name, | 154 'name': name, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 183 bool get isPrivate => false; | 181 bool get isPrivate => false; |
| 184 | 182 |
| 185 Indexable get owner => null; | 183 Indexable get owner => null; |
| 186 | 184 |
| 187 // This is a known incomplete implementation of Indexable | 185 // This is a known incomplete implementation of Indexable |
| 188 // overriding noSuchMethod to remove static warnings | 186 // overriding noSuchMethod to remove static warnings |
| 189 noSuchMethod(Invocation invocation) { | 187 noSuchMethod(Invocation invocation) { |
| 190 throw new UnimplementedError(invocation.memberName.toString()); | 188 throw new UnimplementedError(invocation.memberName.toString()); |
| 191 } | 189 } |
| 192 } | 190 } |
| OLD | NEW |