Skip to content

Commit

Permalink
Added title to iframe videos (dart-lang#5411)
Browse files Browse the repository at this point in the history
This adds title attributes to all iframes that include videos.

Fixes dart-lang#5301
  • Loading branch information
atsansone committed Jan 26, 2024
1 parent a535f07 commit ee5f60c
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 23 deletions.
6 changes: 6 additions & 0 deletions src/_includes/yt_shims.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% assign yt-set = 'frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen loading="lazy"' %}
{% assign yt-set-short = 'frameborder="0" allowfullscreen loading="lazy"' %}
{% assign yt-watch = 'https://www.youtube.com/watch' %}
{% assign yt-embed = 'https://www.youtube.com/embed' %}
{% assign yt-playlist = 'https://www.youtube.com/playlist?list=' %}
{% assign yt-std-size = 'width="560" height="315"' %}
17 changes: 10 additions & 7 deletions src/language/extension-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,22 @@ nextpage:
title: Callable objects
---

{% include yt_shims.liquid %}

Extension methods add functionality to existing libraries.
You might use extension methods without even knowing it.
For example, when you use code completion in an IDE,
it suggests extension methods alongside regular methods.

<iframe width="560" height="315"
src="https://www.youtube.com/embed/D3j0OSfT9ZI"
frameborder="0"
allow="accelerometer; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen>
If watching videos helps you learn,
check out this overview of extension methods.

<iframe
{{yt-std-size}}
title="Learn about extension methods in Dart"
src="{{yt-embed}}/D3j0OSfT9ZI"
{{yt-set}}>
</iframe>
_If you like to learn by watching videos,
here's a good overview of extension methods._

## Overview

Expand Down
12 changes: 10 additions & 2 deletions src/null-safety/migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Migrating to null safety
description: How to move your existing Dart code to the world of null safety
---

{% include yt_shims.liquid %}

{{site.alert.version-note}}
Dart 2.19 is the final release that supports null-safety migration,
including the `dart migrate` tool.
Expand Down Expand Up @@ -36,9 +38,15 @@ Here are the basic steps for migrating each package that you own:
make sure that all of your dependencies are ready.
{{site.alert.end}}

For an informal look at the experience of using the migration tool, watch this video:
To get an informal look at the experience of using the migration tool,
watch this video:

<iframe width="560" height="315" src="https://www.youtube.com/embed/eBr5tlumwlg" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<iframe
{{yt-std-size}}
title="Learn about the null-safety migration tool"
src="{{yt-embed}}/eBr5tlumwlg"
{{yt-set}}>
</iframe>

[null safety]: /null-safety
[Gradual null safety migration for large Dart projects]: https://medium.com/dartlang/gradual-null-safety-migration-for-large-dart-projects-85acb10b64a9
Expand Down
9 changes: 8 additions & 1 deletion src/resources/videos.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ description: Learn by watching! Here's a collection of videos about Dart.
dart-playlist-id: PLjxrf2q8roU0Net_g1NT5_vOO3s_FR02J
---

{% include yt_shims.liquid %}

Here are some videos about the Dart language and core libraries.
For more videos, see the [Flutter video page.]({{site.flutter-docs}}/resources/videos)
If you'd like other videos to be listed on this page,
Expand All @@ -19,6 +21,11 @@ A playlist of Google-produced videos,
ranging from 5-minute talks on Dart asynchrony support
to the Dart session from Google I/O 2019.

<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list={{page.dart-playlist-id}}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<iframe
{{yt-std-size}}
title="Watch the talks on Dart asynchrony support"
src="{{yt-playlist}}{{page.dart-playlist-id}}"
{{yt-set}}>
</iframe>

[Playlist: Dart videos](https://www.youtube.com/playlist?list={{page.dart-playlist-id}})
29 changes: 17 additions & 12 deletions src/tools/dart-fix.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ description: Command-line tool for applying analysis fixes and migrating API usa
toc: false
---

{% include yt_shims.liquid %}

The `dart fix` command
finds and fixes two types of issues:

Expand All @@ -16,14 +18,17 @@ finds and fixes two types of issues:

{{site.alert.tip}}
To learn about `dart fix` in a video format,
check out this deep dive on **Decoding Flutter**:
check out this [deep dive][] on **Decoding Flutter**:

<iframe
{{yt-std-size}}
src="{{yt-embed}}/OBIuSrg_Quo"
title="Learn how to use 'dart fix'"
{{yt-set}}>
</iframe>
{{site.alert.end}}

<iframe width="560" height="315"
src="https://www.youtube.com/embed/OBIuSrg_Quo" title="Using 'dart fix' YouTube video"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen></iframe>
{{site.alert.end}}
[deep dive]: {{yt-watch}}/OBIuSrg_Quo

## Usage

Expand All @@ -41,15 +46,15 @@ $ dart fix --apply

## Customization

The `dart fix` command only applies fixes
when there is a "problem" identified by a diagnostic.
The `dart fix` command only applies fixes
when there is a "problem" identified by a diagnostic.
Some diagnostics, such as compilation errors, are implicitly enabled,
while others, such as lints, must be explicitly enabled
while others, such as lints, must be explicitly enabled
in the [analysis options file](/tools/analysis),
as individual preferences for these vary.

You can sometimes increase the number of fixes that can be applied
by enabling additional lints.
by enabling additional lints.
Note that not all diagnostics have associated fixes.

### Example
Expand All @@ -68,7 +73,7 @@ class Vector3d extends Vector2d {
}
```

Dart 2.17 introduced a new language feature called super initializers,
Dart 2.17 introduced a new language feature called super initializers,
which allows you to write the constructor of `Vector3d`
with a more compact style:

Expand Down
9 changes: 8 additions & 1 deletion src/tools/pub/publishing.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Publishing packages
description: Learn how to publish a Dart package to pub.dev.
---

{% include yt_shims.liquid %}

[The pub package manager][pub] isn't just for using other people's packages.
It also allows you to share your packages with the world. If you have a useful
project and you want others to be able to use it, use the `dart pub publish`
Expand All @@ -16,7 +18,12 @@ command.

Watch the following video for an overview of building and publishing packages.

<iframe width="560" height="315" src="https://www.youtube.com/embed/8V_TLiWszK0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
<iframe
{{yt-std-size}}
src="{{yt-embed}}/8V_TLiWszK0"
title="Learn how to build and publish Dart packages"
{{yt-set}}>
</iframe>

## Publishing is forever

Expand Down

0 comments on commit ee5f60c

Please sign in to comment.