Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions lib/src/markdown_processor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/templates/_source_code.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{#hasSourceCode}}
<section class="summary source-code" id="source">
<h2><span>Source</span> {{{crossdartHtmlTag}}}</h2>
<pre class="prettyprint lang-dart">{{{ sourceCode }}}</pre>
<pre class="prettyprint language-dart">{{{ sourceCode }}}</pre>
</section>{{/hasSourceCode}}
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion test/model_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ void main() {
test('no references', () {
expect(
Apple.documentationAsHtml,
'<p>Sample class <code>String</code></p><pre class="prettyprint lang-dart"> A\n'
'<p>Sample class <code>String</code></p><pre class="prettyprint language-dart"> A\n'
' B\n'
'</pre>');
});
Expand Down
6 changes: 6 additions & 0 deletions testing/test_package/lib/example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ <h5><a href="index.html">test_package</a></h5>
<div class="col-xs-12 col-sm-9 col-md-8 main-content">

<section class="desc markdown">
<pre class="dart prettyprint"><code>void main() {
<pre class="prettyprint language-dart"><code class="language-dart">void main() {
// in Dart!
}
</code></pre>
<pre class="yaml prettyprint"><code>and_yaml:
<pre class="prettyprint language-dart"><code class="language-yaml">and_yaml:
- value
- "value"
- 3.14
Expand Down
2 changes: 1 addition & 1 deletion testing/test_package_docs/ex/Apple-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ <h5><a href="ex/ex-library.html">ex</a></h5>
<div class="col-xs-12 col-sm-9 col-md-8 main-content">

<section class="desc markdown">
<p>Sample class <code>String</code></p><pre class="prettyprint lang-dart"> A
<p>Sample class <code>String</code></p><pre class="prettyprint language-dart"> A
B
</pre>
</section>
Expand Down
2 changes: 1 addition & 1 deletion testing/test_package_docs/ex/Apple/m1.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ <h5><a href="ex/Apple-class.html">Apple</a></h5>
</section>
<section class="desc markdown">
<p>This is a method.</p>
<pre class="prettyprint lang-dart"><code>new Apple().m1();
<pre class="prettyprint language-dart"><code>new Apple().m1();
</code></pre>
</section>

Expand Down
2 changes: 1 addition & 1 deletion testing/test_package_docs/ex/B-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ <h5><a href="ex/ex-library.html">ex</a></h5>
<div class="col-xs-12 col-sm-9 col-md-8 main-content">

<section class="desc markdown">
<p>Extends class <a href="ex/Apple-class.html">Apple</a>, use <a href="ex/Apple/Apple.html">new Apple</a> or <a href="ex/Apple/Apple.fromString.html">new Apple.fromString</a></p><pre class="prettyprint lang-dart"> B extends A
<p>Extends class <a href="ex/Apple-class.html">Apple</a>, use <a href="ex/Apple/Apple.html">new Apple</a> or <a href="ex/Apple/Apple.fromString.html">new Apple.fromString</a></p><pre class="prettyprint language-dart"> B extends A
B implements C
</pre>
</section>
Expand Down
2 changes: 1 addition & 1 deletion testing/test_package_docs/ex/B/m1.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ <h5><a href="ex/B-class.html">B</a></h5>
</section>
<section class="desc markdown">
<p>This is a method.</p>
<pre class="prettyprint lang-dart"><code>new Apple().m1();
<pre class="prettyprint language-dart"><code>new Apple().m1();
</code></pre>
</section>

Expand Down
7 changes: 7 additions & 0 deletions testing/test_package_docs/ex/ShapeType-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ <h5><a href="ex/ex-library.html">ex</a></h5>

<div class="col-xs-12 col-sm-9 col-md-8 main-content">

<section class="desc markdown">
<p><code>Object</code> foo bar</p><ol><li>
<p>All references should be hyperlinks. <code>Object</code> <code>MyError</code> <a href="ex/ShapeType-class.html">ShapeType</a>
<code>MyError</code> <code>MyException</code>
<code>MyError</code> <code>MyException</code> <code>Object</code>
<a href="ex/ShapeType-class.html">ShapeType</a> foo bar</p></li></ol>
</section>


<section class="summary offset-anchor" id="constants">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ <h5><a href="ex/SpecializedDuration-class.html">SpecializedDuration</a></h5>
<p>Returns a string representation of this <code>Duration</code>.</p>
<p>Returns a string with hours, minutes, seconds, and microseconds, in the
following format: <code>HH:MM:SS.mmmmmm</code>. For example,</p>
<pre class="prettyprint lang-dart"><code>var d = new Duration(days:1, hours:1, minutes:33, microseconds: 500);
<pre class="prettyprint language-dart"><code>var d = new Duration(days:1, hours:1, minutes:33, microseconds: 500);
d.toString(); // "25:33:00.000500"
</code></pre>
</section>
Expand Down
4 changes: 2 additions & 2 deletions testing/test_package_docs/ex/ex-library.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ <h5><a href="index.html">test_package</a></h5>
<div class="col-xs-12 col-sm-9 col-md-8 main-content">

<section class="desc markdown">
<p>a library. testing string escaping: <code>var s = 'a string'</code> &lt;cool&gt;</p>
<p>a library. testing string escaping: <code>var s = 'a string'</code> <cool></cool></p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems wrong?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The newer markdown library handles passing through html embedded in the markdown.

</section>

<section class="summary offset-anchor" id="constants">
Expand Down Expand Up @@ -397,7 +397,7 @@ <h2>Classes</h2>
<span class="name "><a href="ex/ShapeType-class.html">ShapeType</a></span>
</dt>
<dd>
<p></p>
<p><code>Object</code> foo bar</p>
</dd>
<dt id="SpecializedDuration">
<span class="name "><a href="ex/SpecializedDuration-class.html">SpecializedDuration</a></span>
Expand Down
2 changes: 1 addition & 1 deletion testing/test_package_docs/fake/ConstantClass-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ <h5><a href="fake/fake-library.html">fake</a></h5>
<p>Make one of these neato classes like this:</p>
<p><code>var constant = const ConstantClass('neat')</code></p>
<p>This is a code block</p>
<pre class="prettyprint lang-dart"><code>var x = 'hello';
<pre class="prettyprint language-dart"><code>var x = 'hello';
print(x);
</code></pre>
</section>
Expand Down
2 changes: 1 addition & 1 deletion testing/test_package_docs/fake/ExtraSpecialList/asMap.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ <h5><a href="fake/ExtraSpecialList-class.html">ExtraSpecialList</a></h5>
<p>The map uses the indices of this list as keys and the corresponding objects
as values. The <code>Map.keys</code> <code>Iterable</code> iterates the indices of this list
in numerical order.</p>
<pre class="prettyprint lang-dart"><code>List&lt;String&gt; words = ['fee', 'fi', 'fo', 'fum'];
<pre class="prettyprint language-dart"><code>List&lt;String&gt; words = ['fee', 'fi', 'fo', 'fum'];
Map&lt;int, String&gt; map = words.asMap();
map[0] + map[1]; // 'feefi';
map.keys.toList(); // [0, 1, 2, 3]
Expand Down
4 changes: 2 additions & 2 deletions testing/test_package_docs/fake/ExtraSpecialList/fold.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,14 @@ <h5><a href="fake/ExtraSpecialList-class.html">ExtraSpecialList</a></h5>
<p>Uses <code>initialValue</code> as the initial value,
then iterates through the elements and updates the value with
each element using the <code>combine</code> function, as if by:</p>
<pre class="prettyprint lang-dart"><code>var value = initialValue;
<pre class="prettyprint language-dart"><code>var value = initialValue;
for (E element in this) {
value = combine(value, element);
}
return value;
</code></pre>
<p>Example of calculating the sum of an iterable:</p>
<pre class="prettyprint lang-dart"><code>iterable.fold(0, (prev, element) =&gt; prev + element);
<pre class="prettyprint language-dart"><code>iterable.fold(0, (prev, element) =&gt; prev + element);
</code></pre>
</section>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ <h5><a href="fake/ExtraSpecialList-class.html">ExtraSpecialList</a></h5>
of the call to this method. The returned <code>Iterable</code> behaves like
<code>skip(start).take(end - start)</code>. That is, it does not throw exceptions
if <code>this</code> changes size.</p>
<pre class="prettyprint lang-dart"><code>List&lt;String&gt; colors = ['red', 'green', 'blue', 'orange', 'pink'];
<pre class="prettyprint language-dart"><code>List&lt;String&gt; colors = ['red', 'green', 'blue', 'orange', 'pink'];
Iterable&lt;String&gt; range = colors.getRange(1, 4);
range.join(', '); // 'green, blue, orange'
colors.length = 3;
Expand Down
4 changes: 2 additions & 2 deletions testing/test_package_docs/fake/ExtraSpecialList/indexOf.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,12 @@ <h5><a href="fake/ExtraSpecialList-class.html">ExtraSpecialList</a></h5>
<p>Searches the list from index <code>start</code> to the end of the list.
The first time an object <code>o</code> is encountered so that <code>o == element</code>,
the index of <code>o</code> is returned.</p>
<pre class="prettyprint lang-dart"><code>List&lt;String&gt; notes = ['do', 're', 'mi', 're'];
<pre class="prettyprint language-dart"><code>List&lt;String&gt; notes = ['do', 're', 'mi', 're'];
notes.indexOf('re'); // 1
notes.indexOf('re', 2); // 3
</code></pre>
<p>Returns -1 if <code>element</code> is not found.</p>
<pre class="prettyprint lang-dart"><code>notes.indexOf('fa'); // -1
<pre class="prettyprint language-dart"><code>notes.indexOf('fa'); // -1
</code></pre>
</section>

Expand Down
4 changes: 2 additions & 2 deletions testing/test_package_docs/fake/ExtraSpecialList/reduce.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,14 @@ <h5><a href="fake/ExtraSpecialList-class.html">ExtraSpecialList</a></h5>
<p>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:</p>
<pre class="prettyprint lang-dart"><code>E value = iterable.first;
<pre class="prettyprint language-dart"><code>E value = iterable.first;
iterable.skip(1).forEach((element) {
value = combine(value, element);
});
return value;
</code></pre>
<p>Example of calculating the sum of an iterable:</p>
<pre class="prettyprint lang-dart"><code>iterable.reduce((value, element) =&gt; value + element);
<pre class="prettyprint language-dart"><code>iterable.reduce((value, element) =&gt; value + element);
</code></pre>
</section>

Expand Down
4 changes: 2 additions & 2 deletions testing/test_package_docs/fake/ExtraSpecialList/remove.html
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ <h5><a href="fake/ExtraSpecialList-class.html">ExtraSpecialList</a></h5>
<section class="desc markdown">
<p>Removes the first occurence of <code>value</code> from this list.</p>
<p>Returns true if <code>value</code> was in the list, false otherwise.</p>
<pre class="prettyprint lang-dart"><code>List&lt;String&gt; parts = ['head', 'shoulders', 'knees', 'toes'];
<pre class="prettyprint language-dart"><code>List&lt;String&gt; parts = ['head', 'shoulders', 'knees', 'toes'];
parts.remove('head'); // true
parts.join(', '); // 'shoulders, knees, toes'
</code></pre>
<p>The method has no effect if <code>value</code> was not in the list.</p>
<pre class="prettyprint lang-dart"><code>// Note: 'head' has already been removed.
<pre class="prettyprint language-dart"><code>// Note: 'head' has already been removed.
parts.remove('head'); // false
parts.join(', '); // 'shoulders, knees, toes'
</code></pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ <h5><a href="fake/ExtraSpecialList-class.html">ExtraSpecialList</a></h5>
<section class="desc markdown">
<p>Removes all objects from this list that satisfy <code>test</code>.</p>
<p>An object <code>o</code> satisfies <code>test</code> if <code>test(o)</code> is true.</p>
<pre class="prettyprint lang-dart"><code>List&lt;String&gt; numbers = ['one', 'two', 'three', 'four'];
<pre class="prettyprint language-dart"><code>List&lt;String&gt; numbers = ['one', 'two', 'three', 'four'];
numbers.removeWhere((item) =&gt; item.length == 3);
numbers.join(', '); // 'three, four'
</code></pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ <h5><a href="fake/ExtraSpecialList-class.html">ExtraSpecialList</a></h5>
<section class="desc markdown">
<p>Removes the objects in the range <code>start</code> inclusive to <code>end</code> exclusive
and inserts the contents of <code>replacement</code> in its place.</p>
<pre class="prettyprint lang-dart"><code>List&lt;int&gt; list = [1, 2, 3, 4, 5];
<pre class="prettyprint language-dart"><code>List&lt;int&gt; list = [1, 2, 3, 4, 5];
list.replaceRange(1, 4, [6, 7]);
list.join(', '); // '1, 6, 7, 5'
</code></pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ <h5><a href="fake/ExtraSpecialList-class.html">ExtraSpecialList</a></h5>
<section class="desc markdown">
<p>Removes all objects from this list that fail to satisfy <code>test</code>.</p>
<p>An object <code>o</code> satisfies <code>test</code> if <code>test(o)</code> is true.</p>
<pre class="prettyprint lang-dart"><code>List&lt;String&gt; numbers = ['one', 'two', 'three', 'four'];
<pre class="prettyprint language-dart"><code>List&lt;String&gt; numbers = ['one', 'two', 'three', 'four'];
numbers.retainWhere((item) =&gt; item.length == 3);
numbers.join(', '); // 'one, two'
</code></pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ <h5><a href="fake/ExtraSpecialList-class.html">ExtraSpecialList</a></h5>
<section class="desc markdown">
<p>Overwrites objects of <code>this</code> with the objects of <code>iterable</code>, starting
at position <code>index</code> in this list.</p>
<pre class="prettyprint lang-dart"><code>List&lt;String&gt; list = ['a', 'b', 'c'];
<pre class="prettyprint language-dart"><code>List&lt;String&gt; list = ['a', 'b', 'c'];
list.setAll(1, ['bee', 'sea']);
list.join(', '); // 'a, bee, sea'
</code></pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ <h5><a href="fake/ExtraSpecialList-class.html">ExtraSpecialList</a></h5>
<section class="desc markdown">
<p>Copies the objects of <code>iterable</code>, skipping <code>skipCount</code> objects first,
into the range <code>start</code>, inclusive, to <code>end</code>, exclusive, of the list.</p>
<pre class="prettyprint lang-dart"><code>List&lt;int&gt; list1 = [1, 2, 3, 4];
<pre class="prettyprint language-dart"><code>List&lt;int&gt; list1 = [1, 2, 3, 4];
List&lt;int&gt; list2 = [5, 6, 7, 8, 9];
// Copies the 4th and 5th items in list2 as the 2nd and 3rd items
// of list1.
Expand Down
6 changes: 3 additions & 3 deletions testing/test_package_docs/fake/ExtraSpecialList/sort.html
Original file line number Diff line number Diff line change
Expand Up @@ -155,22 +155,22 @@ <h5><a href="fake/ExtraSpecialList-class.html">ExtraSpecialList</a></h5>
<section class="desc markdown">
<p>Sorts this list according to the order specified by the <code>compare</code> function.</p>
<p>The <code>compare</code> function must act as a <code>Comparator</code>.</p>
<pre class="prettyprint lang-dart"><code>List&lt;String&gt; numbers = ['two', 'three', 'four'];
<pre class="prettyprint language-dart"><code>List&lt;String&gt; numbers = ['two', 'three', 'four'];
// Sort from shortest to longest.
numbers.sort((a, b) =&gt; a.length.compareTo(b.length));
print(numbers); // [two, four, three]
</code></pre>
<p>The default List implementations use <code>Comparable.compare</code> if
<code>compare</code> is omitted.</p>
<pre class="prettyprint lang-dart"><code>List&lt;int&gt; nums = [13, 2, -11];
<pre class="prettyprint language-dart"><code>List&lt;int&gt; nums = [13, 2, -11];
nums.sort();
print(nums); // [-11, 2, 13]
</code></pre>
<p>A <code>Comparator</code> may compare objects as equal (return zero), even if they
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:</p>
<pre class="prettyprint lang-dart"><code>List&lt;String&gt; numbers = ['one', 'two', 'three', 'four'];
<pre class="prettyprint language-dart"><code>List&lt;String&gt; numbers = ['one', 'two', 'three', 'four'];
numbers.sort((a, b) =&gt; a.length.compareTo(b.length));
print(numbers); // [one, two, four, three] OR [two, one, four, three]
</code></pre>
Expand Down
4 changes: 2 additions & 2 deletions testing/test_package_docs/fake/ExtraSpecialList/sublist.html
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ <h5><a href="fake/ExtraSpecialList-class.html">ExtraSpecialList</a></h5>
<section class="desc markdown">
<p>Returns a new list containing the objects from <code>start</code> inclusive to <code>end</code>
exclusive.</p>
<pre class="prettyprint lang-dart"><code>List&lt;String&gt; colors = ['red', 'green', 'blue', 'orange', 'pink'];
<pre class="prettyprint language-dart"><code>List&lt;String&gt; colors = ['red', 'green', 'blue', 'orange', 'pink'];
colors.sublist(1, 3); // ['green', 'blue']
</code></pre>
<p>If <code>end</code> is omitted, the <code>length</code> of <code>this</code> is used.</p>
<pre class="prettyprint lang-dart"><code>colors.sublist(1); // ['green', 'blue', 'orange', 'pink']
<pre class="prettyprint language-dart"><code>colors.sublist(1); // ['green', 'blue', 'orange', 'pink']
</code></pre>
<p>An error occurs if <code>start</code> is outside the range <code>0</code> .. <code>length</code> or if
<code>end</code> is outside the range <code>start</code> .. <code>length</code>.</p>
Expand Down
2 changes: 1 addition & 1 deletion testing/test_package_docs/fake/SpecialList/asMap.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ <h5><a href="fake/SpecialList-class.html">SpecialList</a></h5>
<p>The map uses the indices of this list as keys and the corresponding objects
as values. The <code>Map.keys</code> <code>Iterable</code> iterates the indices of this list
in numerical order.</p>
<pre class="prettyprint lang-dart"><code>List&lt;String&gt; words = ['fee', 'fi', 'fo', 'fum'];
<pre class="prettyprint language-dart"><code>List&lt;String&gt; words = ['fee', 'fi', 'fo', 'fum'];
Map&lt;int, String&gt; map = words.asMap();
map[0] + map[1]; // 'feefi';
map.keys.toList(); // [0, 1, 2, 3]
Expand Down
4 changes: 2 additions & 2 deletions testing/test_package_docs/fake/SpecialList/fold.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,14 @@ <h5><a href="fake/SpecialList-class.html">SpecialList</a></h5>
<p>Uses <code>initialValue</code> as the initial value,
then iterates through the elements and updates the value with
each element using the <code>combine</code> function, as if by:</p>
<pre class="prettyprint lang-dart"><code>var value = initialValue;
<pre class="prettyprint language-dart"><code>var value = initialValue;
for (E element in this) {
value = combine(value, element);
}
return value;
</code></pre>
<p>Example of calculating the sum of an iterable:</p>
<pre class="prettyprint lang-dart"><code>iterable.fold(0, (prev, element) =&gt; prev + element);
<pre class="prettyprint language-dart"><code>iterable.fold(0, (prev, element) =&gt; prev + element);
</code></pre>
</section>

Expand Down
2 changes: 1 addition & 1 deletion testing/test_package_docs/fake/SpecialList/getRange.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ <h5><a href="fake/SpecialList-class.html">SpecialList</a></h5>
of the call to this method. The returned <code>Iterable</code> behaves like
<code>skip(start).take(end - start)</code>. That is, it does not throw exceptions
if <code>this</code> changes size.</p>
<pre class="prettyprint lang-dart"><code>List&lt;String&gt; colors = ['red', 'green', 'blue', 'orange', 'pink'];
<pre class="prettyprint language-dart"><code>List&lt;String&gt; colors = ['red', 'green', 'blue', 'orange', 'pink'];
Iterable&lt;String&gt; range = colors.getRange(1, 4);
range.join(', '); // 'green, blue, orange'
colors.length = 3;
Expand Down
4 changes: 2 additions & 2 deletions testing/test_package_docs/fake/SpecialList/indexOf.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,12 @@ <h5><a href="fake/SpecialList-class.html">SpecialList</a></h5>
<p>Searches the list from index <code>start</code> to the end of the list.
The first time an object <code>o</code> is encountered so that <code>o == element</code>,
the index of <code>o</code> is returned.</p>
<pre class="prettyprint lang-dart"><code>List&lt;String&gt; notes = ['do', 're', 'mi', 're'];
<pre class="prettyprint language-dart"><code>List&lt;String&gt; notes = ['do', 're', 'mi', 're'];
notes.indexOf('re'); // 1
notes.indexOf('re', 2); // 3
</code></pre>
<p>Returns -1 if <code>element</code> is not found.</p>
<pre class="prettyprint lang-dart"><code>notes.indexOf('fa'); // -1
<pre class="prettyprint language-dart"><code>notes.indexOf('fa'); // -1
</code></pre>
</section>

Expand Down
Loading