### Install NPM Dependencies
Source: https://github.com/w3c/wai-aria-practices/blob/main/README.md
Install Node.js dependencies for the pre-build script.
```bash
npm install -C scripts/pre-build
```
--------------------------------
### Register Source Code Example
Source: https://github.com/w3c/wai-aria-practices/blob/main/ARIA/apg/patterns/grid/examples/layout-grids.md
Registers a new source code example with the global sourceCode object.
```javascript
sourceCode.add('sc1', 'ex1', 'ex1_label', 'css_js_files', 'sc1_description');
```
```javascript
sourceCode.add('sc2', 'ex2', 'ex2_label', 'css_js_files', 'sc2_description');
```
```javascript
sourceCode.add('sc3', 'ex3', 'ex3_label', 'css_js_files', 'sc3_description');
```
--------------------------------
### Meter Example JavaScript
Source: https://github.com/w3c/wai-aria-practices/blob/main/ARIA/apg/patterns/meter/examples/meter.md
This JavaScript file contains the logic for the meter example, including handling dynamic updates and user interactions like pausing the updates.
```javascript
/* JavaScript for meter.js is not provided in the source */
```
--------------------------------
### Initialize Source Code Rendering
Source: https://github.com/w3c/wai-aria-practices/blob/main/ARIA/apg/patterns/grid/examples/layout-grids.md
Triggers the rendering process for all registered source code examples.
```javascript
sourceCode.make();
```
--------------------------------
### HTML Source Code for Menu Button Example
Source: https://github.com/w3c/wai-aria-practices/blob/main/ARIA/apg/patterns/menu-button/examples/menu-button-links.md
This is the complete HTML source code for the menu button example. It is recommended to open this code in CodePen for copying.
```html
```
--------------------------------
### Listbox Examples
Source: https://github.com/w3c/wai-aria-practices/blob/main/ARIA/apg/about/coverage-and-quality/coverage-and-quality-report.md
Showcases various listbox implementations, including grouped, rearrangeable, and scrollable options. Note the deprecated collapsible listbox example.
```html
(Deprecated) Collapsible Dropdown Listbox
```
```html
Listbox with Grouped Options
```
```html
Listboxes with Rearrangeable Options
```
```html
Scrollable Listbox
```
--------------------------------
### Initialize Source Code Display
Source: https://github.com/w3c/wai-aria-practices/blob/main/ARIA/apg/patterns/menubar/examples/menubar-editor.md
Initializes the source code display component for the HTML example.
```javascript
sourceCode.add('sc1', 'ex1', 'ex1_label', 'css_js_files', 'sc1_description');
sourceCode.make();
```
--------------------------------
### Print Action Button Example
Source: https://github.com/w3c/wai-aria-practices/blob/main/ARIA/apg/patterns/button/examples/button_idl.md
Demonstrates a 'Print' action button using a div element with ARIA 1.2 IDL syntax for attribute reflection. This example is illustrative and not for production.
```html
Print Page
```
--------------------------------
### Initialize Source Code Display
Source: https://github.com/w3c/wai-aria-practices/blob/main/ARIA/apg/patterns/button/examples/button_idl.md
Initializes the source code display component for the HTML example.
```javascript
sourceCode.add('sc1', 'example', 'ex_label', 'css_js_files', 'sc1_description');
sourceCode.make();
```
--------------------------------
### Initialize Source Code Display
Source: https://github.com/w3c/wai-aria-practices/blob/main/ARIA/apg/patterns/treeview/examples/treeview-1b.md
Initializes the source code display for the HTML example using the sourceCode utility.
```javascript
sourceCode.add('sc1', 'ex1', 'start', 'css_js_files', 'sc1_description');
sourceCode.make();
```
--------------------------------
### Alert Pattern Example HTML Structure
Source: https://github.com/w3c/wai-aria-practices/blob/main/ARIA/apg/patterns/alert/examples/alert.md
This HTML sets up the alert pattern example. It includes a button to trigger the alert and a div with the 'alert' role where messages will be displayed. A hidden template provides the content for the alert.
```html
```
--------------------------------
### Link CSS Files for Treeview Example
Source: https://github.com/w3c/wai-aria-practices/blob/main/ARIA/apg/patterns/treeview/examples/treeview-1b.md
These link tags include necessary CSS files for styling the treeview example, including Font Awesome for icons and custom tree styles.
```html
```
--------------------------------
### Include JavaScript Files for Treeview Example
Source: https://github.com/w3c/wai-aria-practices/blob/main/ARIA/apg/patterns/treeview/examples/treeview-1b.md
These script tags include necessary JavaScript files for the treeview example functionality, including utilities, highlighting, and specific treeview logic.
```html
```
--------------------------------
### HTML Navigation Landmark Implementation
Source: https://github.com/w3c/wai-aria-practices/blob/main/content-assets/wai-aria-practices/patterns/landmarks/examples/navigation.html
Examples of using the