Skip to content

docs: a short front page, with the reference moved into docs/ - #19

Merged
Halvanhelv merged 2 commits into
mainfrom
docs/provider-examples
Sep 9, 2026
Merged

docs: a short front page, with the reference moved into docs/#19
Halvanhelv merged 2 commits into
mainfrom
docs/provider-examples

Conversation

@Halvanhelv

Copy link
Copy Markdown
Owner

The README was 902 lines. It was accurate, and it was the first thing anyone evaluating this gem met: cache-key construction, three duck-type contracts and the provider-authoring guide all stood between the first example and the second.

Restructured on the shape ruby_llm uses — a short front page that links out, rather than a manual that happens to open with a pitch.

  • README.md: 902 → 151 lines. Why it exists, a run of small snippets in the order a reader meets them, the provider table, features, installation, and links.
  • docs/: eight pages, 859 lines. configuration, providers, caching, contracts, instrumentation, errors, how-it-works, development.

This was a move, not a rewrite. Every fact in the old README was verified, and several were established by running real APIs — LibreTranslate's notranslate behaviour was measured in Docker, DeepL's and Google's were checked live. Prose was carried across verbatim; only connective sentences between sections were cut. The one sanctioned compression is the Amazon and LibreTranslate caveats, shortened to a line each on the front page and kept in full in docs/providers.md.

Also here: the custom-provider example is now a fictional Acme service. It was written against a real one, which reads as documentation for something the gem ships and would collide the day that service becomes a real provider — which is exactly what happened to the previous version of the example, written against Google.

Verification

  • Section-by-section accounting: every paragraph, table and code block of the old README traced to exactly one new home. Nothing dropped.
  • Every internal link and cross-file anchor resolves, checked by a slugify-based checker over every link in README and docs.
  • Every snippet's option names checked against TranslationDiff::Configuration.options; every :null-provider snippet executed rather than eyeballed.
  • 398 runs, 0 failures. RuboCop clean. No file under lib/ or test/ touched.

The example walked through writing a provider for a real service. A
reader could not tell at a glance whether it was documentation for
something the gem ships or a worked example of something it does not,
and the name would have collided the day that service became a real
provider -- which is exactly what happened to the previous version of
this example, written against Google.

Acme cannot collide with anything, and its endpoint and auth scheme are
now generic enough that nobody will paste them expecting a reply.
Splits the 902-line README into a ~150-line front page (why, a run of
small code examples, the provider table, features, installation) in
the ruby_llm README's shape, and moves the reference material into
docs/ split by subject: configuration, providers, caching, contracts,
instrumentation, errors, how-it-works, and development/upgrading. All
moved prose is carried verbatim; nothing is dropped.
@Halvanhelv
Halvanhelv merged commit 125a154 into main Sep 9, 2026
3 checks passed
@Halvanhelv
Halvanhelv deleted the docs/provider-examples branch September 9, 2026 17:37
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.

1 participant