Skip to content

Commit 342b0c5

Browse files
authored
feat: Add tables search box (#8672)
<!-- 🎉 Thank you for making CloudQuery awesome by submitting a PR 🎉 --> #### Summary Fixes #8154. The PR uses `getStaticProps` and `getStaticPaths` (the latter with an empty paths result) to load all tables on demand. Once the table link is accessed it is generated and cached forever. Based on https://github.com/shuding/nextra/blob/2f7f5516a66782ac3d6a02d427a34075504f4151/examples/swr-site/pages/remote/%5Bslug%5D.mdx?plain=1#L2. Interesting bits are: - `tables.ts` to create the search data - `Search.tsx` search component - `Makefile` changes to put the files in the right place and normalize the links to match the Website sturcture - `[table].mdx` files to generate the content on demand
1 parent 9a680c6 commit 342b0c5

File tree

1,579 files changed

+6167
-4013
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,579 files changed

+6167
-4013
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
plugins/source/**/docs/tables/README.md linguist-generated
21
website/pages/docs/plugins/sources/**/tables.md linguist-generated
2+
website/tables/**/* linguist-generated

.github/workflows/broken_links.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ jobs:
7373
7474
npx broken-link-checker --requests 100 --host-requests 10 -f -r -v -o --filter-level 3 \
7575
--exclude "${{ steps.vercel.outputs.url }}/logo" \
76+
--exclude "${{ steps.vercel.outputs.url }}/docs/plugins/sources/*/tables" \
7677
--exclude linkedin \
7778
--exclude cloudquery.io/discord \
7879
--exclude fonts.gstatic.com \

.github/workflows/lint_markdown.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Vale
1818
uses: errata-ai/vale-action@v2
1919
with:
20-
vale_flags: "--glob=!{website/pages/blog/podcast-software-engineer-daily.md,*CHANGELOG.md,*/docs/tables/*,.github/styles/proselint/README.md,**/v1-migration.md,website/pages/docs/plugins/sources/*/tables.md,website/pages/docs/plugins/sources/*/policies.md}"
20+
vale_flags: "--glob=!{website/pages/blog/podcast-software-engineer-daily.md,*CHANGELOG.md,*/docs/tables/README.md,plugins/source/test/docs/tables/*.md,.github/styles/proselint/README.md,**/v1-migration.md,website/pages/docs/plugins/sources/*/tables.md,website/pages/docs/plugins/sources/*/policies.md,website/tables/**/*}"
2121
filter_mode: nofilter
2222
fail_on_error: true
2323
env:
@@ -32,4 +32,4 @@ jobs:
3232
with:
3333
files: .
3434
config_file: .markdownlint.yaml
35-
ignore_files: '{website/pages/blog/podcast-software-engineer-daily.md,**/CHANGELOG.md,**/docs/tables/**,website/pages/docs/reference/cli/**}'
35+
ignore_files: '{website/pages/blog/podcast-software-engineer-daily.md,**/CHANGELOG.md,**/docs/tables/README.md,plugins/source/test/docs/tables/*.md,website/pages/docs/reference/cli/**,website/tables/**/*}'

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ go.work.sum.backup
2828
cli/examples
2929
cli/cli
3030
__tables.json
31-
__debug_bin
31+
__debug_bin
32+
.vercel

plugins/source/alicloud/Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,12 @@ gen-mocks:
2828

2929
.PHONY: gen-docs
3030
gen-docs:
31-
rm -rf ./docs/tables/*
32-
go run main.go doc ./docs/tables
33-
sed 's_(\(.*\))_(https://github.com/cloudquery/cloudquery/blob/main/plugins/source/alicloud/docs/tables/\1)_' docs/tables/README.md > ../../../website/pages/docs/plugins/sources/alicloud/tables.md
31+
rm -rf ../../../website/tables/alicloud
32+
go run main.go doc ../../../website/tables/alicloud
33+
sed -i.bak -e 's_(\(.*\).md)_(tables/\1)_' ../../../website/tables/alicloud/README.md
34+
mv ../../../website/tables/alicloud/README.md ../../../website/pages/docs/plugins/sources/alicloud/tables.md
35+
sed -i.bak -e 's_(\(.*\).md)_(\1)_' ../../../website/tables/alicloud/*.md
36+
rm -rf ../../../website/tables/alicloud/*.bak
3437

3538
.PHONY: build
3639
build:
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
11
# Source Plugin: alicloud
22

3-
## Tables
4-
5-
- [alicloud_bss_bill](alicloud_bss_bill.md)
6-
- [alicloud_bss_bill_overview](alicloud_bss_bill_overview.md)
7-
- [alicloud_ecs_instances](alicloud_ecs_instances.md)
8-
- [alicloud_oss_buckets](alicloud_oss_buckets.md)
9-
- [alicloud_oss_bucket_stats](alicloud_oss_bucket_stats.md)
3+
Plugins tables are now part of our Website. Please visit [https://www.cloudquery.io/docs/plugins/sources/alicloud/tables](https://www.cloudquery.io/docs/plugins/sources/alicloud/tables) for the latest information.

plugins/source/aws/Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,17 @@ gen-mocks:
2323

2424
.PHONY: gen-docs
2525
gen-docs:
26-
rm -rf ./docs/tables/*
27-
go run main.go doc ./docs/tables
28-
sed 's_(\(.*\))_(https://github.com/cloudquery/cloudquery/blob/main/plugins/source/aws/docs/tables/\1)_' docs/tables/README.md > ../../../website/pages/docs/plugins/sources/aws/tables.md
2926
go run main.go doc --format json docs
3027
go run scripts/policy_docs/main.go aws policies ../../../website/pages/docs/plugins/sources/aws/policies.md docs/__tables.json
3128
rm docs/__tables.json
3229

30+
rm -rf ../../../website/tables/aws
31+
go run main.go doc ../../../website/tables/aws
32+
sed -i.bak -e 's_(\(.*\).md)_(tables/\1)_' ../../../website/tables/aws/README.md
33+
mv ../../../website/tables/aws/README.md ../../../website/pages/docs/plugins/sources/aws/tables.md
34+
sed -i.bak -e 's_(\(.*\).md)_(\1)_' ../../../website/tables/aws/*.md
35+
rm -rf ../../../website/tables/aws/*.bak
36+
3337
# All gen targets
3438
.PHONY: gen
3539
gen: gen-mocks gen-docs

plugins/source/aws/docs/tables/README.md

Lines changed: 1 addition & 540 deletions
Large diffs are not rendered by default.

plugins/source/awspricing/Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ lint:
88

99
.PHONY: gen-docs
1010
gen-docs:
11-
rm -rf ./docs/tables/*
12-
go run main.go doc ./docs/tables
13-
sed 's_(\(.*\))_(https://github.com/cloudquery/cloudquery/blob/main/plugins/source/awspricing/docs/tables/\1)_' docs/tables/README.md > ../../../website/pages/docs/plugins/sources/awspricing/tables.md
11+
rm -rf ../../../website/tables/awspricing
12+
go run main.go doc ../../../website/tables/awspricing
13+
sed -i.bak -e 's_(\(.*\).md)_(tables/\1)_' ../../../website/tables/awspricing/README.md
14+
mv ../../../website/tables/awspricing/README.md ../../../website/pages/docs/plugins/sources/awspricing/tables.md
15+
sed -i.bak -e 's_(\(.*\).md)_(\1)_' ../../../website/tables/awspricing/*.md
16+
rm -rf ../../../website/tables/awspricing/*.bak
1417

1518
# All gen targets
1619
.PHONY: gen
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
# Source Plugin: awspricing
22

3-
## Tables
4-
5-
- [awspricing_services](awspricing_services.md)
6-
- [awspricing_service_products](awspricing_service_products.md)
7-
- [awspricing_service_terms](awspricing_service_terms.md)
3+
Plugins tables are now part of our Website. Please visit [https://www.cloudquery.io/docs/plugins/sources/awspricing/tables](https://www.cloudquery.io/docs/plugins/sources/awspricing/tables) for the latest information.

0 commit comments

Comments
 (0)