Skip to content

Commit bd6015c

Browse files
committed
Merge branch 'master' of github.com:dart-lang/dartdoc into sl-find-as-you-type
2 parents 2f59b45 + 0729031 commit bd6015c

10 files changed

+60
-40
lines changed

appveyor.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,16 @@
33
# BSD-style license that can be found in the LICENSE file.
44

55
install:
6-
# Investigate scoop?
7-
- choco install -y dart-sdk -version 1.11.1
6+
# TODO: Switch back to chocolatey once 1.12.0 is available.
7+
# - choco install -y dart-sdk -version 1.11.1
8+
- ps: wget https://gsdview.appspot.com/dart-archive/channels/dev/raw/latest/sdk/dartsdk-windows-x64-release.zip -OutFile dart-sdk.zip
9+
- cmd: echo "Unzipping dart-sdk..."
10+
- cmd: 7z x dart-sdk.zip -o"C:\tools" -y > nul
811
- set PATH=%PATH%;C:\tools\dart-sdk\bin
912
- set PATH=%PATH%;%APPDATA%\Pub\Cache\bin
1013
- pub get
1114

12-
# this doesn't seem to be working
1315
build: off
1416

15-
branches:
16-
only:
17-
- disable_builds_for_now
18-
1917
test_script:
2018
- pub run grinder buildbot

lib/dartdoc.dart

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ library dartdoc;
88
import 'dart:async';
99
import 'dart:io';
1010

