docs: add the documentation style guide to this repository (#5132)

`CONTRIBUTING.md` and the Vale rules link to `lancedb/docs`, which is
private, so outside contributors get a 404. Fixes #5070.

This copies the style guide to `docs/STYLE.md` and points the links at
it. The text is the same apart from the intro, which now describes the
scope from this repository's side, and the internal-names bullet, which
no longer lists the names.

The other three links in `CONTRIBUTING.md` went to the docs repository's
README. The draft-section example is now inline. The combined preview
and saved-edition corrections need the private repositories, so the
guide says to ask a maintainer in the pull request instead.

Replaces #5091.
This commit is contained in:
Brendan Clement
2026-11-20 09:47:14 -08:00
committed by GitHub
parent b4459f35e6
commit cfa94f0077
13 changed files with 182 additions and 19 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ come from the `LanceDB.zip` asset of `lancedb/docs` release
The product-terminology rules were added here: `EmbeddedName`,
`RemoteExecution`, `OSSProduct`, `InternalNames`
(warnings) and `LegacyCloud` (suggestion). They enforce the names in the
docs repository's `STYLE.md#names`. Run every rule's tests from
[style guide](../../docs/STYLE.md#names). Run every rule's tests from
`.github/vale` with `vale test --coverage styles`.
Keeping the rules here lets contributors and CI run Vale without access to the
+1 -1
View File
@@ -1,6 +1,6 @@
extends: existence
message: "Avoid '%s' in prose. Use a comma, a colon, parentheses or two sentences."
link: https://github.com/lancedb/docs/blob/main/STYLE.md#punctuation
link: https://github.com/lancedb/lancedb/blob/main/docs/STYLE.md#punctuation
level: warning
nonword: true
# An em dash in prose, and a double hyphen or en dash used as one, with a
+1 -1
View File
@@ -1,6 +1,6 @@
extends: substitution
message: "Use '%s' instead of '%s'."
link: https://github.com/lancedb/docs/blob/main/STYLE.md#names
link: https://github.com/lancedb/lancedb/blob/main/docs/STYLE.md#names
level: warning
ignorecase: false
# The in-process execution model is LanceDB Embedded, whether the data is on
@@ -1,6 +1,6 @@
extends: substitution
message: "Use '%s' instead of the internal name '%s'."
link: https://github.com/lancedb/docs/blob/main/STYLE.md#names
link: https://github.com/lancedb/lancedb/blob/main/docs/STYLE.md#names
level: warning
ignorecase: false
# Internal component names stay out of public text. Environment variables such
+1 -1
View File
@@ -1,6 +1,6 @@
extends: existence
message: "'%s' is the legacy hosted service. Unless the text is specific to it, write 'LanceDB Enterprise'."
link: https://github.com/lancedb/docs/blob/main/STYLE.md#names
link: https://github.com/lancedb/lancedb/blob/main/docs/STYLE.md#names
level: suggestion
ignorecase: false
# A suggestion, because `db://` URIs, `api_key` and `region` for the hosted
+1 -1
View File
@@ -1,6 +1,6 @@
extends: existence
message: "Avoid '%s'. OSS is not a product name: write 'LanceDB Embedded', or 'open source' as a property."
link: https://github.com/lancedb/docs/blob/main/STYLE.md#names
link: https://github.com/lancedb/lancedb/blob/main/docs/STYLE.md#names
level: warning
ignorecase: false
# Bare OSS used as a product, as in "OSS and Enterprise" or "in OSS". "LanceDB
@@ -1,6 +1,6 @@
extends: substitution
message: "Consider '%s' instead of '%s'."
link: https://github.com/lancedb/docs/blob/main/STYLE.md#say-it-directly
link: https://github.com/lancedb/lancedb/blob/main/docs/STYLE.md#say-it-directly
level: suggestion
ignorecase: true
# Keep this list small. Technical nouns such as GPU utilization stay intact.
+1 -1
View File
@@ -1,6 +1,6 @@
extends: substitution
message: "Use '%s' instead of '%s'."
link: https://github.com/lancedb/docs/blob/main/STYLE.md#names
link: https://github.com/lancedb/lancedb/blob/main/docs/STYLE.md#names
level: warning
ignorecase: false
# Case-sensitive. A lowercase package, repository or domain name, such as
@@ -1,6 +1,6 @@
extends: existence
message: "Avoid '%s'. Write 'LanceDB Enterprise' and describe where the operation runs directly."
link: https://github.com/lancedb/docs/blob/main/STYLE.md#names
link: https://github.com/lancedb/lancedb/blob/main/docs/STYLE.md#names
level: warning
ignorecase: false
# Remote storage, remote URLs and a git remote are other things and stay. Class
@@ -1,6 +1,6 @@
extends: existence
message: "'%s' doesn't say what the section covers. Name the task or topic instead."
link: https://github.com/lancedb/docs/blob/main/STYLE.md#headings
link: https://github.com/lancedb/lancedb/blob/main/docs/STYLE.md#headings
level: suggestion
scope: heading
ignorecase: true
+1 -1
View File
@@ -1,6 +1,6 @@
extends: existence
message: "'%s' talks about the writing, not the subject. State the point directly."
link: https://github.com/lancedb/docs/blob/main/STYLE.md#say-it-directly
link: https://github.com/lancedb/lancedb/blob/main/docs/STYLE.md#say-it-directly
level: suggestion
ignorecase: false
scope: sentence
+23 -8
View File
@@ -109,12 +109,13 @@ npm i -g mint@4.2.888
This previews this checkout, including your uncommitted changes. It doesn't
include the other documentation sources or render the availability labels.
Use the [combined preview](https://github.com/lancedb/docs#development) when
checking Enterprise replacements or links to pages from another source.
Checking Enterprise replacements or links to pages from another source needs
the combined site, which maintainers build. Ask for that check in your pull
request if your change needs it.
Staging shows saved release editions, so it won't show a new source change
just because that change merged.
Follow the [style guide](https://github.com/lancedb/docs/blob/main/STYLE.md).
Follow the [style guide](docs/STYLE.md).
[Vale](https://vale.sh) checks wording, names and punctuation using the
[bundled LanceDB rules](.github/vale/README.md). Pull requests show suggestions
on the lines they change. With Vale 3.24.0 installed, check a page locally with:
@@ -182,15 +183,29 @@ You don't need to hold a documentation PR until launch. Use these controls:
comment below the table or list, not between entries.
Drafts remain in the source. Use them to avoid advertising an unfinished
feature, not to keep information confidential. See
[Writing docs before release](https://github.com/lancedb/docs#writing-docs-before-release)
for examples and how to preview a draft.
feature, not to keep information confidential. A draft section looks like
this:
```mdx
{/*
Draft for the Feature X release.
## Feature X {#feature-x}
Feature X does ...
*/}
```
Give the comment lines of its own, with a blank line before and after it. To
see how a draft renders, remove its comment or its `.mintignore` entry in a
local change you don't commit, then run `mint dev`.
Before the intended release, remove the draft controls, restore the navigation
and links, and check the result. Those changes must be in the source commit the
edition uses. A later change to `main` doesn't update an edition already saved.
For a mistake in an existing edition, fix the source and request a
[recorded correction](https://github.com/lancedb/docs#correcting-a-saved-edition).
For a mistake in an existing edition, fix the source and say in the pull
request which editions have the error. A maintainer corrects the saved
editions.
## Release process
+148
View File
@@ -0,0 +1,148 @@
# LanceDB documentation style
Write for developers who want to understand LanceDB and get something done.
Be direct, approachable and technically precise. Give readers enough context
to make a decision, then show them how to act on it.
This guide covers prose on docs.lancedb.com: the pages in this repository's
`docs/web`, including the public Enterprise pages, and the Geneva, dataset and
REST pages kept in other sources. The
[contributing guide](../CONTRIBUTING.md#documentation) covers previewing,
code examples and availability labels.
## Start with the reader's goal
Open with what the feature does and when to use it. Keep the introduction
short. Put prerequisites before the instructions that need them, and explain
limitations beside the choice or operation they affect.
Show the common path before advanced options. A guide should get readers to a
useful result before asking them to compare every configuration. This is a
default, not a required outline for every page.
## Give each page a purpose
A concept page explains a few central ideas and how they relate. A guide helps
readers complete a task. A reference describes exact syntax, options and
behavior. Link to related material with descriptive link text instead of
making every page cover all three roles.
Keep each section focused on the page's purpose. Don't add a conclusion or a
next-steps section unless it helps the reader decide what to do next.
## Teach through examples
Use small datasets, meaningful names and examples that build on each other.
Include the imports, setup and prerequisites readers need, or clearly link to
shared setup. State when successive blocks belong to one program. Show the
expected result when it helps readers understand the operation.
Where equivalent SDK support exists, show Python, TypeScript and Rust
consistently. Use the same task and sample data across languages, with
idiomatic code in each. If support differs, explain the difference beside the
example; don't invent an equivalent API. Prefer fresh example data and make
any destructive behavior explicit.
Explain what an example demonstrates or why an option matters. Avoid narrating
every line when the code already makes its meaning clear.
## Explain choices and consequences
Tell readers when to choose an option and what changes when they do. State the
relevant tradeoff, such as latency versus recall, rather than listing settings
without guidance. Use a table when it makes alternatives easier to compare.
Name the product or component whose behavior you describe. Use LanceDB
Enterprise when you mean the offering; use deployment when you mean a
particular installation or its configuration. Describe concrete capabilities
and benefits without unsupported performance claims or superlatives.
## Say it directly
Address the reader as "you" and prefer active verbs and familiar words.
Introduce unfamiliar terms when readers first need them. Prefer "use" to
"utilize" and "to" to "in order to". Keep technical terms precise: "GPU
utilization", for example, has a specific meaning and does not need replacing.
Describe the subject, not the page or the writing. Instead of "This page is the
concept; the SQL reference is the specification", explain the concept and
link to the reference. Instead of opening with "That matters", state the
consequence. Avoid "simply" and "obviously" when they assume a task is easy for
the reader. These are writing guidelines, not blanket bans on individual words.
## Headings
A heading names the task or topic of its section. "Then what" doesn't; "Choose
an output" does. Prefer specific headings such as "Data durability" to broad
questions such as "What survives?". Use sentence case, preserving product names
and identifiers.
## Names
Write product names exactly: LanceDB, LanceDB Embedded and LanceDB Enterprise.
Write other names as their owners do, such as Hugging Face, LangChain,
TypeScript and Voyage AI.
- **LanceDB Embedded** is the in-process execution model: the SDK runs
database operations inside the application's process and reads Lance tables
directly, from local disk or object storage. Don't write "LanceDB OSS",
"LanceDB Local" or "local mode".
- **LanceDB Enterprise** is the commercial product. Use this name in product
descriptions, SDK documentation and architecture explanations: "a LanceDB
SDK connects to LanceDB Enterprise". Describe execution directly: query
execution, indexing, caching and maintenance run on the service, outside
the application. Write "Embedded and Enterprise" when comparing offerings.
Don't introduce "LanceDB Distributed" as another name for the product or
its execution model. Lowercase "distributed" still describes how a feature
works, such as distributed search, caching or training. Use "Enterprise
table" or "Enterprise connection" in prose; keep API identifiers such as
`RemoteTable` unchanged.
- **LanceDB Cloud** is only the legacy hosted service. Keep it where text is
specific to that service, such as `db://` URIs with an `api_key` and
`region`; otherwise write LanceDB Enterprise.
- **Open source** is a property, not a product: "the open-source LanceDB SDKs",
"Lance is open source". Where free versus paid is the point, write "LanceDB
Embedded (open source)" and "LanceDB Enterprise". Don't use "OSS" as a
product name, as in "OSS vs Enterprise".
- Internal component names stay out of public text. Write "query node",
"executor" and LanceDB Enterprise instead; the `InternalNames` Vale rule
lists the names it catches. Geneva is a product name and stays as is.
Package, module, class and repository names are code, so put them in code
font: `lancedb`, `pyarrow`, `HuggingFaceEmbeddings`.
## Punctuation
Don't use em dashes in prose, or a double hyphen or spaced en dash in place of
one. Use a comma, a colon, parentheses or two sentences. An en dash in a range,
such as 1–3, is fine, and so is a table cell that holds only an em dash to mean
"none".
## Automated checks and review
[Vale](https://vale.sh) checks a small subset of these conventions: product
names, dashes, repeated words, a few vague phrases and headings, and a few
plain-language substitutions. Findings are advisory and appear on changed
lines; they never fail the check. Installation or configuration failures can
still fail it. See the [bundled rules](../.github/vale/README.md) for usage and tests.
Vale cannot verify technical claims, example correctness, SDK coverage or a
page's organization. Review those using implementation evidence, tests and
feature-owner input. Confirm availability and release status with the owner;
do not infer a release promise from an implementation or a passing test.
Reader-visible component titles and captions in MDX attributes are also left
to review because Vale does not inspect those attributes.
Use these guidelines as defaults. Reviewers can make exceptions when they
improve clarity or accuracy.
## Exceptions
When a sentence must break an automated rule, such as a quoted error message,
switch off that rule around it and say why in the pull request:
```mdx
{/* vale LanceDB.Dashes = NO */}
The server returns "Table not found — check the name".
{/* vale LanceDB.Dashes = YES */}
```