From cfa94f007791485bbe988bf4957d8ee148ae0438 Mon Sep 17 00:00:00 2001 From: Brendan Clement Date: Fri, 20 Nov 2026 09:47:14 -0800 Subject: [PATCH] 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. --- .github/vale/README.md | 2 +- .github/vale/styles/LanceDB/Dashes.yml | 2 +- .github/vale/styles/LanceDB/EmbeddedName.yml | 2 +- .github/vale/styles/LanceDB/InternalNames.yml | 2 +- .github/vale/styles/LanceDB/LegacyCloud.yml | 2 +- .github/vale/styles/LanceDB/OSSProduct.yml | 2 +- .github/vale/styles/LanceDB/PlainLanguage.yml | 2 +- .github/vale/styles/LanceDB/ProductNames.yml | 2 +- .../vale/styles/LanceDB/RemoteExecution.yml | 2 +- .github/vale/styles/LanceDB/VagueHeadings.yml | 2 +- .github/vale/styles/LanceDB/VaguePhrases.yml | 2 +- CONTRIBUTING.md | 31 +++- docs/STYLE.md | 148 ++++++++++++++++++ 13 files changed, 182 insertions(+), 19 deletions(-) create mode 100644 docs/STYLE.md diff --git a/.github/vale/README.md b/.github/vale/README.md index 94a11bfd8..faa302c33 100644 --- a/.github/vale/README.md +++ b/.github/vale/README.md @@ -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 diff --git a/.github/vale/styles/LanceDB/Dashes.yml b/.github/vale/styles/LanceDB/Dashes.yml index 7bb10c96f..f80829c9a 100644 --- a/.github/vale/styles/LanceDB/Dashes.yml +++ b/.github/vale/styles/LanceDB/Dashes.yml @@ -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 diff --git a/.github/vale/styles/LanceDB/EmbeddedName.yml b/.github/vale/styles/LanceDB/EmbeddedName.yml index a372c8a04..d4f01c1e2 100644 --- a/.github/vale/styles/LanceDB/EmbeddedName.yml +++ b/.github/vale/styles/LanceDB/EmbeddedName.yml @@ -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 diff --git a/.github/vale/styles/LanceDB/InternalNames.yml b/.github/vale/styles/LanceDB/InternalNames.yml index 0818090e1..6be384ffb 100644 --- a/.github/vale/styles/LanceDB/InternalNames.yml +++ b/.github/vale/styles/LanceDB/InternalNames.yml @@ -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 diff --git a/.github/vale/styles/LanceDB/LegacyCloud.yml b/.github/vale/styles/LanceDB/LegacyCloud.yml index 932b7a7db..ab1940718 100644 --- a/.github/vale/styles/LanceDB/LegacyCloud.yml +++ b/.github/vale/styles/LanceDB/LegacyCloud.yml @@ -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 diff --git a/.github/vale/styles/LanceDB/OSSProduct.yml b/.github/vale/styles/LanceDB/OSSProduct.yml index 248129208..17ff80abc 100644 --- a/.github/vale/styles/LanceDB/OSSProduct.yml +++ b/.github/vale/styles/LanceDB/OSSProduct.yml @@ -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 diff --git a/.github/vale/styles/LanceDB/PlainLanguage.yml b/.github/vale/styles/LanceDB/PlainLanguage.yml index 563e834e2..f843da9df 100644 --- a/.github/vale/styles/LanceDB/PlainLanguage.yml +++ b/.github/vale/styles/LanceDB/PlainLanguage.yml @@ -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. diff --git a/.github/vale/styles/LanceDB/ProductNames.yml b/.github/vale/styles/LanceDB/ProductNames.yml index 42cde9869..97fe18526 100644 --- a/.github/vale/styles/LanceDB/ProductNames.yml +++ b/.github/vale/styles/LanceDB/ProductNames.yml @@ -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 diff --git a/.github/vale/styles/LanceDB/RemoteExecution.yml b/.github/vale/styles/LanceDB/RemoteExecution.yml index ccff9e926..278359250 100644 --- a/.github/vale/styles/LanceDB/RemoteExecution.yml +++ b/.github/vale/styles/LanceDB/RemoteExecution.yml @@ -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 diff --git a/.github/vale/styles/LanceDB/VagueHeadings.yml b/.github/vale/styles/LanceDB/VagueHeadings.yml index e100891b0..b94438361 100644 --- a/.github/vale/styles/LanceDB/VagueHeadings.yml +++ b/.github/vale/styles/LanceDB/VagueHeadings.yml @@ -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 diff --git a/.github/vale/styles/LanceDB/VaguePhrases.yml b/.github/vale/styles/LanceDB/VaguePhrases.yml index 43d00f9e0..640511140 100644 --- a/.github/vale/styles/LanceDB/VaguePhrases.yml +++ b/.github/vale/styles/LanceDB/VaguePhrases.yml @@ -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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d053fcbb3..874d121a6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 diff --git a/docs/STYLE.md b/docs/STYLE.md new file mode 100644 index 000000000..6e6e1c482 --- /dev/null +++ b/docs/STYLE.md @@ -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 */} +```