-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from keertip/package
add a top level html file for package
- Loading branch information
Showing
3 changed files
with
79 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
|
||
library dartdoc.package_utils; | ||
|
||
import 'dart:io'; | ||
|
||
import 'package:path/path.dart' as path; | ||
import 'package:yaml/yaml.dart'; | ||
|
||
|
||
String getPackageName(String directoryName) => | ||
_getPubspec(directoryName)['name']; | ||
|
||
Map _getPubspec(String directoryName) { | ||
var pubspecName = path.join(directoryName, 'pubspec.yaml'); | ||
File pubspec = new File(pubspecName); | ||
if (!pubspec.existsSync()) return {'name': ''}; | ||
var contents = pubspec.readAsStringSync(); | ||
return loadYaml(contents); | ||
} | ||
|
||
String getPackageDescription(String directoryName) => | ||
_getPubspec(directoryName)['description']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,6 @@ dependencies: | |
bootstrap: any | ||
logging: any | ||
path: any | ||
yaml: any | ||
executables: | ||
dartdoc: null |