Remove master from API docs (#144425)

This commit is contained in:
Michael Goderbauer
2024-02-29 17:06:56 -08:00
committed by GitHub
parent 6995275bba
commit 52bb198fb2
9 changed files with 19 additions and 15 deletions

View File

@@ -115,8 +115,8 @@ function generate_docs() {
# Install and activate the snippets tool, which resides in the
# assets-for-api-docs repo:
# https://github.com/flutter/assets-for-api-docs/tree/master/packages/snippets
"$DART" pub global activate snippets 0.4.2
# https://github.com/flutter/assets-for-api-docs/tree/main/packages/snippets
"$DART" pub global activate snippets 0.4.3
# This script generates a unified doc set, and creates
# a custom index.html, placing everything into DOC_DIR.

View File

@@ -25,7 +25,7 @@ the following locations:
* [Web Embedder](dart-ui_web/dart-ui_web-library.html)
* [Installation](https://flutter.dev/docs/get-started/install)
* [Codelabs](https://flutter.dev/docs/codelabs)
* [Contributing to Flutter](https://github.com/flutter/flutter/blob/master/CONTRIBUTING.md)
* [Contributing to Flutter](https://github.com/flutter/flutter/blob/main/CONTRIBUTING.md)
## Offline Documentation

View File

@@ -277,9 +277,13 @@ class Configurator {
void _createPageFooter(Directory footerPath, Version version) {
final String timestamp = DateFormat('yyyy-MM-dd HH:mm').format(DateTime.now());
final String gitBranch = FlutterInformation.instance.getBranchName();
String channel = FlutterInformation.instance.getBranchName();
// Backward compatibility: Still support running on "master", but pretend it is "main".
if (channel == 'master') {
channel = 'main';
}
final String gitRevision = FlutterInformation.instance.getFlutterRevision();
final String gitBranchOut = gitBranch.isEmpty ? '' : '• $gitBranch';
final String channelOut = channel.isEmpty ? '' : '• $channel';
footerPath.childFile('footer.html').writeAsStringSync('<script src="footer.js"></script>');
publishRoot.childDirectory('flutter').childFile('footer.js')
..createSync(recursive: true)
@@ -287,11 +291,11 @@ class Configurator {
(function() {
var span = document.querySelector('footer>span');
if (span) {
span.innerText = 'Flutter $version • $timestamp • $gitRevision $gitBranchOut';
span.innerText = 'Flutter $version • $timestamp • $gitRevision $channelOut';
}
var sourceLink = document.querySelector('a.source-link');
if (sourceLink) {
sourceLink.href = sourceLink.href.replace('/master/', '/$gitRevision/');
sourceLink.href = sourceLink.href.replace('/main/', '/$gitRevision/');
}
})();
''');
@@ -568,7 +572,7 @@ class DartdocGenerator {
'--link-to-source-root',
flutterRoot.path,
'--link-to-source-uri-template',
'https://github.com/flutter/flutter/blob/master/%f%#L%l%',
'https://github.com/flutter/flutter/blob/main/%f%#L%l%',
'--inject-html',
'--use-base-href',
'--header',

View File

@@ -288,7 +288,7 @@ void main() {
'--link-to-source-root',
'/flutter',
'--link-to-source-uri-template',
'https://github.com/flutter/flutter/blob/master/%f%#L%l%',
'https://github.com/flutter/flutter/blob/main/%f%#L%l%',
'--inject-html',
'--use-base-href',
'--header',
@@ -372,7 +372,7 @@ void main() {
'--link-to-source-root',
'/flutter',
'--link-to-source-uri-template',
'https://github.com/flutter/flutter/blob/master/%f%#L%l%',
'https://github.com/flutter/flutter/blob/main/%f%#L%l%',
'--inject-html',
'--use-base-href',
'--header',