Skip to content

Commit 9f5893a

Browse files
authored
Merge pull request #255 from wpaccessibility/caption-support
Caption support
2 parents 29b02fe + 20e97ac commit 9f5893a

File tree

2 files changed

+39
-11
lines changed

2 files changed

+39
-11
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
WEBVTT
2+
Kind: captions
3+
Language: en
4+
5+
00:00:00.000 --> 00:00:06.560
6+
Heading level one demo description with an 
7+
unordered list. Create a new password. Your  
8+
9+
00:00:06.560 --> 00:00:13.440
10+
password must contain secure edit text. 
11+
Create a new password. Your password must  
12+
13+
00:00:13.440 --> 00:00:18.960
14+
contain at least nine characters, one capital 
15+
letter, and one number. Secure edit text.
16+

docs/contribute/github/content-kitchen-sink.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ An image: ![Alt text](url)
8282
```
8383
![Library]({{site.baseurl}}/assets/images/small-image.jpg)
8484

85-
{: .callout .tip }
85+
{: .callout .tip }
8686
**Tip:** For more text options with Markdown read: [Basic writing and formatting syntax](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax) on GitHub.
8787

8888
## Videos
@@ -93,8 +93,8 @@ Add to the variables at the top of the page:
9393
has_video: true
9494
```
9595

96-
This loads the CSS and Javascript for the Able media player.
97-
Please read the [Able Player documentation](https://ableplayer.github.io/ableplayer/) for information on all available settings and how to add caption and subtitle tracks.
96+
This loads the CSS and Javascript for the Able media player.
97+
Please read the [Able Player documentation](https://ableplayer.github.io/ableplayer/) for information on all available settings and how to add caption and subtitle tracks.
9898

9999
Add the video itself in the page with:
100100

@@ -103,14 +103,26 @@ Add the video itself in the page with:
103103
```
104104
<video data-able-player data-youtube-nocookie="true" data-youtube-id="Xj1P0Z6I2Wk" data-heading-level="0"></video>
105105

106+
You can add captions and navigable transcripts by placing `.vtt` files in the `/assets/captions/` directory and referencing them in the HTML:
107+
108+
```markdown
109+
<video data-able-player data-youtube-nocookie="true" data-youtube-id="6brKmJfDtNQ" data-heading-level="0">
110+
<track kind="captions" src="{{site.baseurl}}/assets/captions/captions-6brKmJfDtNQ.vtt"/>
111+
</video>
112+
```
113+
114+
<video data-able-player data-youtube-nocookie="true" data-youtube-id="6brKmJfDtNQ" data-heading-level="0">
115+
<track kind="captions" src="{{site.baseurl}}/assets/captions/captions-6brKmJfDtNQ.vtt"/>
116+
</video>
117+
106118
## Code examples in the text
107119

108-
A line of code starts and ends with a &#96; on the same line.
120+
A line of code starts and ends with a &#96; on the same line.
109121
`<img src="alice.jpg" alt="White rabbit" />`
110122

111123
A block of code starts and ends with &#96;&#96;&#96;.
112124

113-
If you want to highlight the text for a programming language, add the language after the 3 quotes.
125+
If you want to highlight the text for a programming language, add the language after the 3 quotes.
114126
For example: &#96;&#96;&#96;html.
115127

116128
```html
@@ -135,10 +147,10 @@ button {
135147

136148
```php
137149
// php
138-
function themename_custom_excerpt_length( $length ) {
150+
function themename_custom_excerpt_length( $length ) {
139151
return 40; //number of words in excerpt.
140-
}
141-
add_filter('excerpt_length','themename_custom_excerpt_length', 99 );
152+
}
153+
add_filter('excerpt_length','themename_custom_excerpt_length', 99 );
142154
```
143155

144156
## Language switch in the content text
@@ -163,7 +175,7 @@ For larger pieces of content, you can add to a `<p>`, `<div>`or even a landmark,
163175
```
164176

165177
## Callouts
166-
178+
167179
```markdown
168180
{: .callout .info }
169181
**Info:** This is an informational message and uses the “info” callout.
@@ -178,7 +190,7 @@ For larger pieces of content, you can add to a `<p>`, `<div>`or even a landmark,
178190
**Warning:** When something is particularly precarious, use the “warning” callout.
179191

180192
{: .callout .example }
181-
**Example:** Give an example with the "example" callout.
193+
**Example:** Give an example with the "example" callout.
182194
The title of the callout will be "Example".
183195

184196
{: .callout .do }
@@ -208,7 +220,7 @@ The title of the callout will be "Example".
208220
**Do:** Example of how to do something.
209221

210222
{: .callout .dont }
211-
**Don't:** Example of how not to do something.
223+
**Don't:** Example of how not to do something.
212224

213225
### Labels
214226

0 commit comments

Comments
 (0)