11+
import 'package:analyzer/file_system/file_system.dart' as fileSystem;
12+
import 'package:analyzer/file_system/physical_file_system.dart';
13+
import 'package:analyzer/source/package_map_provider.dart';
14+
import 'package:analyzer/source/package_map_resolver.dart';
15+
import 'package:analyzer/source/pub_package_map_provider.dart';
16+
import 'package:analyzer/source/sdk_ext.dart';
1117
import 'package:analyzer/src/generated/element.dart';
1218
import 'package:analyzer/src/generated/engine.dart';
1319
import 'package:analyzer/src/generated/error.dart';
@@ -131,12 +137,20 @@ class DartDoc {
131137
];
132138
if (urlMappings != null) resolvers.insert(
133139
0, new CustomUriResolver(urlMappings));
134-
JavaFile packagesDir = packageRootDir == null
135-
? new JavaFile.relative(new JavaFile(rootDir.path), 'packages')
136-
: new JavaFile(packageRootDir.path);
137-
if (packagesDir.exists()) {
138-
resolvers.add(new PackageUriResolver([packagesDir]));
140+
141+
fileSystem.Resource cwd =
142+
PhysicalResourceProvider.INSTANCE.getResource('.');
143+
PubPackageMapProvider pubPackageMapProvider =
144+
new PubPackageMapProvider(PhysicalResourceProvider.INSTANCE, sdk);
145+
PackageMapInfo packageMapInfo =
146+
pubPackageMapProvider.computePackageMap(cwd);
147+
Map<String, List<fileSystem.Folder>> packageMap = packageMapInfo.packageMap;
148+
if (packageMap != null) {
149+
resolvers.add(new SdkExtUriResolver(packageMap));
150+
resolvers.add(new PackageMapUriResolver(
151+
PhysicalResourceProvider.INSTANCE, packageMap));
139152
}
153+
140154
SourceFactory sourceFactory =
141155
new SourceFactory(/*contentCache,*/ resolvers);
142156

lib/resources/styles.css

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,15 @@ dt {
205205
}
206206

207207
dd {
208-
margin-bottom: 16px;
209-
color: #727272;
208+
color: #212121;
209+
}
210+
211+
dd.callable, dd.constant, dd.property {
212+
margin-bottom: 24px;
213+
}
214+
215+
dd p {
216+
margin-top: 4px;
210217
}
211218

212219
section.summary h2 {
@@ -229,6 +236,7 @@ dl.dl-horizontal dt {
229236

230237
dt .name {
231238
font-size: 17px;
239+
font-weight: 500;
232240
}
233241

234242
dl dt.callable .name {
@@ -240,8 +248,13 @@ dl dt.callable .name {
240248
white-space: nowrap;
241249
}
242250

251+
.signature {
252+
color: #727272;
253+
}
254+
243255
.signature a {
244-
color: rgb(51, 51, 51);
256+
/* 50% mix of default-primary-color and primary-text-color. */
257+
color: #4674a2;
245258
}
246259

247260
.optional {
@@ -341,9 +354,12 @@ footer .container-fluid {
341354
margin: 0;
342355
}
343356

344-
.is-inherited {
345-
color: #727272;
357+
/* The little slug line under a declaration for things like "const",
358+
"read-only", etc. */
359+
.features {
360+
font-size: 14px;
346361
font-style: italic;
362+
color: #727272;
347363
}
348364

349365
.multi-line-signature {
@@ -423,10 +439,6 @@ nav .self-name {
423439
font-style: italic;
424440
}
425441

426-
.readable-writable {
427-
font-style: italic;
428-
}
429-
430442
section.multi-line-signature div.parameters {
431443
margin-left: 24px;
432444
}

lib/templates/_callable.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
</dt>
77
<dd>
88
{{#isInherited}}
9-
<div>
10-
<span class="is-inherited">inherited</span>
11-
</div>
9+
<div class="features">inherited</div>
1210
{{/isInherited}}
13-
{{{ oneLineDoc }}}
11+
<p>{{{ oneLineDoc }}}</p>
1412
</dd>

lib/templates/_constant.html

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
<dt id="{{htmlId}}" class="constant">
22
<span class="top-level-variable-type">{{{ linkedReturnType }}}</span>
33
<span class="name {{#isDeprecated}}deprecated{{/isDeprecated}}">{{{ linkedName }}}</span>
4-
=
5-
<span class="constant-value">{{{ constantValue }}}</span>
4+
<span class="signature">= {{{ constantValue }}}</span>
65
</dt>
76
<dd>
8-
<div class="is-const">
9-
const
10-
</div>
11-
{{{ oneLineDoc }}}
7+
<div class="features">const</div>
8+
<p>{{{ oneLineDoc }}}</p>
129
</dd>

lib/templates/_property.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<dt id="{{htmlId}}" class="property">
2-
{{#isInherited}}{{>name_summary}}{{/isInherited}}{{^isInherited}}{{{linkedName}}}{{/isInherited}}
2+
{{#isInherited}}{{>name_summary}}{{/isInherited}}
3+
{{^isInherited}}<span class="name">{{{linkedName}}}</span>{{/isInherited}}
34
<span class="signature">&#8594; {{{ linkedReturnType }}}</span>
45
</dt>
56
<dd>
67
{{>readable_writable}}
7-
{{{ oneLineDoc }}}
8+
<p>{{{ oneLineDoc }}}</p>
89
</dd>

lib/templates/_readable_writable.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<div class="readable-writable">
2-
{{#readOnly}}read-only{{/readOnly}}{{#writeOnly}}write-only{{/writeOnly}}{{#readWrite}}read / write{{/readWrite}}{{#isInherited}}, <span class="is-inherited">inherited</span>{{/isInherited}}
1+
<div class="features">
2+
{{#readOnly}}read-only{{/readOnly}}{{#writeOnly}}write-only{{/writeOnly}}{{#readWrite}}read / write{{/readWrite}}{{#isInherited}}, inherited{{/isInherited}}
33
</div>

lib/templates/class.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ <h2>Constructors</h2>
131131
const
132132
</div>
133133
{{/isConst}}
134-
{{{ oneLineDoc }}}
134+
<p>{{{ oneLineDoc }}}</p>
135135
</dd>
136136
{{/clazz.constructors}}
137137
</dl>

lib/templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ <h2>Libraries</h2>
1515
</dt>
1616
<dd>
1717
{{#isNotDocumented}}<span class="undocumented">Library not documented.</span>{{/isNotDocumented}}
18-
{{{ oneLineDoc }}}
18+
<p>{{{ oneLineDoc }}}</p>
1919
</dd>
2020
{{/package.libraries}}
2121
</dl>

lib/templates/library.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ <h2>Enums</h2>
7777
{{{linkedName}}}
7878
</dt>
7979
<dd>
80-
{{{ oneLineDoc }}}
80+
<p>{{{ oneLineDoc }}}</p>
8181
</dd>
8282
{{/library.enums}}
8383
</dl>
@@ -94,7 +94,7 @@ <h2>Classes</h2>
9494
<span class="name {{#isDeprecated}}deprecated{{/isDeprecated}}">{{{linkedName}}}</span>
9595
</dt>
9696
<dd>
97-
{{{ oneLineDoc }}}
97+
<p>{{{ oneLineDoc }}}</p>
9898
</dd>
9999
{{/library.classes}}
100100
</dl>
@@ -111,7 +111,7 @@ <h2>Exceptions / Errors</h2>
111111
<span class="name {{#isDeprecated}}deprecated{{/isDeprecated}}">{{{linkedName}}}</span>
112112
</dt>
113113
<dd>
114-
{{{ oneLineDoc }}}
114+
<p>{{{ oneLineDoc }}}</p>
115115
</dd>
116116
{{/library.exceptions}}
117117
</dl>

0 commit comments

Comments
 (0)