Skip to content

Commit 594500e

Browse files
authored
Priority fixes for 'Breaking up language tour' (#4643)
Sorry that I didn't catch these earlier, I didn't have a chance to review the changes yet. I've reverted the deployment to a previous commit until these fixes land, so that google search and other external links don't lead to broken pages and slightly broken content doesn't cause confusion. I have more fixes to follow, but these are the most important to get in. - Fixes broken merge in extension methods file and other changes - Adds necessary DartPad inject script to pages that use it - Implement that when in a "/language" page, "Docs" in the top menu/navbar shows up as highlighted/active - Adds redirects for content that moves - Adjusts existing redirects to point to the new location rather than old language-tour page - Updates the "Callable classes" description to match others and have a period - Adds the "Language evolution" page back to the sidenav since it shouldn't be removed completely - Removes DartPad inject script from language tour which no longer uses it
1 parent a54383d commit 594500e

10 files changed

+24
-40
lines changed

CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ you'll probably need to change the code in two places:
5959
1. In a `.md` file for the page.
6060
2. In a `.dart` file under the `/examples` directory.
6161

62-
For example, say you want to change the following code in the
63-
[language tour](https://dart.dev//language/variables):
62+
For example, say you want to change the following code in the
63+
[Variables documentation](https://dart.dev/language/variables):
6464

6565
```
6666
<?code-excerpt "misc/lib/language_tour/variables.dart (var-decl)"?>
@@ -87,4 +87,4 @@ Just update the PR, and GitHub Actions will run again.
8787
## A word about conduct
8888

8989
We pledge to maintain an open and welcoming environment.
90-
For details, see our [code of conduct](https://dart.dev/code-of-conduct).
90+
For details, see our [code of conduct](https://dart.dev/community/code-of-conduct).

firebase.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,12 @@
169169
{ "source": "/googleapis", "destination": "https://github.com/dart-lang/googleapis", "type": 301 },
170170
{ "source": "/guides/get-started", "destination": "/overview", "type": 301 },
171171
{ "source": "/guides/language/common-prob", "destination": "/guides/language/sound-problems", "type": 301 },
172+
{ "source": "/guides/language/concurrency", "destination": "/language/concurrency", "type": 301 },
173+
{ "source": "/guides/language/extension-methods", "destination": "/language/extension-methods", "type": 301 },
172174
{ "source": "/guides/language/library-tour", "destination": "/guides/libraries/library-tour", "type": 301 },
173-
{ "source": "/guides/language/sound-dart", "destination": "/guides/language/type-system", "type": 301 },
174-
{ "source": "/guides/language/sound-faq", "destination": "/guides/language/type-system", "type": 301 },
175+
{ "source": "/guides/language/sound-dart", "destination": "/language/type-system", "type": 301 },
176+
{ "source": "/guides/language/sound-faq", "destination": "/language/type-system", "type": 301 },
177+
{ "source": "/guides/language/type-system", "destination": "/language/type-system", "type": 301 },
175178
{ "source": "/guides/platforms", "destination": "/overview#platform", "type": 301 },
176179
{ "source": "/hackathons{,/**}", "destination": "/", "type": 301 },
177180
{ "source": "/hangouts{,/**}", "destination": "/", "type": 301 },

src/_data/side-nav.yml

+2-8
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,12 @@
9292
match-page-url-exactly: true
9393
permalink: /null-safety
9494
- title: Migrating to null safety
95-
urlExactMatch: true
96-
match-page-url-exactly: true
9795
permalink: /null-safety/migration-guide
9896
- title: Understanding null safety
99-
urlExactMatch: true
100-
match-page-url-exactly: true
10197
permalink: /null-safety/understanding-null-safety
10298
- title: Unsound null safety
103-
urlExactMatch: true
104-
match-page-url-exactly: true
10599
permalink: /null-safety/unsound-null-safety
106100
- title: FAQ
107-
urlExactMatch: true
108-
match-page-url-exactly: true
109101
permalink: /null-safety/faq
110102

111103
- title: Effective Dart
@@ -332,6 +324,8 @@
332324
children:
333325
- title: FAQ
334326
permalink: /faq
327+
- title: Language evolution
328+
permalink: /guides/language/evolution
335329
- title: Language specification
336330
permalink: /guides/language/spec
337331
- title: Coming from ...

src/_guides/language/language-tour.md

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
title: A tour of the Dart language
33
description: A tour of all the major Dart language features.
44
short-title: Language tour
5-
js: [{url: 'https://dartpad.dev/inject_embed.dart.js', defer: true}]
65
sitemap: false
76
---
87

src/_includes/navigation-main.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</li>
1616
<li class="mainnav__get-started">
1717
<a href="/guides" class="nav-link
18-
{% if page_url_path contains '/*/guides/' or page_url_path contains '/*/dart-2/' or page_url_path contains '/*/codelabs/' or page_url_path contains '/*/samples/' or page_url_path contains '/*/tools/' or page_url_path contains '/*/tutorials/' or page_url_path contains '/*/server/' or page_url_path contains '/*/web/' %} active {%- endif -%}">
18+
{% if page_url_path contains '/*/guides/' or page_url_path contains '/*/language/' or page_url_path contains '/*/dart-2/' or page_url_path contains '/*/codelabs/' or page_url_path contains '/*/samples/' or page_url_path contains '/*/tools/' or page_url_path contains '/*/tutorials/' or page_url_path contains '/*/server/' or page_url_path contains '/*/web/' %} active {%- endif -%}">
1919
<span>Docs</span>
2020
</a>
2121
</li>

src/_includes/navigation-side.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</li>
2525
<li class="nav-item">
2626
<a href="/guides" class="nav-link
27-
{%- if page_url_path contains '/*/guides/' or page_url_path contains '/*/dart-2/' or page_url_path contains '/*/codelabs/' or page_url_path contains '/*/samples/' or page_url_path contains '/*/tools/' or page_url_path contains '/*/tutorials/' or page_url_path contains '/*/server/' or page_url_path contains '/*/web/' %} active {%- endif -%}">Docs</a>
27+
{%- if page_url_path contains '/*/guides/' or page_url_path contains '/*/language/' or page_url_path contains '/*/dart-2/' or page_url_path contains '/*/codelabs/' or page_url_path contains '/*/samples/' or page_url_path contains '/*/tools/' or page_url_path contains '/*/tutorials/' or page_url_path contains '/*/server/' or page_url_path contains '/*/web/' %} active {%- endif -%}">Docs</a>
2828
</li>
2929
</ul>
3030

src/language/callable-classes.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Callable classes
3-
description: How to use the call() method
3+
description: Learn how to create and use callable classes in Dart.
4+
js: [{url: 'https://dartpad.dev/inject_embed.dart.js', defer: true}]
45
---
56

67
To allow an instance of your Dart class to be called like a function,

src/language/constructors.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Constructors
33
description: Everything about using constructors in Dart.
4+
js: [{url: 'https://dartpad.dev/inject_embed.dart.js', defer: true}]
45
---
56

67
<?code-excerpt replace="/ *\/\/\s+ignore_for_file:[^\n]+\n//g; /(^|\n) *\/\/\s+ignore:[^\n]+\n/$1/g; /(\n[^\n]+) *\/\/\s+ignore:[^\n]+\n/$1\n/g; / *\/\/\s+ignore:[^\n]+//g; /([A-Z]\w*)\d\b/$1/g"?>

src/language/extension-methods.md

+8-23
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@ You might use extension methods without even knowing it.
88
For example, when you use code completion in an IDE,
99
it suggests extension methods alongside regular methods.
1010

11-
Here's an example of using an extension method on `String`
12-
named `parseInt()` that's defined in `string_apis.dart`:
13-
14-
```dart
15-
import 'string_apis.dart';
16-
...
17-
print('42'.padLeft(5)); // Use a String method.
18-
print('42'.parseInt()); // Use an extension method.
19-
```
11+
<iframe width="560" height="315"
12+
src="https://www.youtube.com/embed/D3j0OSfT9ZI"
13+
frameborder="0"
14+
allow="accelerometer; encrypted-media; gyroscope; picture-in-picture"
15+
allowfullscreen>
16+
</iframe>
17+
_If you like to learn by watching videos,
18+
here's a good overview of extension methods._
2019

2120
## Overview
2221

@@ -272,20 +271,6 @@ For more information about extension methods, see the following:
272271
* [Feature specification][specification]
273272
* [Extension methods sample][sample]
274273

275-
<<<<<<< HEAD:src/_guides/language/extension-methods.md
276-
=======
277-
<iframe width="560" height="315"
278-
src="https://www.youtube.com/embed/D3j0OSfT9ZI"
279-
frameborder="0"
280-
allow="accelerometer; encrypted-media; gyroscope; picture-in-picture"
281-
allowfullscreen>
282-
</iframe>
283-
<em>If you like to learn by watching videos,
284-
here's a good overview of extension methods.</em>
285-
286-
>>>>>>> 59e53837 (breakup language-tour to new pages, fix on-page links):src/language/extension-methods.md
287274
[specification]: https://github.com/dart-lang/language/blob/master/accepted/2.7/static-extension-methods/feature-specification.md#dart-static-extension-methods-design
288-
289275
[article]: https://medium.com/dartlang/extension-methods-2d466cd8b308
290-
291276
[sample]: https://github.com/dart-lang/samples/tree/master/extension_methods

src/language/functions.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Functions
33
description: Everything about functions in Dart.
4+
js: [{url: 'https://dartpad.dev/inject_embed.dart.js', defer: true}]
45
---
56

67
Dart is a true object-oriented language, so even functions are objects

0 commit comments

Comments
 (0)