Repository navigation
v0.8.0: per-page front matter descriptions - #6
Merged
Merged
Conversation
Resource pages take the first sentence of the resource description (HTML tags and Markdown links stripped, backticks dropped, entities decoded, whitespace collapsed, capped at 160 characters on a word boundary), and fall back to the former provider-wide string when there is none. Service index pages name the service. The provider index keeps headerContent1.txt. Values are emitted as YAML double-quoted scalars (JSON.stringify). Regenerated output changes for every provider, hence 0.8.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A resource page whose resource description yields no sentence gets "Query, deploy and manage the <resource> resource in the <provider> <service> service using SQL" instead of the provider-wide line, so no resource page carries the provider-wide string and no two share one. Few provider specs carry resource descriptions (homebrew 0 of 9, cloudflare 0 of 1,127), so with the provider-wide fallback almost every resource page repeated the same description. Version stays 0.8.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Numeric entities for surrogate code points are left as written rather than decoded to a lone surrogate. The JSDoc now says the fallback is returned as given, uncapped, which is what the code does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part D of the provider-microsite structured-data pilot. Every generated resource and service page had the same front matter
description:(Query, deploy and manage <provider> resources using SQL), so the meta description andWebPage.descriptionrepeated across a whole site.Work order coverage
resourceDescription, HTML tags and Markdown links stripped, whitespace collapsed, first sentence, 160 characters on a word boundary; fallback per resource (decision below)metaDescription(text, fallback)insrc/docgen/helpers.js, used bycreateOverviewSectionandcreateOverviewSectionv2. Also: link text is kept, inline code backticks and**are dropped, entities are decoded, the first-sentence split skipse.g./i.e./etc.and periods inside tokens (Node.js,v1.2), and a cut ends in...within the 160 characters.Query, deploy and manage <provider> <service> resources using SQLgenerator.js, shared by v1 and v2).JSON.stringifyyamlString).headerContent1.txt's value.tests/docgen/descriptions.test.js: descriptions differ per resource; values with a colon, quotes, a newline,#and HTML still parse withjs-yaml; the fallback applies for an empty and a missing description; plus unit tests formetaDescriptionandyamlString.docs/docgen.md, 0.8.0Fallback (decided)
Resource pages never get the provider-wide string. When the resource description yields no sentence, the page gets
Query, deploy and manage the <resource> resource in the <provider> <service> service using SQL(resourceFallbackDescriptioninoverview.js). Few provider specs carry resource descriptions (homebrew 0 of 9, cloudflare 0 of 1,127), so with the provider-wide fallback almost every resource page repeated one description. The fallback is not capped at 160 characters, since cutting it could make two pages collide again; the JSDoc says so.Validation
npm test: 110 passed (96 before, 14 added). The per-resource fallback tests fail against the provider-wide fallback (6 failures) and pass on this branch.mainvendored), and checked withcheck-site.mjs --git. Both pass, and the duplicate-description warning is gone:description:line only)description:line only)No resource page on either site carries the provider-wide line. The regenerated docs were not committed to the sites; that happens on their next regeneration with 0.8.0.
🤖 Generated with Claude Code