Skip to content

Commit 365bfb0

Browse files
committed
Merge branch 'master' of github.com:dart-lang/dartdoc into sl-version-in-comments
2 parents c4c59ae + 3ab24d8 commit 365bfb0

File tree

8 files changed

+23
-18
lines changed

8 files changed

+23
-18
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
language: dart
22
sudo: false
3-
dart:
3+
dart:
44
- dev
5-
- stable
5+
# - stable
66
env:
77
- GEN_SDK_DOCS=true
88
- GEN_SDK_DOCS=false

lib/dartdoc.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class DartDoc {
159159
if (name.startsWith(Platform.pathSeparator)) name = name.substring(1);
160160
}
161161
print('parsing ${name}...');
162-
Source source = new FileBasedSource.con1(new JavaFile(filePath));
162+
Source source = new FileBasedSource(new JavaFile(filePath));
163163
sources.add(source);
164164
if (context.computeKindOf(source) == SourceKind.LIBRARY) {
165165
LibraryElement library = context.computeLibraryElement(source);

lib/resource_loader.dart

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
// TODO: Consider making this a stand-alone package, if useful.
6-
75
/// Make it possible to load resources, independent of how the Dart app is run.
86
///
97
/// Future<String> getTemplateFile(String templatePath) {
@@ -24,20 +22,27 @@ import 'package:pub_cache/pub_cache.dart';
2422
String packageRootPath;
2523

2624
/// Loads a `package:` resource as a String.
27-
Future<String> loadAsString(String path) async {
25+
Future<String> loadAsString(String path) {
2826
if (!path.startsWith('package:')) {
2927
throw new ArgumentError('path must begin with package:');
3028
}
31-
Uint8List bytes = await _doLoad(path);
32-
return new String.fromCharCodes(bytes);
29+
return new Resource(path).readAsString().catchError((_) async {
30+
// TODO: Remove once https://github.com/dart-lang/pub/issues/22 is fixed.
31+
var bytes = await _doLoad(path);
32+
return new String.fromCharCodes(bytes);
33+
});
3334
}
3435

35-
/// Loads a `package:` resource as an [Uint8List].
36-
Future<Uint8List> loadAsBytes(String path) {
36+
/// Loads a `package:` resource as an [List<int>].
37+
Future<List<int>> loadAsBytes(String path) {
3738
if (!path.startsWith('package:')) {
3839
throw new ArgumentError('path must begin with package:');
3940
}
40-
return _doLoad(path);
41+
42+
return new Resource(path).readAsBytes().catchError((_) {
43+
// TODO: Remove once https://github.com/dart-lang/pub/issues/22 is fixed.
44+
return _doLoad(path);
45+
});
4146
}
4247

4348
/// Determine how to do the load. HTTP? Snapshotted? From source?

lib/resources/styles.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ footer .container-fluid {
324324
}
325325

326326
.gt-separated li:before {
327-
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><path fill='#FFFFFF' d='M6.7,4L5.7,4.9L8.8,8l-3.1,3.1L6.7,12l4-4L6.7,4z'/></svg>");
327+
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><path fill='#DDDDDD' d='M6.7,4L5.7,4.9L8.8,8l-3.1,3.1L6.7,12l4-4L6.7,4z'/></svg>");
328328
background-position: center;
329329
content: "\00a0";
330330
margin: 0 6px 0 4px;
@@ -504,7 +504,8 @@ span.top-level-variable-type {
504504
}
505505

506506
.sidebar ol li.section-title {
507-
font-size: 12px;
507+
font-size: 13px;
508+
color: #B6B6B6;
508509
text-transform: uppercase;
509510
line-height: 20px;
510511
margin-top: 24px;

lib/src/model.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import 'package:analyzer/src/generated/resolver.dart';
1111
import 'package:analyzer/src/generated/utilities_dart.dart' show ParameterKind;
1212
import 'package:quiver/core.dart';
1313

14-
import 'debug.dart';
1514
import 'html_utils.dart';
1615
import 'model_utils.dart';
1716
import 'package_meta.dart';

lib/templates/_property.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<dt id="{{htmlId}}" class="property">
2-
<span class="top-level-variable-type">{{{ linkedReturnType }}}</span>
32
{{#isInherited}}{{>name_summary}}{{/isInherited}}{{^isInherited}}{{{linkedName}}}{{/isInherited}}
3+
<span class="signature">&#8594; {{{ linkedReturnType }}}</span>
44
</dt>
55
<dd>
66
{{>readable_writable}}

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ author: Dart Team <[email protected]>
55
description: A documentation generator for Dart.
66
homepage: https://github.com/dart-lang/dartdoc
77
environment:
8-
sdk: '>=1.9.0 <2.0.0' # when we go to 1.12, bump analyzer version
8+
sdk: '>=1.12.0-dev.5.0 <2.0.0'
99
dependencies:
10-
analyzer: '>=0.25.0 <0.27.0'
10+
analyzer: '>=0.26.0 <0.27.0'
1111
args: ^0.13.0
1212
cli_util: ^0.0.1
1313
html: ^0.12.1

test/test_utils.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class AnalyzerHelper {
6565
}
6666

6767
Source addSource(String filePath) {
68-
Source source = new FileBasedSource.con1(new JavaFile(filePath));
68+
Source source = new FileBasedSource(new JavaFile(filePath));
6969
ChangeSet changeSet = new ChangeSet();
7070
changeSet.addedSource(source);
7171
context.applyChanges(changeSet);

0 commit comments

Comments
 (0)