Skip to content

Commit 693fd88

Browse files
authored
remove the creative commons footer text (#1515)
* remove cc footer text * update the generated files * add cc footer text back for the sdk docs * update a string interpolation location
1 parent 56a78e0 commit 693fd88

File tree

666 files changed

+21
-2664
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

666 files changed

+21
-2664
lines changed

bin/dartdoc.dart

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
library dartdoc.bin;
66

77
import 'dart:io';
8+
import 'dart:isolate' show Isolate;
89

910
import 'package:analyzer/file_system/physical_file_system.dart';
1011
import 'package:analyzer/src/dart/sdk/sdk.dart';
@@ -44,10 +45,7 @@ main(List<String> arguments) async {
4445
exit(1);
4546
}
4647

47-
bool sdkDocs = false;
48-
if (args['sdk-docs']) {
49-
sdkDocs = true;
50-
}
48+
final bool sdkDocs = args['sdk-docs'];
5149

5250
if (args['show-progress']) {
5351
_showProgress = true;
@@ -63,7 +61,8 @@ main(List<String> arguments) async {
6361
Directory inputDir = new Directory(args['input']);
6462
if (!inputDir.existsSync()) {
6563
stderr.writeln(
66-
" fatal error: unable to locate the input directory at ${inputDir.path}.");
64+
" fatal error: unable to locate the input directory at ${inputDir
65+
.path}.");
6766
exit(1);
6867
}
6968

@@ -95,6 +94,14 @@ main(List<String> arguments) async {
9594

9695
List<String> footerTextFilePaths =
9796
args['footer-text'].map(_resolveTildePath).toList() as List<String>;
97+
98+
// If we're generating docs for the Dart SDK, we insert a copyright footer.
99+
if (sdkDocs) {
100+
Uri footerCopyrightUri = await Isolate.resolvePackageUri(
101+
Uri.parse('package:dartdoc/src/sdk_footer_text.html'));
102+
footerTextFilePaths = [footerCopyrightUri.toFilePath()];
103+
}
104+
98105
for (String footerFilePath in footerTextFilePaths) {
99106
if (!new File(footerFilePath).existsSync()) {
100107
stderr.writeln(
@@ -122,8 +129,9 @@ main(List<String> arguments) async {
122129
: new PackageMeta.fromDir(inputDir);
123130

124131
if (!packageMeta.isValid) {
132+
final String firstError = packageMeta.getInvalidReasons().first;
125133
stderr.writeln(
126-
' fatal error: Unable to generate documentation: ${packageMeta.getInvalidReasons().first}.');
134+
' fatal error: Unable to generate documentation: $firstError.');
127135
exit(1);
128136
}
129137

@@ -245,8 +253,8 @@ ArgParser _createArgsParser() {
245253
parser.addOption('footer-text',
246254
allowMultiple: true,
247255
splitCommas: true,
248-
help:
249-
'paths to footer-text files (optional text next to the copyright).');
256+
help: 'paths to footer-text files '
257+
'(optional text next to the package name and version).');
250258
parser.addOption('exclude',
251259
allowMultiple: true, splitCommas: true, help: 'Library names to ignore.');
252260
parser.addOption('include',
@@ -311,6 +319,7 @@ ArgParser _createArgsParser() {
311319
}
312320

313321
int _progressCounter = 0;
322+
314323
void _onProgress(var file) {
315324
if (_showProgress && _progressCounter % 5 == 0) {
316325
stdout.write('.');

lib/src/sdk_footer_text.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
&bull;
2+
<span class="copyright no-break">
3+
<a href="http://creativecommons.org/licenses/by-sa/4.0/">cc license</a>
4+
</span>

lib/templates/_footer.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
<span class="no-break">
55
{{package.name}} {{package.version}}
66
</span>
7-
&bull;
8-
<span class="copyright no-break">
9-
<a href="http://creativecommons.org/licenses/by-sa/4.0/">cc license</a>
10-
</span>
117

128
<!-- footer-text placeholder -->
139
</footer>

testing/test_package_docs/anonymous_library/anonymous_library-library.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,6 @@ <h5>library anonymous_library</h5>
100100
<span class="no-break">
101101
test_package 0.0.1
102102
</span>
103-
&bull;
104-
<span class="copyright no-break">
105-
<a href="http://creativecommons.org/licenses/by-sa/4.0/">cc license</a>
106-
</span>
107103

108104
</footer>
109105

testing/test_package_docs/anonymous_library/doesStuff.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@ <h5>function doesStuff</h5>
7070
<span class="no-break">
7171
test_package 0.0.1
7272
</span>
73-
&bull;
74-
<span class="copyright no-break">
75-
<a href="http://creativecommons.org/licenses/by-sa/4.0/">cc license</a>
76-
</span>
7773

7874
</footer>
7975

testing/test_package_docs/another_anonymous_lib/another_anonymous_lib-library.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,6 @@ <h5>library another_anonymous_lib</h5>
100100
<span class="no-break">
101101
test_package 0.0.1
102102
</span>
103-
&bull;
104-
<span class="copyright no-break">
105-
<a href="http://creativecommons.org/licenses/by-sa/4.0/">cc license</a>
106-
</span>
107103

108104
</footer>
109105

testing/test_package_docs/another_anonymous_lib/greeting.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@ <h5>function greeting</h5>
7070
<span class="no-break">
7171
test_package 0.0.1
7272
</span>
73-
&bull;
74-
<span class="copyright no-break">
75-
<a href="http://creativecommons.org/licenses/by-sa/4.0/">cc license</a>
76-
</span>
7773

7874
</footer>
7975

testing/test_package_docs/code_in_comments/code_in_comments-library.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,6 @@ <h5>library code_in_comments</h5>
9494
<span class="no-break">
9595
test_package 0.0.1
9696
</span>
97-
&bull;
98-
<span class="copyright no-break">
99-
<a href="http://creativecommons.org/licenses/by-sa/4.0/">cc license</a>
100-
</span>
10197

10298
</footer>
10399

testing/test_package_docs/css/css-library.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,6 @@ <h5>library css</h5>
104104
<span class="no-break">
105105
test_package 0.0.1
106106
</span>
107-
&bull;
108-
<span class="copyright no-break">
109-
<a href="http://creativecommons.org/licenses/by-sa/4.0/">cc license</a>
110-
</span>
111107

112108
</footer>
113109

testing/test_package_docs/css/theOnlyThingInTheLibrary.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@ <h5>top-level property theOnlyThingInTheLibrary</h5>
7171
<span class="no-break">
7272
test_package 0.0.1
7373
</span>
74-
&bull;
75-
<span class="copyright no-break">
76-
<a href="http://creativecommons.org/licenses/by-sa/4.0/">cc license</a>
77-
</span>
7874

7975
</footer>
8076

0 commit comments

Comments
 (0)