Skip to content

Task/ccl 8779 txt files for llms fixed - #67

Merged
readmaniak merged 5 commits into
masterfrom
task/CCL-8779
Sep 28, 2026
Merged

readmaniak merged 5 commits into
masterfrom
task/CCL-8779

Conversation

@readmaniak

Copy link
Copy Markdown
Collaborator

No description provided.

Andrey Kornev and others added 5 commits September 23, 2026 17:14
The per-page .txt files used by the MCP server and AI agents were
generated on every deploy, but diverged from the HTML pages in two ways:

- Content rendered by React components was silently dropped:
  <McpNotice/> (added on 41 pages in UOD-430), <PriceBlock/> and
  <BlogLink/>. They are now rendered to text; prices are fetched once at
  build time from the same public endpoint the site uses, and omitted
  (never failing the build) if the request fails.
- Docs following the Docusaurus category-index convention
  (mcp/mcp.mdx, external-services/external-services.mdx,
  extension/captcha-parameters/captcha-parameters.mdx) got URLs like
  /docs/mcp/mcp/ (404) and were published at /docs/mcp/mcp.txt instead
  of /docs/mcp.txt next to the real page URL.

Also normalise CRLF so local runs on Windows produce the same output as
the Linux build, keep component-generated lines out of llms.txt page
descriptions, and add --no-prices for offline/deterministic runs.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- scripts/verify-llms.mjs (npm run verify-llms): post-build check that
  llms.txt, llms-full.txt and every /docs/**.txt exist, that each txt's
  URL header points to a page that exists in the build, that the file
  count matches the publishable source docs, and that no raw MDX
  (imports, JSX tags, admonition markers) leaked into the text.
- .github/workflows/llms-txt.yml: on pull requests and pushes to master,
  run the same build command as production and then the verifier.
  Algolia env vars are placeholders only; real keys stay in the
  Cloudflare Pages project settings.
- README: document that the site is deployed by Cloudflare Pages from
  master, how the txt files are produced, and how to check them locally.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
generate-llms.mjs
- Rewrite internal links in a second pass with the full set of generated
  page URLs: a link becomes ".txt" only when that file exists; links to
  category (generated-index) pages keep their page URL instead of
  pointing at a non-existent captchas.txt / category/api.txt / extension.txt.
- Links to .md/.mdx files resolve relative to the source file and collapse
  the category-index name (extension-main -> captcha-parameters.txt).
- Extension-less relative links (../recaptcha-v3-task/) resolve against
  the page URL like a browser does, fixing two links that previously
  escaped their folder.
- Absolute-link rewrite honours the locale prefix (/ru/docs/ too).
- <PriceBlock/> lines carry their label (title ?? item.Name) so multiple
  prices on one page are distinguishable; <PriceBlockWrap> emits its
  "View full price" link.
- collapseCategoryIndex compares names case-insensitively.
- firstParagraph keeps inline-code text instead of deleting it.

verify-llms.mjs
- Check in-body doc links as well as llms.txt: .txt targets must exist
  as files, page targets must exist as <path>/index.html.
- Fix the no-op regex escape; strip BOM before draft detection.
- Warn (not fail) when no page contains a price line, so a prices API
  outage during a build is visible.

README: drop the unverified claim about preview builds.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
<ParamItem required="required (if Task is not filled)"> was reduced to a
bare "required", losing the condition; parameters without `required`
showed no marker although the page prints "optional". Mirror the
component: string value verbatim, boolean -> "required", otherwise
"optional", nothing when `response` is set.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- generate-llms.mjs: strip trailing whitespace before collapsing blank
  lines, so indented JSX children no longer leave whitespace-only runs;
  skip the "View full price" link when prices are unavailable.
- verify-llms.mjs: write the BOM as  instead of a raw character;
  ignore links to non-page assets (e.g. a PDF) under the docs prefix.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@readmaniak
readmaniak merged commit 0245997 into master Sep 28, 2026
2 checks passed
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