Skip to content

Commit

Permalink
update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
robbecker-wf committed Oct 26, 2021
1 parent 0db8e04 commit c72b460
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ <h1>GitHub for Dart - Demos</h1>
<a href="user_info.html">User Information</a>
<a href="languages.html">Language Breakdown</a>
<a href="releases.html">Releases</a>
<a href="pr.html">Pull Request</a>
<a href="stars.html">Stars</a>
<a href="search.html">Code Search</a>
<a href="emoji.html">Emoji</a>
Expand Down
18 changes: 18 additions & 0 deletions example/pr.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import 'dart:async';
import 'dart:html';

import 'package:github/github.dart';

import 'common.dart';

Future<void> main() async {
await initViewSourceButton('pr.dart');
var pr = await github.pullRequests
.get(RepositorySlug('flutter', 'flutter'), 90295);
renderPr(pr);
}

void renderPr(PullRequest pr) {
var prDiv = querySelector('#pr')!;
prDiv.innerText = pr.toJson().toString();
}
23 changes: 23 additions & 0 deletions example/pr.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>

<head>
<title>GitHub for Dart - Pull Request</title>
</head>

<body class="demo-repos">
<div class="header">
<h2 id="title">GitHub for Dart - Pull Request</h2>
<button id="view-source">View the Source</button>

<p></p>
</div>

Pull Request JSON:
<pre id="pr"></pre>

<script defer src="pr.dart.js"></script>

</body>

</html>
11 changes: 11 additions & 0 deletions test/experiment/generate_release_notes.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import 'package:github/github.dart';

Future<void> main() async {
final github = GitHub(auth: findAuthenticationFromEnvironment());

var notes = await github.repositories.generateReleaseNotes(
CreateReleaseNotes('Spinlocklabs', 'github.dart', '1.0.1',
targetCommitish: '1.0.1', previousTagName: '1.0.0'));
print(notes.name);
print(notes.body);
}

0 comments on commit c72b460

Please sign in to comment.