Skip to content

Prepare for 0.20.0 #1702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 30, 2018
Merged
Show file tree
Hide file tree
Changes from 8 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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 0.20.0
* include and exclude are now available in dartdoc_options.yaml as supported options
(#1700, #1674)
* Support a new `{@animation}` directive in documentation comments to display
videos in a simple player.
* Fix Dart 2.0 support (#1668) and expand test coverage to include --help.

## 0.19.1
* Update `package:markdown` to `2.0.0`, which includes many improvements –
especially to the parsing of links.
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,18 @@ and Library pages.
library my_library;
```

### Animations

You can specify links to videos inline that will be handled with a simple HTML5 player:

```dart
/// This widget is a dancing Linux penguin.
///
/// {@animation name 100 200 http://host.com/path/to/video.mp4}
```

'name' is user defined, and the numbers are the width and height of the animation in pixels.

### Macros

You can specify "macros", i.e. reusable pieces of documentation. For that, first specify a template
Expand Down
5 changes: 3 additions & 2 deletions lib/src/dartdoc_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ class DartdocOptionArgSynth<T> extends DartdocOption<T>
{String abbr,
bool mustExist = false,
String help = '',
bool hide = false,
bool isDir = false,
bool isFile = false,
bool negatable,
Expand Down Expand Up @@ -487,7 +488,7 @@ class DartdocOptionArgOnly<T> extends DartdocOption<T>
{String abbr,
bool mustExist = false,
String help = '',
bool hide,
bool hide = false,
bool isDir = false,
bool isFile = false,
bool negatable,
Expand Down Expand Up @@ -522,7 +523,7 @@ class DartdocOptionArgFile<T> extends DartdocOption<T>
{String abbr,
bool mustExist = false,
String help: '',
bool hide,
bool hide = false,
bool isDir = false,
bool isFile = false,
bool negatable,
Expand Down
8 changes: 4 additions & 4 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "0.32.0"
version: "0.32.1"
args:
dependency: "direct main"
description:
Expand Down Expand Up @@ -84,7 +84,7 @@ packages:
name: front_end
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0"
version: "0.1.1"
glob:
dependency: transitive
description:
Expand Down Expand Up @@ -147,7 +147,7 @@ packages:
name: kernel
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.0"
version: "0.3.1"
logging:
dependency: "direct main"
description:
Expand Down Expand Up @@ -394,4 +394,4 @@ packages:
source: hosted
version: "2.1.13"
sdks:
dart: ">=2.0.0-dev.54.0 <=2.0.0-dev.58.0"
dart: ">=2.0.0-dev.59.0 <=2.0.0-dev.59.0.flutter-ff815d05a5"
10 changes: 5 additions & 5 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: dartdoc
# Also update the `version` field in lib/dartdoc.dart.
version: 0.19.1
version: 0.20.0
author: Dart Team <[email protected]>
description: A documentation generator for Dart.
homepage: https://github.com/dart-lang/dartdoc
environment:
sdk: '>=2.0.0-dev.54.0 <3.0.0'
sdk: '>=2.0.0-dev.59.0 <3.0.0'
dependencies:
analyzer: 0.32.0
args: '>=0.13.0 <2.0.0'
analyzer: 0.32.1
args: '>=1.4.1 <2.0.0'
collection: ^1.2.0
front_end: ^0.1.0
front_end: ^0.1.1
html: '>=0.12.1 <0.14.0'
# We don't use http_parser directly; this dep exists to ensure that we get at
# least version 3.0.3 to work around an issue with 3.0.2.
Expand Down
2 changes: 1 addition & 1 deletion test/dartdoc_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void main() {
startsWith(
'<a href="https://pub.dartlang.org/documentation/tuple/1.0.1/tuple/Tuple2-class.html">Tuple2</a>'));
RegExp stringLink = new RegExp(
'https://api.dartlang.org/(dev|stable|be)/${Platform.version.split(' ').first}/dart-core/String-class.html">String</a>');
'https://api.dartlang.org/(dev|stable|edge|be)/${Platform.version.split(' ').first}/dart-core/String-class.html">String</a>');
expect(useSomethingInAnotherPackage.modelType.linkedName,
contains(stringLink));
});
Expand Down
42 changes: 33 additions & 9 deletions tool/grind.dart
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,12 @@ test() async {
await testFutures.wait();
}

List<File> get binFiles => new Directory('bin')
.listSync(recursive: true)
.where((e) => e is File && e.path.endsWith('.dart'))
.cast<File>()
..toList();

List<File> get testFiles => new Directory('test')
.listSync(recursive: true)
.where((e) => e is File && e.path.endsWith('test.dart'))
Expand All @@ -731,31 +737,49 @@ List<File> get testFiles => new Directory('test')
testPreviewDart2() async {
List<String> parameters = ['--preview-dart-2', '--enable-asserts'];

// sdk#32901 is really bad on Windows.
for (File dartFile in testFiles.where((f) =>
!f.path.endsWith('html_generator_test.dart') && !Platform.isWindows)) {
// absolute path to work around dart-lang/sdk#32901
for (File dartFile in testFiles) {
await testFutures.addFuture(
new SubprocessLauncher('dart2-${pathLib.basename(dartFile.path)}')
.runStreamed(
Platform.resolvedExecutable,
<String>[]
..addAll(parameters)
..add(dartFile.path)));
}

for (File dartFile in binFiles) {
await testFutures.addFuture(new SubprocessLauncher(
'dart2-${pathLib.basename(dartFile.absolute.path)}')
'dart2-bin-${pathLib.basename(dartFile.path)}-help')
.runStreamed(
Platform.resolvedExecutable,
<String>[]
..addAll(parameters)
..add(dartFile.absolute.path)));
..add(dartFile.path)
..add('--help')));
}
}

testDart1() async {
List<String> parameters = ['--checked'];
for (File dartFile in testFiles) {
// absolute path to work around dart-lang/sdk#32901
await testFutures.addFuture(
new SubprocessLauncher('dart1-${pathLib.basename(dartFile.path)}')
.runStreamed(
Platform.resolvedExecutable,
<String>[]
..addAll(parameters)
..add(dartFile.path)));
}

for (File dartFile in binFiles) {
await testFutures.addFuture(new SubprocessLauncher(
'dart1-${pathLib.basename(dartFile.absolute.path)}')
'dart1-bin-${pathLib.basename(dartFile.path)}-help')
.runStreamed(
Platform.resolvedExecutable,
<String>[]
..addAll(parameters)
..add(dartFile.absolute.path)));
..add(dartFile.path)
..add('--help')));
}
}

Expand Down