Commit Graph
1 Commits
Author SHA1 Message Date
e6e5c56264 docs(pgvector): fix duplicate heading and code block formatting (#48440)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Docs update — small structural and formatting fixes to
`apps/docs/content/guides/database/extensions/pgvector.mdx`.

## What is the current behavior?

**Duplicate `## Usage` heading.** The guide has `## Usage` at two places
— once above "Enable the extension", and again above "Create a table to
store vectors". Anchor IDs are generated from heading text, so both
render as `#usage`. The table of contents shows two identical "Usage"
entries, and clicking the second one scrolls to the first section.

**Untagged code fence.** The iterative-search example uses a bare ```
fence, so it gets no syntax highlighting, unlike every other block on
the page. Its SQL is also uppercase, while the rest of the guide (and
the docs style guide) uses lowercase keywords.

**Stray leading space** before `-- Example: enable the "vector"
extension.` inside the enable-extension SQL block.

**Typo:** the prose says "Transformer.js"; the library is
Transformers.js (the code comment two lines below already spells it
correctly).

## What is the new behavior?

- Second `## Usage` renamed to `## Storing vectors`, which describes the
two subsections it introduces ("Create a table to store vectors" and
"Storing a vector / embedding"). The TOC now has unique entries and
unique anchors.
- Iterative-search fence tagged ` ```sql ` and its keywords lowercased.
- Stray leading space removed.
- "Transformer.js" → "Transformers.js".

Content-only; no components, navigation, or generated output touched.

## Additional context

Before renaming the heading I checked for anything linking to the old
anchor:

```
grep -rn "#usage" apps/docs/content
```

No in-page or cross-file link targets `pgvector#usage` — the hits are
unrelated pages and external URLs — so the rename doesn't break any
links.

Verified locally against the repo's own tooling:

- `supa-mdx-lint` with `supa-mdx-lint.config.toml` → no errors or
warnings (the new heading is sentence case, per `Rule001HeadingCase`).
- Prettier 3.8.1 with `prettier.config.mjs` and
`prettier-plugin-sql-cst` → already formatted, including the newly
tagged `sql` block.

One thing I deliberately left alone: the JS sample still imports
`@xenova/transformers`, which has since been superseded by
`@huggingface/transformers`. That's a behavioral change rather than a
formatting one, so it felt out of scope here — happy to open a separate
PR if you'd like it updated.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Nik Richers <nrichers@gmail.com>
2026-11-03 09:41:13 -07:00