You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cap-alerting): add NWS text product parsing for improved readability
Add support for parsing NWS-formatted descriptions in CAP alerts to improve
readability on digital signage. The app now automatically detects and formats
National Weather Service text products that use legacy abbreviated markers.
Features:
- Parse period-based forecasts (.TODAY..., .TONIGHT..., .MON..., etc.)
- Parse Impact Based Warnings in WWWI format (* WHAT..., * WHERE..., * WHEN..., * IMPACTS...)
- Automatic detection based on NWS sender email (w-nws.webmaster@noaa.gov)
- Template-based rendering for consistent styling
Changes:
- Add NWS parser functions to parser.ts
- Add NWS render functions to render.ts
- Create nws.css for NWS-specific styling
- Add HTML templates for NWS content display
- Update README with NWS formatting documentation
- Add comprehensive test coverage (170 tests passing)
The formatted content displays structured information with proper spacing,
bullet points, and color-coded labels for better visibility on screens.
Copy file name to clipboardExpand all lines: edge-apps/cap-alerting/README.md
+46Lines changed: 46 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,52 @@ Display Common Alerting Protocol (CAP) emergency alerts on Screenly digital sign
21
21
22
22
Add tags to your Screenly screens (e.g., `exit:North Lobby`) to provide location-aware exit directions. The app substitutes `{{closest_exit}}` or `[[closest_exit]]` placeholders in alert instructions.
23
23
24
+
## NWS Text Product Formatting
25
+
26
+
The app automatically detects and formats National Weather Service (NWS) CAP alerts that use legacy text formats. This improves readability by converting abbreviated markers into clean, readable text with proper spacing and line breaks.
27
+
28
+
### Supported Formats
29
+
30
+
**1. Period-based Forecasts** (marine forecasts, zone forecasts)
31
+
32
+
Markers: `.TODAY...`, `.TONIGHT...`, `.MON...`, `.SUN NIGHT...`, etc.
33
+
34
+
Example transformation:
35
+
36
+
```
37
+
.TODAY...E wind 20 kt. Seas 11 ft. .TONIGHT...E wind 20 kt.
* WHAT...North winds 25 to 30 kt. * WHERE...Coastal waters. * WHEN...Until 3 AM.
56
+
```
57
+
58
+
becomes:
59
+
60
+
```
61
+
WHAT: North winds 25 to 30 kt.
62
+
63
+
WHERE: Coastal waters.
64
+
65
+
WHEN: Until 3 AM.
66
+
```
67
+
68
+
This formatting only applies to CAP alerts from the NWS sender (`w-nws.webmaster@noaa.gov`).
69
+
24
70
## Override Playlist Integration
25
71
26
72
This app is designed to use Screenly's [Override Playlist API](https://developer.screenly.io/api-reference/v4/#tag/Playlists/operation/override_playlist) to automatically interrupt regular content when alerts are active. Configure your backend to call the API when new CAP alerts are detected.
0 commit comments