Skip to content

Commit ee2a182

Browse files
authored
Snowflake docs: Create searchable features page like for AWS Services (#418)
1 parent 37ba272 commit ee2a182

File tree

9 files changed

+128
-13
lines changed

9 files changed

+128
-13
lines changed

astro.config.mjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,7 @@ export default defineConfig({
490490
},
491491
{
492492
label: 'Features',
493-
collapsed: true,
494-
autogenerate: { directory: '/snowflake/features' },
493+
slug: 'snowflake/features',
495494
},
496495
{
497496
label: 'Sample Apps',
@@ -517,6 +516,10 @@ export default defineConfig({
517516
collapsed: true,
518517
autogenerate: { directory: '/snowflake/tutorials' },
519518
},
519+
{
520+
label: 'Feature Coverage',
521+
slug: 'snowflake/feature-coverage',
522+
},
520523
{
521524
label: 'SQL Functions',
522525
slug: 'snowflake/sql-functions',

public/_redirects

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,4 +819,4 @@
819819
/aws/user-guide/ci /aws/integrations/continuous-integration/ 301
820820
/aws/user-guide/ci/ /aws/integrations/continuous-integration/ 301
821821
/aws/tooling/lambda-tools/vscode-extension/ /aws/tooling/vscode-extension/ 301
822-
/aws/tooling/lambda-tools/vscode-extension /aws/tooling/vscode-extension/ 301
822+
/aws/tooling/lambda-tools/vscode-extension /aws/tooling/vscode-extension/ 301

public/js/icon-loader.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
'Getting Started': 'rocket-icon',
99
'Local AWS Services': 'cube-icon',
1010
Features: 'cube-icon',
11+
'Feature Coverage': 'buildings-icon',
1112
'Sample Apps': 'file-icon',
1213
Capabilities: 'starburst-icon',
1314
Tooling: 'wrench-icon',
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
import { getCollection } from 'astro:content';
3+
import { SearchableSnowflakeFeatures } from './SearchableSnowflakeFeatures.tsx';
4+
5+
const allFeatures = await getCollection('docs', ({ id }) => {
6+
return id.startsWith('snowflake/features/') && !id.includes('/index');
7+
});
8+
9+
const sortedFeatures = allFeatures.sort((a, b) => {
10+
const titleA = a.data.title || a.data.linkTitle || '';
11+
const titleB = b.data.title || b.data.linkTitle || '';
12+
return titleA.localeCompare(titleB);
13+
});
14+
15+
const featureData = sortedFeatures.map(feature => {
16+
const title = feature.data.title || feature.data.linkTitle || 'Unknown Feature';
17+
const description = feature.data.description || `Implementation details for ${title}`;
18+
19+
const href = `/${feature.id}`;
20+
21+
return {
22+
title,
23+
description,
24+
href
25+
};
26+
});
27+
---
28+
29+
<SearchableSnowflakeFeatures features={featureData} client:load />
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import React, { useState, useMemo } from 'react';
2+
import { ServiceBox } from './ServiceBox.tsx';
3+
4+
interface Feature {
5+
title: string;
6+
description: string;
7+
href: string;
8+
}
9+
10+
interface SearchableSnowflakeFeaturesProps {
11+
features: Feature[];
12+
}
13+
14+
export const SearchableSnowflakeFeatures: React.FC<SearchableSnowflakeFeaturesProps> = ({ features }) => {
15+
const [searchTerm, setSearchTerm] = useState('');
16+
17+
const filteredFeatures = useMemo(() => {
18+
if (!searchTerm.trim()) {
19+
return features;
20+
}
21+
22+
const lowercaseSearch = searchTerm.toLowerCase();
23+
return features.filter(feature =>
24+
feature.title.toLowerCase().includes(lowercaseSearch) ||
25+
feature.description.toLowerCase().includes(lowercaseSearch)
26+
);
27+
}, [features, searchTerm]);
28+
29+
return (
30+
<div className="searchable-services">
31+
<div className="search-container">
32+
<div className="search-input-wrapper">
33+
<svg
34+
className="search-icon"
35+
fill="none"
36+
stroke="currentColor"
37+
viewBox="0 0 24 24"
38+
xmlns="http://www.w3.org/2000/svg"
39+
>
40+
<path
41+
strokeLinecap="round"
42+
strokeLinejoin="round"
43+
strokeWidth={2}
44+
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
45+
/>
46+
</svg>
47+
<input
48+
type="text"
49+
placeholder="Search for Snowflake Feature ..."
50+
value={searchTerm}
51+
onChange={(e) => setSearchTerm(e.target.value)}
52+
className="search-input"
53+
/>
54+
</div>
55+
</div>
56+
57+
{filteredFeatures.length === 0 && searchTerm.trim() ? (
58+
<div className="no-results">
59+
<p>No features found matching "{searchTerm}"</p>
60+
</div>
61+
) : (
62+
<div className="service-grid">
63+
{filteredFeatures.map((feature, index) => (
64+
<ServiceBox
65+
key={`${feature.href}-${index}`}
66+
title={feature.title}
67+
description={feature.description}
68+
href={feature.href}
69+
/>
70+
))}
71+
</div>
72+
)}
73+
</div>
74+
);
75+
};

src/content/docs/snowflake/features/index.md renamed to src/content/docs/snowflake/feature-coverage.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
21
---
32
title: "Feature Coverage"
43
linkTitle: "Feature Coverage"
5-
weight: 1
6-
description: >
7-
Overview of the implemented Snowflake features in LocalStack
8-
cascade:
9-
type: docs
4+
description: Overview of the implemented Snowflake resource types and operations in LocalStack
5+
template: doc
6+
editUrl: false
107
hide_readingtime: true
118
---
129

@@ -15,7 +12,6 @@ hide_readingtime: true
1512
This page provides a list of Snowflake query features (resource types and operations) that are supported in the LocalStack emulator.
1613
The content will be updated as additional query features and functions are implemented.
1714

18-
1915
### Applications
2016
| |ALTER|CREATE|DESCRIBE|DROP|SHOW|
2117
|----|----|----|----|----|----|
@@ -170,4 +166,3 @@ The content will be updated as additional query features and functions are imple
170166
| |ALTER|CREATE|DESCRIBE|DROP|SHOW|USE|
171167
|----|----|----|----|----|----|----|
172168
|**WAREHOUSE**|||||||
173-
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: "Features"
3+
linkTitle: "Features"
4+
description: Browse LocalStack's implemented Snowflake features and explore their capabilities
5+
template: doc
6+
editUrl: false
7+
hide_readingtime: true
8+
---
9+
10+
import SearchableSnowflakeFeatures from '../../../components/SearchableSnowflakeFeatures.astro';
11+
12+
<SearchableSnowflakeFeatures />

src/content/docs/snowflake/getting-started/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Yes, the LocalStack for Snowflake supports the Snowflake v2 SQL API (`/api/v2/*`
1414

1515
### Why are my Snowflake tests failing?
1616

17-
LocalStack for Snowflake is now GA. If your tests are failing, it could be due to a lack of support for certain Snowflake features. We recommend checking the [function coverage](/snowflake/sql-functions/) to see the list of supported SQL functions and [feature coverage](/snowflake/features/) to see the list of supported features. If you encounter any issues, you can connect with us for [support](#support-faqs).
17+
LocalStack for Snowflake is now GA. If your tests are failing, it could be due to a lack of support for certain Snowflake features. We recommend checking the [function coverage](/snowflake/sql-functions/) to see the list of supported SQL functions and [feature coverage](/snowflake/feature-coverage/) to see the list of supported features. If you encounter any issues, you can connect with us for [support](#support-faqs).
1818

1919
### Why does the LocalStack for Snowflake run on `snowflake.localhost.localstack.cloud`?
2020

src/content/docs/snowflake/getting-started/quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ Now that you've completed the quickstart, here are some additional features you
240240

241241
You can now explore the following resources to learn more about the Snowflake emulator:
242242

243-
- [Features](/snowflake/features/): Learn about the Snowflake emulator's features and how to use them.
243+
- [Feature Coverage](/snowflake/feature-coverage/): Learn about the Snowflake emulator's features and how to use them.
244244
- [Capabilities](/snowflake/capabilities/): Find information about the Snowflake emulator's capabilities and how to use them.
245245

246246
:::note

0 commit comments

Comments
 (0)