Skip to content

remove a use of resource loading #2337

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 1 commit into from
Sep 8, 2020
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
4 changes: 0 additions & 4 deletions lib/resources/sdk_footer_text.html

This file was deleted.

1 change: 0 additions & 1 deletion lib/resources/sdk_footer_text.md

This file was deleted.

12 changes: 0 additions & 12 deletions lib/src/generator/generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ library dartdoc.generator;

import 'dart:async' show Future;

import 'package:analyzer/file_system/file_system.dart';
import 'package:dartdoc/src/dartdoc_options.dart';
import 'package:dartdoc/src/model/model.dart' show PackageGraph;
import 'package:dartdoc/src/package_meta.dart';
Expand Down Expand Up @@ -38,9 +37,6 @@ mixin GeneratorContext on DartdocOptionContextBase {

List<String> get footerText => optionSet['footerText'].valueAt(context);

// Synthetic. TODO(jcollins-g): Eliminate special case for SDK and use config file.
bool get addSdkFooter => optionSet['addSdkFooter'].valueAt(context);

List<String> get header => optionSet['header'].valueAt(context);

bool get prettyIndexJson => optionSet['prettyIndexJson'].valueAt(context);
Expand Down Expand Up @@ -75,14 +71,6 @@ Future<List<DartdocOption<Object>>> createGeneratorOptions(
'package name and version).',
mustExist: true,
splitCommas: true),
DartdocOptionSyntheticOnly<bool>(
'addSdkFooter',
(DartdocSyntheticOption<bool> option, Folder dir) {
return option.root['topLevelPackageMeta'].valueAt(dir).isSdk;
},
resourceProvider,
help: 'Whether the SDK footer text should be added (synthetic)',
),
DartdocOptionArgFile<List<String>>('header', [], resourceProvider,
isFile: true,
help: 'Paths to files with content to add to page headers.',
Expand Down
2 changes: 0 additions & 2 deletions lib/src/generator/html_resources.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ const List<String> resource_names = [
'package:dartdoc/resources/play_button.svg',
'package:dartdoc/resources/readme.md',
'package:dartdoc/resources/script.js',
'package:dartdoc/resources/sdk_footer_text.html',
'package:dartdoc/resources/sdk_footer_text.md',
'package:dartdoc/resources/styles.css',
'package:dartdoc/resources/typeahead.bundle.min.js'
];
7 changes: 1 addition & 6 deletions lib/src/generator/templates.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ library dartdoc.templates;

import 'dart:async' show Future;
import 'dart:io' show File, Directory;
import 'dart:isolate';

import 'package:dartdoc/dartdoc.dart';
import 'package:dartdoc/src/generator/resource_loader.dart' as loader;
Expand Down Expand Up @@ -101,6 +100,7 @@ Future<Map<String, String>> _loadPartials(

abstract class _TemplatesLoader {
Future<Map<String, String>> loadPartials();

Future<String> loadTemplate(String name);
}

Expand Down Expand Up @@ -196,11 +196,6 @@ class Templates {
var templatesDir = context.templatesDir;
var format = context.format;
var footerTextPaths = context.footerText;
if (context.addSdkFooter) {
var sdkFooter = await Isolate.resolvePackageUri(
Uri.parse('package:dartdoc/resources/sdk_footer_text.$format'));
footerTextPaths.add(path.canonicalize(sdkFooter.toFilePath()));
}

if (templatesDir != null) {
return fromDirectory(Directory(templatesDir), format,
Expand Down