OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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 /** | 5 /** |
6 * This application displays documentation generated by the docgen tool | 6 * This application displays documentation generated by the docgen tool |
7 * found at dart-repo/dart/pkg/docgen. | 7 * found at dart-repo/dart/pkg/docgen. |
8 * | 8 * |
9 * The Yaml file outputted by the docgen tool will be read in to | 9 * The Yaml file outputted by the docgen tool will be read in to |
10 * generate [Page] and [Category] and [CompositeContainer]. | 10 * generate [Page] and [Category] and [CompositeContainer]. |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 // If we can't find the name in the pageIndex, look through the home | 230 // If we can't find the name in the pageIndex, look through the home |
231 // to see if we can find it there, searching by displayed name. Mostly | 231 // to see if we can find it there, searching by displayed name. Mostly |
232 // important to find things like dart:html, which is really dart-dom-html | 232 // important to find things like dart:html, which is really dart-dom-html |
233 if (lib == null) { | 233 if (lib == null) { |
234 lib = viewer.homePage.memberNamed(location.libraryName); | 234 lib = viewer.homePage.memberNamed(location.libraryName); |
235 } | 235 } |
236 if (lib == null) return new Future.value(false); | 236 if (lib == null) return new Future.value(false); |
237 return lib.load(); | 237 return lib.load(); |
238 } | 238 } |
239 | 239 |
240 Future<List<Item>> getMember(Library lib, DocsLocation location) { | 240 Future<List<Item>> getMember(lib, DocsLocation location) { |
241 var member = lib.memberNamed(location.memberName); | 241 var member = lib.memberNamed(location.memberName); |
242 if (member == null) return new Future.value([lib, null]); | 242 if (member == null) return new Future.value([lib, null]); |
243 return member.load().then((mem) => new Future.value([lib, member])); | 243 return member.load().then((mem) => new Future.value([lib, member])); |
244 } | 244 } |
245 | 245 |
246 Future<List<Item>> getSubMember(List libWithMember, DocsLocation location) { | 246 Future<List<Item>> getSubMember(List libWithMember, DocsLocation location) { |
247 if (libWithMember.last == null) { | 247 if (libWithMember.last == null) { |
248 return new Future.value([libWithMember.first]); | 248 return new Future.value([libWithMember.first]); |
249 } | 249 } |
250 return new Future.value(concat(libWithMember, | 250 return new Future.value(concat(libWithMember, |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 viewer.currentPage = viewer.homePage; | 338 viewer.currentPage = viewer.homePage; |
339 } | 339 } |
340 retrieveFileContents('../../docs/index.json').then((String json) { | 340 retrieveFileContents('../../docs/index.json').then((String json) { |
341 index = JSON.decode(json); | 341 index = JSON.decode(json); |
342 }); | 342 }); |
343 }); | 343 }); |
344 } | 344 } |
345 | 345 |
346 Iterable concat(Iterable list1, Iterable list2) => | 346 Iterable concat(Iterable list1, Iterable list2) => |
347 [list1, list2].expand((x) => x); | 347 [list1, list2].expand((x) => x); |
OLD | NEW |