From d3e4237bfdde69c3dd805c28b1bc396885c7af9b Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Wed, 20 Jul 2016 12:32:04 -0700 Subject: [PATCH 1/2] fix an issue w/ references in dartdoc not being hyperlinked --- lib/src/markdown_processor.dart | 9 +++------ pubspec.lock | 2 +- pubspec.yaml | 2 +- testing/test_package/lib/example.dart | 6 ++++++ .../code_in_comments/code_in_comments-library.html | 4 ++-- testing/test_package_docs/ex/Apple-class.html | 2 +- testing/test_package_docs/ex/Apple/m1.html | 2 +- testing/test_package_docs/ex/B-class.html | 2 +- testing/test_package_docs/ex/B/m1.html | 2 +- testing/test_package_docs/ex/ShapeType-class.html | 7 +++++++ .../ex/SpecializedDuration/toString.html | 2 +- testing/test_package_docs/ex/ex-library.html | 4 ++-- testing/test_package_docs/fake/ConstantClass-class.html | 2 +- .../test_package_docs/fake/ExtraSpecialList/asMap.html | 2 +- .../test_package_docs/fake/ExtraSpecialList/fold.html | 4 ++-- .../fake/ExtraSpecialList/getRange.html | 2 +- .../test_package_docs/fake/ExtraSpecialList/indexOf.html | 4 ++-- .../test_package_docs/fake/ExtraSpecialList/reduce.html | 4 ++-- .../test_package_docs/fake/ExtraSpecialList/remove.html | 4 ++-- .../fake/ExtraSpecialList/removeWhere.html | 2 +- .../fake/ExtraSpecialList/replaceRange.html | 2 +- .../fake/ExtraSpecialList/retainWhere.html | 2 +- .../test_package_docs/fake/ExtraSpecialList/setAll.html | 2 +- .../fake/ExtraSpecialList/setRange.html | 2 +- .../test_package_docs/fake/ExtraSpecialList/sort.html | 6 +++--- .../test_package_docs/fake/ExtraSpecialList/sublist.html | 4 ++-- testing/test_package_docs/fake/SpecialList/asMap.html | 2 +- testing/test_package_docs/fake/SpecialList/fold.html | 4 ++-- testing/test_package_docs/fake/SpecialList/getRange.html | 2 +- testing/test_package_docs/fake/SpecialList/indexOf.html | 4 ++-- testing/test_package_docs/fake/SpecialList/reduce.html | 4 ++-- testing/test_package_docs/fake/SpecialList/remove.html | 4 ++-- .../test_package_docs/fake/SpecialList/removeWhere.html | 2 +- .../test_package_docs/fake/SpecialList/replaceRange.html | 2 +- .../test_package_docs/fake/SpecialList/retainWhere.html | 2 +- testing/test_package_docs/fake/SpecialList/setAll.html | 2 +- testing/test_package_docs/fake/SpecialList/setRange.html | 2 +- testing/test_package_docs/fake/SpecialList/sort.html | 6 +++--- testing/test_package_docs/fake/SpecialList/sublist.html | 4 ++-- testing/test_package_docs/fake/fake-library.html | 2 +- testing/test_package_docs/fake/topLevelFunction.html | 4 ++-- testing/test_package_docs/index.html | 8 ++++---- 42 files changed, 75 insertions(+), 65 deletions(-) diff --git a/lib/src/markdown_processor.dart b/lib/src/markdown_processor.dart index 3101d8c982..9b609c3cb3 100644 --- a/lib/src/markdown_processor.dart +++ b/lib/src/markdown_processor.dart @@ -192,13 +192,10 @@ class Documentation { // See https://github.com/dart-lang/markdown/commit/a7bf3dd e.classes.add('prettyprint'); - // only "assume" the user intended dart if there are no other classes - // present - // TODO(kevmoo): This should be `language-dart`. - // Waiting on pkg/markdown v0.10 - // See https://github.com/dart-lang/markdown/commit/a7bf3dd + // Only "assume" the user intended dart if there are no other classes + // present. if (e.classes.length == 1) { - e.classes.add('lang-dart'); + e.classes.add('language-dart'); } } var asHtml = asHtmlDocument.body.innerHtml; diff --git a/pubspec.lock b/pubspec.lock index 418644de01..68d579b8db 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -120,7 +120,7 @@ packages: name: markdown url: "https://pub.dartlang.org" source: hosted - version: "0.8.0" + version: "0.10.1" matcher: description: name: matcher diff --git a/pubspec.yaml b/pubspec.yaml index 5b49aa5148..9fbceea54a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -13,7 +13,7 @@ dependencies: collection: ^1.2.0 html: ^0.12.1 logging: '>=0.9.0 <0.12.0' - markdown: ^0.8.0 + markdown: ^0.10.1 mustache4dart: ^1.0.9 path: ^1.3.0 quiver: '>=0.18.0 <0.23.0' diff --git a/testing/test_package/lib/example.dart b/testing/test_package/lib/example.dart index e0b29c453e..693ec83d4d 100644 --- a/testing/test_package/lib/example.dart +++ b/testing/test_package/lib/example.dart @@ -261,6 +261,12 @@ class PublicClassImplementsPrivateInterface implements _PrivateInterface { void test() {} } +/// [Object] foo bar +/// +/// 3. All references should be hyperlinks. [Object] [MyError] [ShapeType] +/// [MyError] [MyException] +/// [MyError] [MyException] [Object] +/// [ShapeType] foo bar class ShapeType extends _RetainedEnum { static const ShapeType rect = const ShapeType._internal("Rect"); static const ShapeType ellipse = const ShapeType._internal("Ellipse"); diff --git a/testing/test_package_docs/code_in_comments/code_in_comments-library.html b/testing/test_package_docs/code_in_comments/code_in_comments-library.html index 9bfe81e069..c59b84bea3 100644 --- a/testing/test_package_docs/code_in_comments/code_in_comments-library.html +++ b/testing/test_package_docs/code_in_comments/code_in_comments-library.html @@ -83,11 +83,11 @@
test_package
-
void main() {
+      
void main() {
   // in Dart!
 }
 
-
and_yaml:
+
and_yaml:
   - value
   - "value"
   - 3.14
diff --git a/testing/test_package_docs/ex/Apple-class.html b/testing/test_package_docs/ex/Apple-class.html
index e8a2cd7ea8..342da5ed13 100644
--- a/testing/test_package_docs/ex/Apple-class.html
+++ b/testing/test_package_docs/ex/Apple-class.html
@@ -136,7 +136,7 @@ 
ex
-

Sample class String

  A
+      

Sample class String

  A
    B
 
diff --git a/testing/test_package_docs/ex/Apple/m1.html b/testing/test_package_docs/ex/Apple/m1.html index ab7a815420..63809e1d88 100644 --- a/testing/test_package_docs/ex/Apple/m1.html +++ b/testing/test_package_docs/ex/Apple/m1.html @@ -115,7 +115,7 @@
Apple

This is a method.

-
new Apple().m1();
+
new Apple().m1();
 
diff --git a/testing/test_package_docs/ex/B-class.html b/testing/test_package_docs/ex/B-class.html index 38065e8e10..0e84327496 100644 --- a/testing/test_package_docs/ex/B-class.html +++ b/testing/test_package_docs/ex/B-class.html @@ -134,7 +134,7 @@
ex
-

Extends class Apple, use new Apple or new Apple.fromString

 B extends A
+      

Extends class Apple, use new Apple or new Apple.fromString

 B extends A
  B implements C
  
diff --git a/testing/test_package_docs/ex/B/m1.html b/testing/test_package_docs/ex/B/m1.html index 34113e3850..062805cf81 100644 --- a/testing/test_package_docs/ex/B/m1.html +++ b/testing/test_package_docs/ex/B/m1.html @@ -120,7 +120,7 @@
B

This is a method.

-
new Apple().m1();
+
new Apple().m1();
 
diff --git a/testing/test_package_docs/ex/ShapeType-class.html b/testing/test_package_docs/ex/ShapeType-class.html index c7cc5fb09a..b408e278b0 100644 --- a/testing/test_package_docs/ex/ShapeType-class.html +++ b/testing/test_package_docs/ex/ShapeType-class.html @@ -131,6 +131,13 @@
ex
+
+

Object foo bar

  1. +

    All references should be hyperlinks. Object MyError ShapeType + MyError MyException + MyError MyException Object + ShapeType foo bar

+
diff --git a/testing/test_package_docs/ex/SpecializedDuration/toString.html b/testing/test_package_docs/ex/SpecializedDuration/toString.html index 294a76e841..d6ca0d911b 100644 --- a/testing/test_package_docs/ex/SpecializedDuration/toString.html +++ b/testing/test_package_docs/ex/SpecializedDuration/toString.html @@ -122,7 +122,7 @@
SpecializedDuration

Returns a string representation of this Duration.

Returns a string with hours, minutes, seconds, and microseconds, in the following format: HH:MM:SS.mmmmmm. For example,

-
var d = new Duration(days:1, hours:1, minutes:33, microseconds: 500);
+
var d = new Duration(days:1, hours:1, minutes:33, microseconds: 500);
 d.toString();  // "25:33:00.000500"
 
diff --git a/testing/test_package_docs/ex/ex-library.html b/testing/test_package_docs/ex/ex-library.html index 060bfe8821..d9b811ed70 100644 --- a/testing/test_package_docs/ex/ex-library.html +++ b/testing/test_package_docs/ex/ex-library.html @@ -92,7 +92,7 @@
test_package
-

a library. testing string escaping: var s = 'a string' <cool>

+

a library. testing string escaping: var s = 'a string'

@@ -397,7 +397,7 @@

Classes

ShapeType
-

+

Object foo bar

SpecializedDuration diff --git a/testing/test_package_docs/fake/ConstantClass-class.html b/testing/test_package_docs/fake/ConstantClass-class.html index 18932542a0..80d801b98a 100644 --- a/testing/test_package_docs/fake/ConstantClass-class.html +++ b/testing/test_package_docs/fake/ConstantClass-class.html @@ -147,7 +147,7 @@
fake

Make one of these neato classes like this:

var constant = const ConstantClass('neat')

This is a code block

-
var x = 'hello';
+
var x = 'hello';
 print(x);
 
diff --git a/testing/test_package_docs/fake/ExtraSpecialList/asMap.html b/testing/test_package_docs/fake/ExtraSpecialList/asMap.html index 769e3afd9e..6d52a02cc0 100644 --- a/testing/test_package_docs/fake/ExtraSpecialList/asMap.html +++ b/testing/test_package_docs/fake/ExtraSpecialList/asMap.html @@ -157,7 +157,7 @@
ExtraSpecialList

The map uses the indices of this list as keys and the corresponding objects as values. The Map.keys Iterable iterates the indices of this list in numerical order.

-
List<String> words = ['fee', 'fi', 'fo', 'fum'];
+
List<String> words = ['fee', 'fi', 'fo', 'fum'];
 Map<int, String> map = words.asMap();
 map[0] + map[1];   // 'feefi';
 map.keys.toList(); // [0, 1, 2, 3]
diff --git a/testing/test_package_docs/fake/ExtraSpecialList/fold.html b/testing/test_package_docs/fake/ExtraSpecialList/fold.html
index 9684c207ac..1a211b2235 100644
--- a/testing/test_package_docs/fake/ExtraSpecialList/fold.html
+++ b/testing/test_package_docs/fake/ExtraSpecialList/fold.html
@@ -158,14 +158,14 @@ 
ExtraSpecialList

Uses initialValue as the initial value, then iterates through the elements and updates the value with each element using the combine function, as if by:

-
var value = initialValue;
+
var value = initialValue;
 for (E element in this) {
   value = combine(value, element);
 }
 return value;
 

Example of calculating the sum of an iterable:

-
iterable.fold(0, (prev, element) => prev + element);
+
iterable.fold(0, (prev, element) => prev + element);
 
diff --git a/testing/test_package_docs/fake/ExtraSpecialList/getRange.html b/testing/test_package_docs/fake/ExtraSpecialList/getRange.html index 8d736d2156..03dbb525de 100644 --- a/testing/test_package_docs/fake/ExtraSpecialList/getRange.html +++ b/testing/test_package_docs/fake/ExtraSpecialList/getRange.html @@ -160,7 +160,7 @@
ExtraSpecialList
of the call to this method. The returned Iterable behaves like skip(start).take(end - start). That is, it does not throw exceptions if this changes size.

-
List<String> colors = ['red', 'green', 'blue', 'orange', 'pink'];
+
List<String> colors = ['red', 'green', 'blue', 'orange', 'pink'];
 Iterable<String> range = colors.getRange(1, 4);
 range.join(', ');  // 'green, blue, orange'
 colors.length = 3;
diff --git a/testing/test_package_docs/fake/ExtraSpecialList/indexOf.html b/testing/test_package_docs/fake/ExtraSpecialList/indexOf.html
index a2531ca5b4..21c02a10d9 100644
--- a/testing/test_package_docs/fake/ExtraSpecialList/indexOf.html
+++ b/testing/test_package_docs/fake/ExtraSpecialList/indexOf.html
@@ -157,12 +157,12 @@ 
ExtraSpecialList

Searches the list from index start to the end of the list. The first time an object o is encountered so that o == element, the index of o is returned.

-
List<String> notes = ['do', 're', 'mi', 're'];
+
List<String> notes = ['do', 're', 'mi', 're'];
 notes.indexOf('re');    // 1
 notes.indexOf('re', 2); // 3
 

Returns -1 if element is not found.

-
notes.indexOf('fa');    // -1
+
notes.indexOf('fa');    // -1
 
diff --git a/testing/test_package_docs/fake/ExtraSpecialList/reduce.html b/testing/test_package_docs/fake/ExtraSpecialList/reduce.html index 157d21168f..d7a75b4bbb 100644 --- a/testing/test_package_docs/fake/ExtraSpecialList/reduce.html +++ b/testing/test_package_docs/fake/ExtraSpecialList/reduce.html @@ -160,14 +160,14 @@
ExtraSpecialList

Otherwise this method starts with the first element from the iterator, and then combines it with the remaining elements in iteration order, as if by:

-
E value = iterable.first;
+
E value = iterable.first;
 iterable.skip(1).forEach((element) {
   value = combine(value, element);
 });
 return value;
 

Example of calculating the sum of an iterable:

-
iterable.reduce((value, element) => value + element);
+
iterable.reduce((value, element) => value + element);
 
diff --git a/testing/test_package_docs/fake/ExtraSpecialList/remove.html b/testing/test_package_docs/fake/ExtraSpecialList/remove.html index 0d3c06664a..033ff3868d 100644 --- a/testing/test_package_docs/fake/ExtraSpecialList/remove.html +++ b/testing/test_package_docs/fake/ExtraSpecialList/remove.html @@ -155,12 +155,12 @@
ExtraSpecialList

Removes the first occurence of value from this list.

Returns true if value was in the list, false otherwise.

-
List<String> parts = ['head', 'shoulders', 'knees', 'toes'];
+
List<String> parts = ['head', 'shoulders', 'knees', 'toes'];
 parts.remove('head'); // true
 parts.join(', ');     // 'shoulders, knees, toes'
 

The method has no effect if value was not in the list.

-
// Note: 'head' has already been removed.
+
// Note: 'head' has already been removed.
 parts.remove('head'); // false
 parts.join(', ');     // 'shoulders, knees, toes'
 
diff --git a/testing/test_package_docs/fake/ExtraSpecialList/removeWhere.html b/testing/test_package_docs/fake/ExtraSpecialList/removeWhere.html index 58cc06d94a..0b0535f01f 100644 --- a/testing/test_package_docs/fake/ExtraSpecialList/removeWhere.html +++ b/testing/test_package_docs/fake/ExtraSpecialList/removeWhere.html @@ -155,7 +155,7 @@
ExtraSpecialList

Removes all objects from this list that satisfy test.

An object o satisfies test if test(o) is true.

-
List<String> numbers = ['one', 'two', 'three', 'four'];
+
List<String> numbers = ['one', 'two', 'three', 'four'];
 numbers.removeWhere((item) => item.length == 3);
 numbers.join(', '); // 'three, four'
 
diff --git a/testing/test_package_docs/fake/ExtraSpecialList/replaceRange.html b/testing/test_package_docs/fake/ExtraSpecialList/replaceRange.html index caa59c9fcd..96730bb66b 100644 --- a/testing/test_package_docs/fake/ExtraSpecialList/replaceRange.html +++ b/testing/test_package_docs/fake/ExtraSpecialList/replaceRange.html @@ -155,7 +155,7 @@
ExtraSpecialList

Removes the objects in the range start inclusive to end exclusive and inserts the contents of replacement in its place.

-
List<int> list = [1, 2, 3, 4, 5];
+
List<int> list = [1, 2, 3, 4, 5];
 list.replaceRange(1, 4, [6, 7]);
 list.join(', '); // '1, 6, 7, 5'
 
diff --git a/testing/test_package_docs/fake/ExtraSpecialList/retainWhere.html b/testing/test_package_docs/fake/ExtraSpecialList/retainWhere.html index 1c9cb5eba0..d93f0aed37 100644 --- a/testing/test_package_docs/fake/ExtraSpecialList/retainWhere.html +++ b/testing/test_package_docs/fake/ExtraSpecialList/retainWhere.html @@ -155,7 +155,7 @@
ExtraSpecialList

Removes all objects from this list that fail to satisfy test.

An object o satisfies test if test(o) is true.

-
List<String> numbers = ['one', 'two', 'three', 'four'];
+
List<String> numbers = ['one', 'two', 'three', 'four'];
 numbers.retainWhere((item) => item.length == 3);
 numbers.join(', '); // 'one, two'
 
diff --git a/testing/test_package_docs/fake/ExtraSpecialList/setAll.html b/testing/test_package_docs/fake/ExtraSpecialList/setAll.html index 8030b76e20..a44a2434ab 100644 --- a/testing/test_package_docs/fake/ExtraSpecialList/setAll.html +++ b/testing/test_package_docs/fake/ExtraSpecialList/setAll.html @@ -155,7 +155,7 @@
ExtraSpecialList

Overwrites objects of this with the objects of iterable, starting at position index in this list.

-
List<String> list = ['a', 'b', 'c'];
+
List<String> list = ['a', 'b', 'c'];
 list.setAll(1, ['bee', 'sea']);
 list.join(', '); // 'a, bee, sea'
 
diff --git a/testing/test_package_docs/fake/ExtraSpecialList/setRange.html b/testing/test_package_docs/fake/ExtraSpecialList/setRange.html index fd5a066609..543e0684db 100644 --- a/testing/test_package_docs/fake/ExtraSpecialList/setRange.html +++ b/testing/test_package_docs/fake/ExtraSpecialList/setRange.html @@ -155,7 +155,7 @@
ExtraSpecialList

Copies the objects of iterable, skipping skipCount objects first, into the range start, inclusive, to end, exclusive, of the list.

-
List<int> list1 = [1, 2, 3, 4];
+
List<int> list1 = [1, 2, 3, 4];
 List<int> list2 = [5, 6, 7, 8, 9];
 // Copies the 4th and 5th items in list2 as the 2nd and 3rd items
 // of list1.
diff --git a/testing/test_package_docs/fake/ExtraSpecialList/sort.html b/testing/test_package_docs/fake/ExtraSpecialList/sort.html
index acdb357be3..125ef7fdc2 100644
--- a/testing/test_package_docs/fake/ExtraSpecialList/sort.html
+++ b/testing/test_package_docs/fake/ExtraSpecialList/sort.html
@@ -155,14 +155,14 @@ 
ExtraSpecialList

Sorts this list according to the order specified by the compare function.

The compare function must act as a Comparator.

-
List<String> numbers = ['two', 'three', 'four'];
+
List<String> numbers = ['two', 'three', 'four'];
 // Sort from shortest to longest.
 numbers.sort((a, b) => a.length.compareTo(b.length));
 print(numbers);  // [two, four, three]
 

The default List implementations use Comparable.compare if compare is omitted.

-
List<int> nums = [13, 2, -11];
+
List<int> nums = [13, 2, -11];
 nums.sort();
 print(nums);  // [-11, 2, 13]
 
@@ -170,7 +170,7 @@
ExtraSpecialList
are distinct objects. The sort function is not guaranteed to be stable, so distinct objects that compare as equal may occur in any order in the result:

-
List<String> numbers = ['one', 'two', 'three', 'four'];
+
List<String> numbers = ['one', 'two', 'three', 'four'];
 numbers.sort((a, b) => a.length.compareTo(b.length));
 print(numbers);  // [one, two, four, three] OR [two, one, four, three]
 
diff --git a/testing/test_package_docs/fake/ExtraSpecialList/sublist.html b/testing/test_package_docs/fake/ExtraSpecialList/sublist.html index 3ea8f4b1a4..6b78968929 100644 --- a/testing/test_package_docs/fake/ExtraSpecialList/sublist.html +++ b/testing/test_package_docs/fake/ExtraSpecialList/sublist.html @@ -155,11 +155,11 @@
ExtraSpecialList

Returns a new list containing the objects from start inclusive to end exclusive.

-
List<String> colors = ['red', 'green', 'blue', 'orange', 'pink'];
+
List<String> colors = ['red', 'green', 'blue', 'orange', 'pink'];
 colors.sublist(1, 3); // ['green', 'blue']
 

If end is omitted, the length of this is used.

-
colors.sublist(1);  // ['green', 'blue', 'orange', 'pink']
+
colors.sublist(1);  // ['green', 'blue', 'orange', 'pink']
 

An error occurs if start is outside the range 0 .. length or if end is outside the range start .. length.

diff --git a/testing/test_package_docs/fake/SpecialList/asMap.html b/testing/test_package_docs/fake/SpecialList/asMap.html index 438068a4b0..0ce454c366 100644 --- a/testing/test_package_docs/fake/SpecialList/asMap.html +++ b/testing/test_package_docs/fake/SpecialList/asMap.html @@ -157,7 +157,7 @@
SpecialList

The map uses the indices of this list as keys and the corresponding objects as values. The Map.keys Iterable iterates the indices of this list in numerical order.

-
List<String> words = ['fee', 'fi', 'fo', 'fum'];
+
List<String> words = ['fee', 'fi', 'fo', 'fum'];
 Map<int, String> map = words.asMap();
 map[0] + map[1];   // 'feefi';
 map.keys.toList(); // [0, 1, 2, 3]
diff --git a/testing/test_package_docs/fake/SpecialList/fold.html b/testing/test_package_docs/fake/SpecialList/fold.html
index 2b18de23f4..72d22a6b1c 100644
--- a/testing/test_package_docs/fake/SpecialList/fold.html
+++ b/testing/test_package_docs/fake/SpecialList/fold.html
@@ -158,14 +158,14 @@ 
SpecialList

Uses initialValue as the initial value, then iterates through the elements and updates the value with each element using the combine function, as if by:

-
var value = initialValue;
+
var value = initialValue;
 for (E element in this) {
   value = combine(value, element);
 }
 return value;
 

Example of calculating the sum of an iterable:

-
iterable.fold(0, (prev, element) => prev + element);
+
iterable.fold(0, (prev, element) => prev + element);
 
diff --git a/testing/test_package_docs/fake/SpecialList/getRange.html b/testing/test_package_docs/fake/SpecialList/getRange.html index 456e8fa9a3..d883b11e50 100644 --- a/testing/test_package_docs/fake/SpecialList/getRange.html +++ b/testing/test_package_docs/fake/SpecialList/getRange.html @@ -160,7 +160,7 @@
SpecialList
of the call to this method. The returned Iterable behaves like skip(start).take(end - start). That is, it does not throw exceptions if this changes size.

-
List<String> colors = ['red', 'green', 'blue', 'orange', 'pink'];
+
List<String> colors = ['red', 'green', 'blue', 'orange', 'pink'];
 Iterable<String> range = colors.getRange(1, 4);
 range.join(', ');  // 'green, blue, orange'
 colors.length = 3;
diff --git a/testing/test_package_docs/fake/SpecialList/indexOf.html b/testing/test_package_docs/fake/SpecialList/indexOf.html
index cb033e7148..b6b4a1b98f 100644
--- a/testing/test_package_docs/fake/SpecialList/indexOf.html
+++ b/testing/test_package_docs/fake/SpecialList/indexOf.html
@@ -157,12 +157,12 @@ 
SpecialList

Searches the list from index start to the end of the list. The first time an object o is encountered so that o == element, the index of o is returned.

-
List<String> notes = ['do', 're', 'mi', 're'];
+
List<String> notes = ['do', 're', 'mi', 're'];
 notes.indexOf('re');    // 1
 notes.indexOf('re', 2); // 3
 

Returns -1 if element is not found.

-
notes.indexOf('fa');    // -1
+
notes.indexOf('fa');    // -1
 
diff --git a/testing/test_package_docs/fake/SpecialList/reduce.html b/testing/test_package_docs/fake/SpecialList/reduce.html index 81786059e3..03d38dc8e9 100644 --- a/testing/test_package_docs/fake/SpecialList/reduce.html +++ b/testing/test_package_docs/fake/SpecialList/reduce.html @@ -160,14 +160,14 @@
SpecialList

Otherwise this method starts with the first element from the iterator, and then combines it with the remaining elements in iteration order, as if by:

-
E value = iterable.first;
+
E value = iterable.first;
 iterable.skip(1).forEach((element) {
   value = combine(value, element);
 });
 return value;
 

Example of calculating the sum of an iterable:

-
iterable.reduce((value, element) => value + element);
+
iterable.reduce((value, element) => value + element);
 
diff --git a/testing/test_package_docs/fake/SpecialList/remove.html b/testing/test_package_docs/fake/SpecialList/remove.html index 1f8a2f9f5e..05dfdc9cb0 100644 --- a/testing/test_package_docs/fake/SpecialList/remove.html +++ b/testing/test_package_docs/fake/SpecialList/remove.html @@ -155,12 +155,12 @@
SpecialList

Removes the first occurence of value from this list.

Returns true if value was in the list, false otherwise.

-
List<String> parts = ['head', 'shoulders', 'knees', 'toes'];
+
List<String> parts = ['head', 'shoulders', 'knees', 'toes'];
 parts.remove('head'); // true
 parts.join(', ');     // 'shoulders, knees, toes'
 

The method has no effect if value was not in the list.

-
// Note: 'head' has already been removed.
+
// Note: 'head' has already been removed.
 parts.remove('head'); // false
 parts.join(', ');     // 'shoulders, knees, toes'
 
diff --git a/testing/test_package_docs/fake/SpecialList/removeWhere.html b/testing/test_package_docs/fake/SpecialList/removeWhere.html index e44cab4249..bfe6b9e354 100644 --- a/testing/test_package_docs/fake/SpecialList/removeWhere.html +++ b/testing/test_package_docs/fake/SpecialList/removeWhere.html @@ -155,7 +155,7 @@
SpecialList

Removes all objects from this list that satisfy test.

An object o satisfies test if test(o) is true.

-
List<String> numbers = ['one', 'two', 'three', 'four'];
+
List<String> numbers = ['one', 'two', 'three', 'four'];
 numbers.removeWhere((item) => item.length == 3);
 numbers.join(', '); // 'three, four'
 
diff --git a/testing/test_package_docs/fake/SpecialList/replaceRange.html b/testing/test_package_docs/fake/SpecialList/replaceRange.html index d2efcc1ada..4b5a8cf8e9 100644 --- a/testing/test_package_docs/fake/SpecialList/replaceRange.html +++ b/testing/test_package_docs/fake/SpecialList/replaceRange.html @@ -155,7 +155,7 @@
SpecialList

Removes the objects in the range start inclusive to end exclusive and inserts the contents of replacement in its place.

-
List<int> list = [1, 2, 3, 4, 5];
+
List<int> list = [1, 2, 3, 4, 5];
 list.replaceRange(1, 4, [6, 7]);
 list.join(', '); // '1, 6, 7, 5'
 
diff --git a/testing/test_package_docs/fake/SpecialList/retainWhere.html b/testing/test_package_docs/fake/SpecialList/retainWhere.html index 7b216cb6a2..e522927610 100644 --- a/testing/test_package_docs/fake/SpecialList/retainWhere.html +++ b/testing/test_package_docs/fake/SpecialList/retainWhere.html @@ -155,7 +155,7 @@
SpecialList

Removes all objects from this list that fail to satisfy test.

An object o satisfies test if test(o) is true.

-
List<String> numbers = ['one', 'two', 'three', 'four'];
+
List<String> numbers = ['one', 'two', 'three', 'four'];
 numbers.retainWhere((item) => item.length == 3);
 numbers.join(', '); // 'one, two'
 
diff --git a/testing/test_package_docs/fake/SpecialList/setAll.html b/testing/test_package_docs/fake/SpecialList/setAll.html index f700c09502..1fac0054cc 100644 --- a/testing/test_package_docs/fake/SpecialList/setAll.html +++ b/testing/test_package_docs/fake/SpecialList/setAll.html @@ -155,7 +155,7 @@
SpecialList

Overwrites objects of this with the objects of iterable, starting at position index in this list.

-
List<String> list = ['a', 'b', 'c'];
+
List<String> list = ['a', 'b', 'c'];
 list.setAll(1, ['bee', 'sea']);
 list.join(', '); // 'a, bee, sea'
 
diff --git a/testing/test_package_docs/fake/SpecialList/setRange.html b/testing/test_package_docs/fake/SpecialList/setRange.html index 7c3ab095ea..18d39183f3 100644 --- a/testing/test_package_docs/fake/SpecialList/setRange.html +++ b/testing/test_package_docs/fake/SpecialList/setRange.html @@ -155,7 +155,7 @@
SpecialList

Copies the objects of iterable, skipping skipCount objects first, into the range start, inclusive, to end, exclusive, of the list.

-
List<int> list1 = [1, 2, 3, 4];
+
List<int> list1 = [1, 2, 3, 4];
 List<int> list2 = [5, 6, 7, 8, 9];
 // Copies the 4th and 5th items in list2 as the 2nd and 3rd items
 // of list1.
diff --git a/testing/test_package_docs/fake/SpecialList/sort.html b/testing/test_package_docs/fake/SpecialList/sort.html
index 58ff72df1a..40dd39df9e 100644
--- a/testing/test_package_docs/fake/SpecialList/sort.html
+++ b/testing/test_package_docs/fake/SpecialList/sort.html
@@ -155,14 +155,14 @@ 
SpecialList

Sorts this list according to the order specified by the compare function.

The compare function must act as a Comparator.

-
List<String> numbers = ['two', 'three', 'four'];
+
List<String> numbers = ['two', 'three', 'four'];
 // Sort from shortest to longest.
 numbers.sort((a, b) => a.length.compareTo(b.length));
 print(numbers);  // [two, four, three]
 

The default List implementations use Comparable.compare if compare is omitted.

-
List<int> nums = [13, 2, -11];
+
List<int> nums = [13, 2, -11];
 nums.sort();
 print(nums);  // [-11, 2, 13]
 
@@ -170,7 +170,7 @@
SpecialList
are distinct objects. The sort function is not guaranteed to be stable, so distinct objects that compare as equal may occur in any order in the result:

-
List<String> numbers = ['one', 'two', 'three', 'four'];
+
List<String> numbers = ['one', 'two', 'three', 'four'];
 numbers.sort((a, b) => a.length.compareTo(b.length));
 print(numbers);  // [one, two, four, three] OR [two, one, four, three]
 
diff --git a/testing/test_package_docs/fake/SpecialList/sublist.html b/testing/test_package_docs/fake/SpecialList/sublist.html index ee464c5d46..9d5f682148 100644 --- a/testing/test_package_docs/fake/SpecialList/sublist.html +++ b/testing/test_package_docs/fake/SpecialList/sublist.html @@ -155,11 +155,11 @@
SpecialList

Returns a new list containing the objects from start inclusive to end exclusive.

-
List<String> colors = ['red', 'green', 'blue', 'orange', 'pink'];
+
List<String> colors = ['red', 'green', 'blue', 'orange', 'pink'];
 colors.sublist(1, 3); // ['green', 'blue']
 

If end is omitted, the length of this is used.

-
colors.sublist(1);  // ['green', 'blue', 'orange', 'pink']
+
colors.sublist(1);  // ['green', 'blue', 'orange', 'pink']
 

An error occurs if start is outside the range 0 .. length or if end is outside the range start .. length.

diff --git a/testing/test_package_docs/fake/fake-library.html b/testing/test_package_docs/fake/fake-library.html index 9d5b080113..783d1d8763 100644 --- a/testing/test_package_docs/fake/fake-library.html +++ b/testing/test_package_docs/fake/fake-library.html @@ -107,7 +107,7 @@

I am an h4

I am an h5

hello

Why should you get this package?

  • We told you so.
  • Everyone is doing it.
  • It smells nice.
-
class Foo {
+
class Foo {
   long line is very long long line is very long long line is very long line long line long line
 }
 
diff --git a/testing/test_package_docs/fake/topLevelFunction.html b/testing/test_package_docs/fake/topLevelFunction.html index 4705611b7d..d7a9fb12c4 100644 --- a/testing/test_package_docs/fake/topLevelFunction.html +++ b/testing/test_package_docs/fake/topLevelFunction.html @@ -151,10 +151,10 @@
fake
It has two lines.

The third parameter is a Cool object.

Here is a code snippet:

-
var thing = topLevelFunction(1, true, 3.4);
+
var thing = topLevelFunction(1, true, 3.4);
 

This snippet has brackets in parameters:

-
callMe('alert', ['hello from dart']);
+
callMe('alert', ['hello from dart']);
 

Thanks for using this function!

diff --git a/testing/test_package_docs/index.html b/testing/test_package_docs/index.html index ff34de6955..e0830cfaee 100644 --- a/testing/test_package_docs/index.html +++ b/testing/test_package_docs/index.html @@ -84,11 +84,11 @@

Best Package

This is an amazing package.

For example, it:

  • Is very fast
  • Has zero bugs
  • Is free

It also has some awesome code

-
void main() {
+
void main() {
   // in Dart!
 }
 
-
and_yaml:
+
and_yaml:
   - value
   - "value"
   - 3.14
@@ -116,7 +116,7 @@ 

Libraries

code_in_comments
-

void main() { +

void main() { // in Dart! }

@@ -132,7 +132,7 @@

Libraries

ex
-

a library. testing string escaping: var s = 'a string' <cool>

+

a library. testing string escaping: var s = 'a string'

fake From 690614c1c203ce0da49a7ead43606b6feb1b059f Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Wed, 20 Jul 2016 12:39:17 -0700 Subject: [PATCH 2/2] fix a test --- lib/templates/_source_code.html | 2 +- test/model_test.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/templates/_source_code.html b/lib/templates/_source_code.html index 30106a3f64..831540f9af 100644 --- a/lib/templates/_source_code.html +++ b/lib/templates/_source_code.html @@ -1,5 +1,5 @@ {{#hasSourceCode}}

Source {{{crossdartHtmlTag}}}

-
{{{ sourceCode }}}
+
{{{ sourceCode }}}
{{/hasSourceCode}} diff --git a/test/model_test.dart b/test/model_test.dart index a14d21baec..277773c07c 100644 --- a/test/model_test.dart +++ b/test/model_test.dart @@ -401,7 +401,7 @@ void main() { test('no references', () { expect( Apple.documentationAsHtml, - '

Sample class String

  A\n'
+          '

Sample class String

  A\n'
           '   B\n'
           '
'); });