Skip to main content

Module book

Module book 

Source
Expand description

bynk book — the Bynk Book as this toolchain documents it (#2463).

The editor’s bynk_search_book language-model tool (and bynk mcp) need Book text that matches the bynk the user runs, not the live site (which may describe features this build lacks) and not the extension’s own version. The driver embeds the whole Book at build time (build.rs: the llms-full.txt bundle, every page in sidebar order) and serves it two ways:

  • bynk book prints the whole Book under a first line naming the toolchain version;
  • bynk book --search <query> returns the best-matching sections, as Markdown or (--format json) as data. search is the ranking, shared by every caller inside the driver.

A build made without the bundle (a plain cargo build) carries none: both forms then say “no Book bundled in this build” and exit non-zero, so a source build never silently returns nothing. The editor falls back to the hosted Book, ranked by a small TypeScript copy of search.

Structs§

Book
A Book text, split for searching.
Section
One heading’s worth of a Book page.

Enums§

Format
How bynk book --search prints.

Constants§

RESULTS
How many sections a search returns.

Functions§

embedded
The embedded Book, or None for a build made without the bundle.
parse
Split a Book text (the layout site/scripts/build-llms-full.mjs writes: each page between # ── rules, headed # Source: book/<page>) into sections.
render_markdown
bynk book --search as Markdown. Also what the MCP server’s bynk_search_book returns, so both surfaces print one text.
run
Run bynk book: print the whole Book, or with a query the matching sections. Exits 0 on success (including a search with no match) and 1 when this build carries no Book.
search
The best limit sections for query: a word in a heading counts more than one in the body, a section holding every word beats one holding some, and a verbatim phrase beats both. Ties keep the Book’s reading order.