Interactive interface for browsing global, full-resolution satellite imagery
WV-4096 replace showdown package (#6897)
vicgonzalez25edb2760c0098
diff --git a/config/default/common/config/metadata/layers/airs/AIRS_Prata_SO2_Index_Day.md b/config/default/common/config/metadata/layers/airs/AIRS_Prata_SO2_Index_Day.mdindex 782600137..f1b775005 100644--- a/config/default/common/config/metadata/layers/airs/AIRS_Prata_SO2_Index_Day.md+++ b/config/default/common/config/metadata/layers/airs/AIRS_Prata_SO2_Index_Day.md@@ -2,4 +2,4 @@ The AIRS Prata SO2 Index (Day) layer indicates Sulfur Dioxide column amounts inThe Atmospheric Infrared Sounder (AIRS) is an instrument on board the Aqua satellite. The AIRS Prata SO2 Index science parameter is a derived parameter from the Level 1B Near-Real Time Infrared (IR) geolocated and calibrated radiances, (AIRIBRAD_NRT). The imagery resolution is 2 km and sensor resolution is 45 km. The temporal resolution is daily.-References: [AIRIBRAD_NRT] (https://disc.gsfc.nasa.gov/datasets/AIRIBRAD_NRT_005/summary)\ No newline at end of file+References: [AIRIBRAD_NRT](https://disc.gsfc.nasa.gov/datasets/AIRIBRAD_NRT_005/summary)\ No newline at end of filediff --git a/config/default/common/config/metadata/layers/airs/AIRS_Prata_SO2_Index_Night.md b/config/default/common/config/metadata/layers/airs/AIRS_Prata_SO2_Index_Night.mdindex d77bff3c4..78ae2f4c3 100644--- a/config/default/common/config/metadata/layers/airs/AIRS_Prata_SO2_Index_Night.md+++ b/config/default/common/config/metadata/layers/airs/AIRS_Prata_SO2_Index_Night.md@@ -2,4 +2,4 @@ The AIRS Prata SO2 Index (Night) layer indicates Sulfur Dioxide column amounts iThe Atmospheric Infrared Sounder (AIRS) is an instrument on board the Aqua satellite. The AIRS Prata SO2 Index science parameter is a derived parameter from the Level 1B Near-Real Time Infrared (IR) geolocated and calibrated radiances, (AIRIBRAD_NRT). The imagery resolution is 2 km and sensor resolution is 45 km. The temporal resolution is daily.-References: [AIRIBRAD_NRT] (https://disc.gsfc.nasa.gov/datasets/AIRIBRAD_NRT_005/summary)+References: [AIRIBRAD_NRT](https://disc.gsfc.nasa.gov/datasets/AIRIBRAD_NRT_005/summary)diff --git a/config/default/common/config/metadata/layers/modis/aqua/MODIS_Aqua_L3_Land_Surface_Temp_Daily_Day_TES.md b/config/default/common/config/metadata/layers/modis/aqua/MODIS_Aqua_L3_Land_Surface_Temp_Daily_Day_TES.mdindex 8759dffc9..6535f817b 100644--- a/config/default/common/config/metadata/layers/modis/aqua/MODIS_Aqua_L3_Land_Surface_Temp_Daily_Day_TES.md+++ b/config/default/common/config/metadata/layers/modis/aqua/MODIS_Aqua_L3_Land_Surface_Temp_Daily_Day_TES.md@@ -2,7 +2,7 @@ The Land Surface Temperature (L3, Daily, Day) layer is from the new Land SurfaceThe MOD/MYD21 Temperature/Emissivity Separation (TES) algorithm is a physics-based algorithm used to dynamically retrieve both LST and spectral emissivity simultaneously from the MODIS thermal infrared (TIR) bands 29, 31, and 32. The TES algorithm is combined with an improved Water Vapor Scaling (WVS) atmospheric correction scheme to stabilize the retrieval during warm and humid conditions. The MOD/MYD21 LST&E algorithm differs from the MOD11/MYD11 L2 algorithm in that the MOD21/MYD21 algorithm is based on the ASTER TES technique, whereas the MOD11/MYD11 L2 products uses a generalized split-window (GSW) technique. MOD/MYD21 addresses the 3-5 K cold bias over desert regions that currently exists with the MOD/MYD11 LST product, and using the TES algorithm allows a dynamical retrieval of land surface emissivity for all MODIS TIR bands 29, 31, and 32. Users are encourage to read the [current validation status report](https://modis-land.gsfc.nasa.gov/pdf/MOD21_MOD11_report.pdf) to better understand differences between these two products.-The MYD21A1D dataset is produced daily from daytime Level 2 Gridded (L2G) intermediate LST products. The L2G process maps the daily [MYD21](https://doi.org/10.5067/MODIS/MYD21.061) swath granules onto a sinusoidal MODIS grid and stores all observations falling over a gridded cell for a given day. The MOD21A1 algorithm sorts through all these observations for each cell and estimates the final LST value as an average from all observations that are cloud free and have good LST&E accuracies. The daytime average is weighted by the observation coverage for that cell. Only observations having observation coverage more than a certain threshold (15%) are considered for this averaging. Additional details regarding the methodology used to create this Level 3 (L3) product are available in the Algorithm Theoretical Basis Document [(ATBD)] (https://lpdaac.usgs.gov/documents/1399/MOD21_ATBD.pdf).+The MYD21A1D dataset is produced daily from daytime Level 2 Gridded (L2G) intermediate LST products. The L2G process maps the daily [MYD21](https://doi.org/10.5067/MODIS/MYD21.061) swath granules onto a sinusoidal MODIS grid and stores all observations falling over a gridded cell for a given day. The MOD21A1 algorithm sorts through all these observations for each cell and estimates the final LST value as an average from all observations that are cloud free and have good LST&E accuracies. The daytime average is weighted by the observation coverage for that cell. Only observations having observation coverage more than a certain threshold (15%) are considered for this averaging. Additional details regarding the methodology used to create this Level 3 (L3) product are available in the Algorithm Theoretical Basis Document [(ATBD)](https://lpdaac.usgs.gov/documents/1399/MOD21_ATBD.pdf).The MODIS Land Surface Temperature product is available from both Terra (MOD21) and Aqua (MYD21) satellites. The sensor and imagery resolution is 1 km, and the temporal resolution is daily.diff --git a/config/default/common/config/metadata/stories/explore_the_earth_at_night/step006.md b/config/default/common/config/metadata/stories/explore_the_earth_at_night/step006.mdindex 1eb6033bc..755ad98dd 100644--- a/config/default/common/config/metadata/stories/explore_the_earth_at_night/step006.md+++ b/config/default/common/config/metadata/stories/explore_the_earth_at_night/step006.md@@ -1,2 +1,3 @@<p>Note the bright highway lights between Chicago and Rockford, Il along I-90, where the road had expanded from two to four lanes. </p>+Find out more: [Earth Observatory - Observing Changes in Nighttime Lights](https://earthobservatory.nasa.gov/images/91431/observing-changes-in-nighttime-lights)diff --git a/config/default/common/config/metadata/stories/sunglint/step002.md b/config/default/common/config/metadata/stories/sunglint/step002.mdindex 2787f7781..2fb98f12d 100644--- a/config/default/common/config/metadata/stories/sunglint/step002.md+++ b/config/default/common/config/metadata/stories/sunglint/step002.md@@ -1,2 +1,3 @@<p>Here you can see sunglint areas roughly in the center of each of these Moderate Resolution Imaging Spectroradiometer (MODIS) sensor/Terra satellite swaths over the ocean. You may also be wondering what the black areas of missing imagery near the equator are too! This occurs with MODIS/Terra and MODIS/Aqua imagery because the swath width is only 2,330km wide and each subsequent swath does not overlap with the previous swath at the equator.</p>+Check out the [Swath Gaps tour story](https://go.nasa.gov/31JwFPt) to learn more!diff --git a/e2e/test-utils/global-variables/selectors.js b/e2e/test-utils/global-variables/selectors.jsindex ff507f5fb..b0c934452 100644--- a/e2e/test-utils/global-variables/selectors.js+++ b/e2e/test-utils/global-variables/selectors.js@@ -175,7 +175,7 @@ module.exports = (page) => ({layerContainer: page.locator('.layer-container.sidebar-panel'),sourceMetadataCollapsed: page.locator('.source-metadata.overflow'),sourceMetadataExpanded: page.locator('.source-metadata'),- aquaTerraModisHeader: page.locator('#aboutaerosolopticaldepthaod'),+ aquaTerraModisHeader: page.getByRole('heading', { name: 'About Aerosol Optical Depth (AOD)' }),maiacHeader: page.locator('#aerosol-optical-depth-aqua-terra-modis h3:last-of-type'),sourceTabs: page.locator('.source-nav-item'),aodSearchRow: page.locator('#MODIS_Aqua_Aerosol-search-row'),diff --git a/package-lock.json b/package-lock.jsonindex e2a387c57..83f680a85 100644--- a/package-lock.json+++ b/package-lock.json@@ -122,6 +122,7 @@"jest-canvas-mock": "^2.5.8","jest-environment-jsdom": "^30.4.1","jest-fetch-mock": "^4.2.0",+ "markdown-it": "^15.0.0","mini-css-extract-plugin": "^2.10.2","neostandard": "^0.13.0","node-dir": "^0.1.17",@@ -137,7 +138,6 @@"sass": "^1.102.0","sass-loader": "^17.0.0","shelljs": "^0.10.0",- "showdown": "^2.1.0","stylelint": "^17.14.1","stylelint-config-standard-scss": "^16.0.0","stylelint-high-performance-animation": "^1.11.0",@@ -7223,14 +7223,6 @@"node": ">= 0.8"}},- "node_modules/commander": {- "version": "9.5.0",- "dev": true,- "license": "MIT",- "engines": {- "node": "^12.20.0 || >=14"- }- },"node_modules/complex.js": {"version": "2.4.3","resolved": "https://registry.npmjs.org/complex.js/-/complex.js-2.4.3.tgz",@@ -13168,6 +13160,26 @@"version": "1.2.4","license": "MIT"},+ "node_modules/linkify-it": {+ "version": "6.1.0",+ "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-6.1.0.tgz",+ "integrity": "sha512-wJ/TwpSDTLepCrQoYWYIExIKg5Zchex2Nn5yk2mFnB+6PtdkHtyLx742md9csRjjOnGkKIS/RrbY7l8D6gT9Vw==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/puzrin"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/markdown-it"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "uc.micro": "^3.0.0"+ }+ },"node_modules/load-json-file": {"version": "4.0.0","dev": true,@@ -13341,6 +13353,64 @@"version": "3.2.0","license": "BSD-2-Clause"},+ "node_modules/markdown-it": {+ "version": "15.0.0",+ "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-15.0.0.tgz",+ "integrity": "sha512-Lf8ajvVNdRpzSNB4VegxNy7gjs8gU35l4b4+ET49LrQC5PKYwLZ72u60LeJ9gv3qiaesuYjJWCyVeQmv/QWKQw==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/puzrin"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/markdown-it"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "argparse": "^3.0.0",+ "entities": "^8.0.0",+ "linkify-it": "^6.0.0",+ "mdurl": "^2.1.0",+ "punycode.js": "^2.3.1",+ "uc.micro": "^3.0.0"+ },+ "bin": {+ "markdown-it": "bin/markdown-it.mjs"+ }+ },+ "node_modules/markdown-it/node_modules/argparse": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-3.0.0.tgz",+ "integrity": "sha512-BOp5NMrHqKxmq/OLr+clzzrRxgOKSLkcjmkWuChp7Irqwn4s74WjOBPIgWfA/HMcBnVkZ5XEuf9uUqzlpfCQ6A==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/puzrin"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/nodeca"+ }+ ],+ "license": "Python-2.0"+ },+ "node_modules/markdown-it/node_modules/entities": {+ "version": "8.0.0",+ "resolved": "https://registry.npmjs.org/entities/-/entities-8.0.0.tgz",+ "integrity": "sha512-zwfzJecQ/Uej6tusMqwAqU/6KL2XaB2VZ2Jg54Je6ahNBGNH6Ek6g3jjNCF0fG9EWQKGZNddNjU5F1ZQn/sBnA==",+ "dev": true,+ "license": "BSD-2-Clause",+ "engines": {+ "node": ">=20.19.0"+ },+ "funding": {+ "url": "https://github.com/fb55/entities?sponsor=1"+ }+ },"node_modules/masonry-layout": {"version": "4.2.2","license": "MIT",@@ -13393,6 +13463,13 @@"dev": true,"license": "CC0-1.0"},+ "node_modules/mdurl": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.1.0.tgz",+ "integrity": "sha512-1+HBaOx0zi/dQWht8rNv9MYf9qqpqL/kxI0hXImU6Y547zM6Sni8BQibt7ifgMcYtQg41ao3Ivd6cnSM86inpg==",+ "dev": true,+ "license": "MIT"+ },"node_modules/media-typer": {"version": "1.1.0","dev": true,@@ -15842,6 +15919,16 @@"node": ">=6"}},+ "node_modules/punycode.js": {+ "version": "2.3.1",+ "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz",+ "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },"node_modules/pure-rand": {"version": "7.0.1","dev": true,@@ -17178,21 +17265,6 @@"node": ">=18"}},- "node_modules/showdown": {- "version": "2.1.0",- "dev": true,- "license": "MIT",- "dependencies": {- "commander": "^9.0.0"- },- "bin": {- "showdown": "bin/showdown.js"- },- "funding": {- "type": "individual",- "url": "https://www.paypal.me/tiviesantos"- }- },"node_modules/side-channel": {"version": "1.1.1","license": "MIT",@@ -18900,6 +18972,13 @@"node": "*"}},+ "node_modules/uc.micro": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-3.0.0.tgz",+ "integrity": "sha512-U3PppEkleoTnIfi8BozMx3yju3qc/L6SwqWo2Sw+54PX+PX0q9I+r1Um5HCmqD7n9VDX5/v3vQH/AjA6deDdtw==",+ "dev": true,+ "license": "MIT"+ },"node_modules/unbox-primitive": {"version": "1.1.0","dev": true,diff --git a/package.json b/package.jsonindex 12e72614c..4cccb9d41 100644--- a/package.json+++ b/package.json@@ -126,6 +126,7 @@"jest-canvas-mock": "^2.5.8","jest-environment-jsdom": "^30.4.1","jest-fetch-mock": "^4.2.0",+ "markdown-it": "^15.0.0","mini-css-extract-plugin": "^2.10.2","neostandard": "^0.13.0","node-dir": "^0.1.17",@@ -141,7 +142,6 @@"sass": "^1.102.0","sass-loader": "^17.0.0","shelljs": "^0.10.0",- "showdown": "^2.1.0","stylelint": "^17.14.1","stylelint-config-standard-scss": "^16.0.0","stylelint-high-performance-animation": "^1.11.0",diff --git a/tasks/util/config.js b/tasks/util/config.jsindex b89c33bd8..b50da4bc7 100755--- a/tasks/util/config.js+++ b/tasks/util/config.js@@ -1,22 +1,28 @@const fs = require('fs')const { globSync } = require('glob')-const showdown = require('showdown')+const MarkdownIt = require('markdown-it')const shell = require('shelljs')const console = require('console')console.log('Converting markdown to html')-const converter = new showdown.Converter({- openLinksInNewWindow: true,- // don't require escaping underscores in the middle of a word- literalMidWordUnderscores: true-})+// html: the metadata markdown embeds raw HTML (<sup>, <br>, <a>) that must pass through+const md = new MarkdownIt({ html: true, linkify: false, typographer: false })++// Open links generated from markdown in a new window+const defaultLinkOpen = md.renderer.rules.link_open ||+ ((tokens, idx, options, env, self) => self.renderToken(tokens, idx, options, env, self))+md.renderer.rules.link_open = (tokens, idx, options, env, self) => {+ tokens[idx].attrSet('target', '_blank')+ tokens[idx].attrSet('rel', 'noopener noreferrer')+ return defaultLinkOpen(tokens, idx, options, env, self)+}const configFiles = globSync('build/options/config/metadata/**/*.md')const aboutFiles = globSync('build/options/brand/about/*.md')function convertMDtoHTML (mdFiles) {for (const mdFile of mdFiles) {const dest = mdFile.replace(/\.md$/, '.html')const markdown = fs.readFileSync(mdFile, { encoding: 'utf-8' })- const html = converter.makeHtml(markdown)+ const html = md.render(markdown)fs.writeFileSync(dest, html)}}