Skip to content

Fix markdown code block languages for code hike - #14856

Merged
gregnr merged 1 commit into
masterfrom
fix/code-hike-snippet-langs
Jun 7, 2023
Merged

gregnr merged 1 commit into
masterfrom
fix/code-hike-snippet-langs

Conversation

@gregnr

@gregnr gregnr commented Jun 7, 2023

Copy link
Copy Markdown
Member

Some of our markdown code blocks use languages not supported by code hike. Switches them to better/supported languages.

@gregnr
gregnr requested a review from a team as a code owner June 7, 2023 02:07
@vercel

vercel Bot commented Jun 7, 2023 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 7, 2023 2:19am
studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 7, 2023 2:19am
studio-self-hosted ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 7, 2023 2:19am
studio-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 7, 2023 2:19am
supabase-studio-prod ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 7, 2023 2:19am
supabase-studio-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 7, 2023 2:19am
zone-www-dot-com ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 7, 2023 2:19am

@gregnr
gregnr merged commit 897de81 into master Jun 7, 2023
@gregnr
gregnr deleted the fix/code-hike-snippet-langs branch June 7, 2023 02:40
antlio pushed a commit that referenced this pull request Nov 20, 2026
## Problem

Three code blocks in the docs guides use the wrong language tag, so they
are highlighted and type-checked as JavaScript or TypeScript instead of
what they are:

- `guides/database/arrays.mdx`: a SQL query is tagged `js`
- `guides/database/import-data.mdx`: the `pgloader config.load` command
is tagged `jsx`
- `guides/ai/hybrid-search.mdx`: a cURL command is tagged `tsx`

The docs style guide says JavaScript and TypeScript blocks get type
hints and are formatted by Prettier, which does not apply to these
blocks.

## Solution

Retag the blocks: `sql` for the query and `bash` for the two shell
commands (`bash` is the most common shell tag in the guides).

For the SQL block I also lowercased the keywords, per the style guide's
"Prefer lowercase for SQL". Prettier's SQL plugin rewrites
`textarray[1]` to `textarray as [1]`, which is not valid Postgres, so
the block is preceded by `{/* prettier-ignore */}`, the same convention
already used in `guides/ai/engineering-for-scale.mdx` and
`guides/api/query-plans.mdx`.

Earlier PRs fixed the same kind of problem: #11870, #19033, #14856,
#11235.

## Review instructions

1. Open the diff: only the language tags change, plus the lowercase SQL
and the `prettier-ignore` comment in `arrays.mdx`.
2. Check the three pages in the preview: the SQL block in the SQL tab of
"Working with arrays", the `pgloader` step in "Import data into
Supabase", and the cURL block in "Hybrid search".
3. Run `pnpm test:prettier`. It passes for these files with the repo's
`prettier.config.mjs`.

## Checklist

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide).
(Not run: this edit only changes code fence languages, and I applied the
style guide's code block rules by hand.)

Co-authored-by: Santhosh-x23 <[email protected]>

This branch was successfully deployed

7 active deployments
Preview – docs — da3057df Deployed Jun 7, 2023 by vercel[bot]
Preview – supabase-studio-prod — da3057df Deployed Jun 7, 2023 by vercel[bot]
Preview – studio-self-hosted — da3057df Deployed Jun 7, 2023 by vercel[bot]
Preview – studio — da3057df Deployed Jun 7, 2023 by vercel[bot]
Preview – zone-www-dot-com — da3057df Deployed Jun 7, 2023 by vercel[bot]
Preview – supabase-studio-staging — da3057df Deployed Jun 7, 2023 by vercel[bot]
Preview – studio-staging — da3057df Deployed Jun 7, 2023 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants