Skip to content

docs(website): show the whole declaration in protocol docs code tabs - #1420

Open
SnowboardTechie wants to merge 3 commits into
mainfrom
bryan/872-docs-snippets-by-name
Open

SnowboardTechie wants to merge 3 commits into
mainfrom
bryan/872-docs-snippets-by-name

Conversation

@SnowboardTechie

@SnowboardTechie SnowboardTechie commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Changes proposed

Protocol docs pages now find their code by schema name, so the TypeSpec, Python and TypeScript tabs show the whole declaration and can't drift when a source file is edited.

  • Wrong snippets are fixed. 89 of the 240 code tabs were showing something other than their declaration: 19 showed other code entirely (the SystemMetadata TypeScript tab showed NameSchema, for example), one was empty, and the rest were shifted or cut off. All 240 now show the full declaration, with its doc comment and decorators in TypeSpec.
  • Pages name the schema instead of typing paths and line numbers. A section is now <SchemaTable schema="Money" /> and <SchemaFormatTabs schema="Money" typeSpec python typescript />. The 240 startLine/endLine pairs are gone, and page frontmatter drops from 3,430 lines to 1,375. What's left is titles, the hand-written examples and the JSON Schemas written in the page for basic types like string and url, which have no generated file.
  • Six Python tabs now show the fields they inherit. On the pagination and sorting pages, classes such as PaginatedQueryParams subclass a base (PaginatedBase, SortBase) that no page showed, so the tab was a class line and a docstring with no fields. Those tabs now show the base class above the class. This is the one place the pages change beyond repairing a snippet.
  • A missing schema or snippet fails the build, with a message naming what couldn't be found, instead of publishing an empty or wrong tab.
  • Three generator scripts are removed. generate-schema-metadata.ts and generate-type-formatting.ts wrote output nothing read. generate-schema-docs.ts is replaced by building the schema-to-page map from the pages during the site build. generate-versioned-schemas.ts stays, because the Changelog sections link to the files it writes.

Nothing under lib/ changes, and no page URL, heading, anchor or prose changes.

Context for reviewers

The pages stay as MDX. The issue first proposed a catalog file and a dynamic route, and this comment explains why that was dropped.

Things worth a look:

  • website/src/lib/schema/source-declarations.ts is the new lookup. TypeSpec is parsed with the TypeSpec compiler's own parser and TypeScript with the TypeScript compiler API, both already dependencies. Python uses a small scanner that tracks brackets and strings. A name that isn't declared, or is declared more than once, throws.
  • Naming convention. A bare typeSpec or python looks up the schema's own name, and typescript looks up <Name>Schema. 23 tabs name their declaration explicitly because the SDK names it differently: the TypeScript enums end in Enum, the Python filter operator enums are singular, and a few type schemas use different capitals (ISODateSchema).
  • Thirteen tabs name two declarations, such as typeSpec={["PaginatedBase", "Paginated"]}. Seven already showed a template or base model together with the model built from it, and each now shows both whole. The other six are the Python pagination and sorting tabs above. A tab shows only the declarations it names, so where other classes sit between the two in the file, they are left out and the source link spans from the first to the second.
  • pnpm dev re-reads the sources on each page load, so an edit to an SDK or TypeSpec file shows on reload. A production build reads them once.
  • CommonGrants.Patch is skipped for bare names. That namespace in organization-sync.tsp redeclares twelve model names such as OrgIds, so a bare name means the one in CommonGrants.Models. A qualified name (Patch.OrgIds) still reaches the copy in CommonGrants.Patch.
  • competition-versions.spec.ts read file paths out of the page frontmatter. It now reads the schema and version attributes and resolves them the way the components do. Each assertion keeps its meaning: the Form and Competition tables still come from the v0.5.0 schema files.

Verified by building the site at 3a37f4ef and again on this branch, then comparing all 51 protocol pages:

  • 27 pages are identical. The other 24 differ only inside TypeSpec, Python and TypeScript tabs.
  • Prose, tables, examples, JSON Schema tabs, headings, anchors and links are unchanged on every page. The one visible addition is the NumberArrayFilter TypeSpec tab, which was empty because its line range ran past the end of the file.
  • The 131 non-protocol pages are identical, and the schema-to-page map has the same 156 entries.

pnpm --filter website run ci passes: build, link validation, eslint, Prettier, tsc, astro check, cspell and 1,248 tests. Building with an unknown schema or snippet name exits 1.

Additional information

Rendered pages: the website preview for this PR. Two pages that are wrong on the live site today, with their previews: date types, TypeScript tabs (live, preview), and award, AwdIds TypeSpec tab (live, preview).

Every changed code tab, with its old and new line range (103: 92 changed code, 11 changed only the GitHub line link)
Page Section Tab Declaration File Lines before Lines after Reason
fields/custom-field customField typeSpec CustomField core/lib/core/fields/custom-field.tsp 47-64 22-64 adds 25 missing line(s) at the top
fields/custom-field customField python CustomField python-sdk/common_grants_sdk/schemas/pydantic/fields/custom.py 23-45 27-66 drops 4 line(s) of other code at the top; adds 21 cut-off line(s) at the end
fields/custom-field customField typescript CustomFieldSchema ts-sdk/src/schemas/zod/fields.ts 103-118 105-120 drops 2 line(s) of other code at the top; adds 2 cut-off line(s) at the end
fields/custom-field customFieldType python CustomFieldType python-sdk/common_grants_sdk/schemas/pydantic/fields/custom.py 12-20 13-21 drops 1 line(s) of other code at the top; adds 1 cut-off line(s) at the end
fields/custom-field customFieldType typescript CustomFieldTypeEnum (named in page) ts-sdk/src/schemas/zod/fields.ts 94-101 96-103 drops 2 line(s) of other code at the top; adds 2 cut-off line(s) at the end
fields/event event typeSpec Event core/lib/core/fields/event.tsp 33-45 33-44 code identical; only the line link changed
fields/event eventBase typeSpec EventBase core/lib/core/fields/event.tsp 51-62 50-62 adds 1 missing line(s) at the top
fields/event eventBase python EventBase python-sdk/common_grants_sdk/schemas/pydantic/fields/event.py 22-38 22-45 adds 7 cut-off line(s) at the end
fields/event singleDateEvent python SingleDateEvent python-sdk/common_grants_sdk/schemas/pydantic/fields/event.py 42-56 49-62 drops 7 line(s) of other code at the top; adds 6 cut-off line(s) at the end
fields/event dateRangeEvent typeSpec DateRangeEvent core/lib/core/fields/event.tsp 86-106 87-106 code identical; only the line link changed
fields/event dateRangeEvent python DateRangeEvent python-sdk/common_grants_sdk/schemas/pydantic/fields/event.py 60-86 66-87 drops 6 line(s) of other code at the top; adds 1 cut-off line(s) at the end
fields/event otherEvent python OtherEvent python-sdk/common_grants_sdk/schemas/pydantic/fields/event.py 90-100 91-100 drops 1 line(s) of other code at the top
fields/metadata systemMetadata typeSpec SystemMetadata core/lib/core/fields/metadata.tsp 21-31 7-31 adds 14 missing line(s) at the top
fields/metadata systemMetadata python SystemMetadata python-sdk/common_grants_sdk/schemas/pydantic/fields/metadata.py 10-22 10-26 adds 4 cut-off line(s) at the end
fields/metadata systemMetadata typescript SystemMetadataSchema ts-sdk/src/schemas/zod/fields.ts 124-130 149-155 wrong code: lines 124-130 are not SystemMetadataSchema; it is at 149-155
fields/money money typeSpec Money core/lib/core/fields/money.tsp 21-29 11-28 adds 10 missing line(s) at the top; drops 1 line(s) of other code at the end
fields/money money typescript MoneySchema ts-sdk/src/schemas/zod/fields.ts 82-88 82-90 adds 2 cut-off line(s) at the end
fields/pcs pcsTerm typeSpec PCSTerm core/lib/core/fields/pcs.tsp 15-32 3-31 adds 12 missing line(s) at the top; drops 1 line(s) of other code at the end
fields/pcs pcsClass typeSpec PCSClass core/lib/core/fields/pcs.tsp 37-46 37-45 code identical; only the line link changed
filters/base defaultFilter typeSpec DefaultFilter core/lib/core/filters/base.tsp 75-89 76-90 drops 1 line(s) of other code at the top; adds 1 cut-off line(s) at the end
filters/base defaultFilter python DefaultFilter python-sdk/common_grants_sdk/schemas/pydantic/filters/base.py 57-70 57-95 adds 25 cut-off line(s) at the end
filters/base comparisonOperators typeSpec ComparisonOperators core/lib/core/filters/base.tsp 17-30 17-31 adds 1 cut-off line(s) at the end
filters/base stringOperators typeSpec StringOperators core/lib/core/filters/base.tsp 43-50 43-51 adds 1 cut-off line(s) at the end
filters/base rangeOperators typeSpec RangeOperators core/lib/core/filters/base.tsp 52-59 53-61 drops 1 line(s) of other code at the top; adds 2 cut-off line(s) at the end
filters/boolean booleanComparisonFilter python BooleanComparisonFilter python-sdk/common_grants_sdk/schemas/pydantic/filters/boolean.py 9-31 9-28 code identical; only the line link changed
filters/date dateRangeFilter typeSpec DateRangeFilter core/lib/core/filters/date.tsp 24-39 25-40 drops 1 line(s) of other code at the top; adds 1 cut-off line(s) at the end
filters/date dateComparisonFilter typeSpec DateComparisonFilter core/lib/core/filters/date.tsp 10-20 10-19 code identical; only the line link changed
filters/money moneyRangeFilter typeSpec MoneyRangeFilter core/lib/core/filters/money.tsp 25-41 25-40 code identical; only the line link changed
filters/money moneyRangeFilter python MoneyRangeFilter python-sdk/common_grants_sdk/schemas/pydantic/filters/money.py 43-50 43-69 adds 19 cut-off line(s) at the end
filters/money moneyComparisonFilter typeSpec MoneyComparisonFilter core/lib/core/filters/money.tsp 10-20 10-19 code identical; only the line link changed
filters/numeric numberComparisonFilter python NumberComparisonFilter python-sdk/common_grants_sdk/schemas/pydantic/filters/numeric.py 26-35 46-76 wrong code: lines 26-35 are not NumberComparisonFilter; it is at 46-76
filters/numeric numberRangeFilter typeSpec NumberRangeFilter core/lib/core/filters/numeric.tsp 42-54 27-39 wrong code: lines 42-54 are not NumberRangeFilter; it is at 27-39
filters/numeric numberRangeFilter python NumberRangeFilter python-sdk/common_grants_sdk/schemas/pydantic/filters/numeric.py 46-61 79-94 wrong code: lines 46-61 are not NumberRangeFilter; it is at 79-94
filters/numeric numberArrayFilter python NumberArrayFilter python-sdk/common_grants_sdk/schemas/pydantic/filters/numeric.py 64-81 97-123 wrong code: lines 64-81 are not NumberArrayFilter; it is at 97-123
filters/numeric numberArrayFilter typeSpec NumberArrayFilter core/lib/core/filters/numeric.tsp 60-69 45-54 tab was hidden: lines 60-69 are past the end of the file, so the tab was empty; now shows NumberArrayFilter
models/award awardBase typeSpec AwardBase core/lib/core/models/award.tsp 155-204 146-195 adds 9 missing line(s) at the top; drops 9 line(s) of other code at the end
models/award awdRef typeSpec AwdRef core/lib/core/models/award.tsp 114-132 105-123 adds 9 missing line(s) at the top; drops 9 line(s) of other code at the end
models/award awdStatus typeSpec AwdStatus core/lib/core/models/award.tsp 32-45 32-36 drops 9 line(s) of other code at the end
models/award awdFunding typeSpec AwdFunding core/lib/core/models/award.tsp 51-66 42-57 adds 9 missing line(s) at the top; drops 9 line(s) of other code at the end
models/award awdTimeline typeSpec AwdTimeline core/lib/core/models/award.tsp 72-87 63-78 adds 9 missing line(s) at the top; drops 9 line(s) of other code at the end
models/award awdRecipientIndividual typeSpec AwdRecipientIndividual core/lib/core/models/award.tsp 138-149 129-140 adds 9 missing line(s) at the top; drops 9 line(s) of other code at the end
models/award awdIds typeSpec AwdIds core/lib/core/models/award.tsp 98-108 89-99 adds 9 missing line(s) at the top; drops 9 line(s) of other code at the end
models/award awdIdFain typeSpec AwdIdFain core/lib/core/models/award.tsp 93-96 84-87 wrong code: lines 93-96 are not AwdIdFain; it is at 84-87
models/mapping mappingSchema typeSpec MappingSchema core/lib/core/models/mapping.tsp 54-58 7-58 adds 47 missing line(s) at the top
models/opportunity opportunityBase typeSpec OpportunityBase core/lib/core/models/opportunity/base.tsp 45-80 17-81 adds 28 missing line(s) at the top; adds 1 cut-off line(s) at the end
models/opportunity opportunityBase python OpportunityBase python-sdk/common_grants_sdk/schemas/pydantic/models/opp_base.py 15-42 38-106 drops 23 line(s) of other code at the top; adds 64 cut-off line(s) at the end
models/opportunity opportunityBase typescript OpportunityBaseSchema ts-sdk/src/schemas/zod/models.ts 115-162 117-158 drops 2 line(s) of other code at the top; drops 4 line(s) of other code at the end
models/opportunity opportunityDetails typeSpec OpportunityDetails core/lib/core/models/opportunity/base.tsp 140-162 141-163 drops 1 line(s) of other code at the top; adds 1 cut-off line(s) at the end
models/opportunity oppRef typeSpec OppRef core/lib/core/models/opportunity/base.tsp 115-134 116-135 drops 1 line(s) of other code at the top; adds 1 cut-off line(s) at the end
models/opportunity oppIds typeSpec OppIds core/lib/core/models/opportunity/base.tsp 96-109 97-110 drops 1 line(s) of other code at the top; adds 1 cut-off line(s) at the end
models/opportunity oppIdFon typeSpec OppIdFon core/lib/core/models/opportunity/base.tsp 86-89 87-90 drops 1 line(s) of other code at the top; adds 1 cut-off line(s) at the end
models/opportunity oppIdAln typeSpec OppIdAln core/lib/core/models/opportunity/base.tsp 91-94 92-95 drops 1 line(s) of other code at the top; adds 1 cut-off line(s) at the end
models/opportunity oppStatus python OppStatus python-sdk/common_grants_sdk/schemas/pydantic/models/opp_status.py 30-45 30-44 code identical; only the line link changed
models/opportunity oppStatus typescript OppStatusSchema ts-sdk/src/schemas/zod/models.ts 17-26 19-28 drops 2 line(s) of other code at the top; adds 2 cut-off line(s) at the end
models/opportunity oppStatusOptions typescript OppStatusOptionsEnum (named in page) ts-sdk/src/schemas/zod/models.ts 15-15 17-17 wrong code: lines 15-15 are not OppStatusOptionsEnum; it is at 17-17
models/opportunity oppFunding python OppFunding python-sdk/common_grants_sdk/schemas/pydantic/models/opp_funding.py 11-47 11-41 code identical; only the line link changed
models/opportunity oppFunding typescript OppFundingSchema ts-sdk/src/schemas/zod/models.ts 73-96 71-94 adds 2 missing line(s) at the top; drops 2 line(s) of other code at the end
models/opportunity oppTimeline python OppTimeline python-sdk/common_grants_sdk/schemas/pydantic/models/opp_timeline.py 11-28 11-25 code identical; only the line link changed
models/opportunity oppTimeline typescript OppTimelineSchema ts-sdk/src/schemas/zod/models.ts 102-113 100-111 adds 2 missing line(s) at the top; drops 2 line(s) of other code at the end
models/organization organizationBase typeSpec OrganizationBase core/lib/core/models/organization.tsp 5-60 17-72 drops 12 line(s) of other code at the top; adds 12 cut-off line(s) at the end
models/organization orgIds typeSpec OrgIds core/lib/core/models/organization.tsp 81-96 93-108 drops 12 line(s) of other code at the top; adds 12 cut-off line(s) at the end
models/organization orgIdEin typeSpec OrgIdEin core/lib/core/models/organization.tsp 66-69 78-81 wrong code: lines 66-69 are not OrgIdEin; it is at 78-81
models/organization orgIdUei typeSpec OrgIdUei core/lib/core/models/organization.tsp 71-74 83-86 wrong code: lines 71-74 are not OrgIdUei; it is at 83-86
models/organization orgIdDuns typeSpec OrgIdDuns core/lib/core/models/organization.tsp 76-79 88-91 wrong code: lines 76-79 are not OrgIdDuns; it is at 88-91
models/organization orgRef typeSpec OrgRef core/lib/core/models/organization.tsp 102-120 114-132 drops 12 line(s) of other code at the top; adds 12 cut-off line(s) at the end
models/organization orgRefCollection typeSpec OrgRefCollection core/lib/core/models/organization.tsp 122-134 134-146 drops 12 line(s) of other code at the top; adds 12 cut-off line(s) at the end
models/organization orgRelationships typeSpec OrgRelationships core/lib/core/models/organization.tsp 257-288 259-290 drops 2 line(s) of other code at the top; adds 2 cut-off line(s) at the end
models/organization orgHierarchyRelationship typeSpec OrgHierarchyRelationship + another core/lib/core/models/organization.tsp 205-240 207-242 shows the declarations the old range covered, each whole: OrgHierarchyRelationship (239-242) and the one(s) built with it; was lines 205-240, now 207-242
models/organization orgSuccessionRelationship typeSpec OrgSuccessionRelationship core/lib/core/models/organization.tsp 242-245 244-247 drops 2 line(s) of other code at the top; adds 2 cut-off line(s) at the end
models/organization orgRecordRelationship typeSpec OrgRecordRelationship core/lib/core/models/organization.tsp 247-250 249-252 drops 2 line(s) of other code at the top; adds 2 cut-off line(s) at the end
models/organization orgOtherRelationship typeSpec OrgOtherRelationship core/lib/core/models/organization.tsp 252-255 254-257 drops 2 line(s) of other code at the top; adds 2 cut-off line(s) at the end
models/organization orgHierarchyKindOptions typeSpec OrgHierarchyKindOptions core/lib/core/models/organization.tsp 140-158 152-170 drops 12 line(s) of other code at the top; adds 12 cut-off line(s) at the end
models/organization orgSuccessionKindOptions typeSpec OrgSuccessionKindOptions core/lib/core/models/organization.tsp 160-174 172-186 drops 12 line(s) of other code at the top; adds 12 cut-off line(s) at the end
models/organization orgRecordKindOptions typeSpec OrgRecordKindOptions core/lib/core/models/organization.tsp 176-187 188-199 wrong code: lines 176-187 are not OrgRecordKindOptions; it is at 188-199
models/organization orgOtherKindOptions typeSpec OrgOtherKindOptions core/lib/core/models/organization.tsp 189-193 201-205 wrong code: lines 189-193 are not OrgOtherKindOptions; it is at 201-205
models/organization orgRelationshipStatus typeSpec OrgRelationshipStatus core/lib/core/models/organization.tsp 195-203 7-15 wrong code: lines 195-203 are not OrgRelationshipStatus; it is at 7-15
models/organization orgSocialLinks typeSpec OrgSocialLinks core/lib/core/models/organization.tsp 294-318 296-320 drops 2 line(s) of other code at the top; adds 2 cut-off line(s) at the end
models/organization orgStatus typeSpec OrgStatus core/lib/core/models/organization.tsp 336-341 338-343 drops 2 line(s) of other code at the top; adds 2 cut-off line(s) at the end
models/organization orgStatusOptions typeSpec OrgStatusOptions core/lib/core/models/organization.tsp 324-334 326-336 drops 2 line(s) of other code at the top; adds 2 cut-off line(s) at the end
pagination paginatedQueryParams python PaginatedQueryParams + another python-sdk/common_grants_sdk/schemas/pydantic/pagination.py 28-29 8-30 shows the base class above the class, each whole, leaving out the classes between them in the file
pagination paginatedBodyParams python PaginatedBodyParams + another python-sdk/common_grants_sdk/schemas/pydantic/pagination.py 24-25 8-26 shows the declarations the old range covered, each whole: PaginatedBodyParams (25-26) and the one(s) built with it; was lines 24-25, now 8-26
pagination paginatedResultsInfo python PaginatedResultsInfo + another python-sdk/common_grants_sdk/schemas/pydantic/pagination.py 32-46 8-45 shows the base class above the class, each whole, leaving out the classes between them in the file
responses/error error typeSpec Error core/lib/core/responses/error.tsp 15-27 5-28 adds 10 missing line(s) at the top; adds 1 cut-off line(s) at the end
responses/error applicationSubmissionError typeSpec ApplicationSubmissionError core/lib/core/responses/error.tsp 32-43 34-44 drops 2 line(s) of other code at the top; adds 1 cut-off line(s) at the end
responses/filtered filtered typeSpec Filtered + another core/lib/core/responses/success.tsp 177-198 172-198 shows the declarations the old range covered, each whole: Filtered (190-198) and the one(s) built with it; was lines 177-198, now 172-198
responses/filtered filtered python Filtered + another python-sdk/common_grants_sdk/schemas/pydantic/responses/success.py 57-78 55-75 shows the declarations the old range covered, each whole: Filtered (67-75) and the one(s) built with it; was lines 57-78, now 55-75
responses/paginated paginated typeSpec Paginated + another core/lib/core/responses/success.tsp 72-90 68-90 shows the declarations the old range covered, each whole: Paginated (82-90) and the one(s) built with it; was lines 72-90, now 68-90
responses/paginated paginated python Paginated python-sdk/common_grants_sdk/schemas/pydantic/responses/success.py 32-42 32-41 code identical; only the line link changed
responses/sorted sorted typeSpec Sorted + another core/lib/core/responses/success.tsp 125-141 121-141 shows the declarations the old range covered, each whole: Sorted (133-141) and the one(s) built with it; was lines 125-141, now 121-141
responses/sorted sorted python Sorted python-sdk/common_grants_sdk/schemas/pydantic/responses/success.py 45-54 44-52 adds 1 missing line(s) at the top; drops 2 line(s) of other code at the end
responses/success ok typeSpec Ok core/lib/core/responses/success.tsp 31-36 27-36 adds 4 missing line(s) at the top
responses/success created typeSpec Created core/lib/core/responses/success.tsp 239-244 235-244 adds 4 missing line(s) at the top
responses/success accepted typeSpec Accepted core/lib/core/responses/success.tsp 268-273 264-273 adds 4 missing line(s) at the top
sorting sortOrder python SortOrder python-sdk/common_grants_sdk/schemas/pydantic/sorting.py 9-13 12-16 drops 3 line(s) of other code at the top; adds 3 cut-off line(s) at the end
sorting sortQueryParams python SortQueryParams + another python-sdk/common_grants_sdk/schemas/pydantic/sorting.py 35-43 19-43 shows the declarations the old range covered, each whole: SortQueryParams (36-43) and the one(s) built with it; was lines 35-43, now 19-43
sorting sortBodyParams python SortBodyParams + another python-sdk/common_grants_sdk/schemas/pydantic/sorting.py 46-54 19-53 shows the base class above the class, each whole, leaving out the classes between them in the file
sorting sortedResultsInfo python SortedResultsInfo + another python-sdk/common_grants_sdk/schemas/pydantic/sorting.py 57-69 19-67 shows the base class above the class, each whole, leaving out the classes between them in the file
types/date isoDate typescript ISODateSchema (named in page) ts-sdk/src/schemas/zod/types.ts 49-52 91-94 wrong code: lines 49-52 are not ISODateSchema; it is at 91-94
types/date isoTime typescript ISOTimeSchema (named in page) ts-sdk/src/schemas/zod/types.ts 55-62 97-104 wrong code: lines 55-62 are not ISOTimeSchema; it is at 97-104
types/date utcDateTime typescript UTCDateTimeSchema (named in page) ts-sdk/src/schemas/zod/types.ts 46-46 85-88 wrong code: lines 46-46 are not UTCDateTimeSchema; it is at 85-88
types/date offsetDateTime typescript OffsetDateTimeSchema (named in page) ts-sdk/src/schemas/zod/types.ts 65-68 107-110 wrong code: lines 65-68 are not OffsetDateTimeSchema; it is at 107-110
types/numeric decimalString typescript DecimalStringSchema (named in page) ts-sdk/src/schemas/zod/types.ts 21-23 32-34 wrong code: lines 21-23 are not DecimalStringSchema; it is at 32-34
types/string uuid typescript UuidSchema (named in page) ts-sdk/src/schemas/zod/types.ts 15-15 17-17 wrong code: lines 15-15 are not UuidSchema; it is at 17-17

Adds the lookup protocol pages will use to show a schema's code without
file paths or line numbers. TypeSpec is read with the compiler's own
parser; TypeScript with the TypeScript parser; Python with a small
scanner that tracks brackets and strings. A name that isn't declared,
or is declared more than once, throws.
Each protocol page now names the schema in <SchemaTable schema=...> and
<SchemaFormatTabs schema=... typeSpec python typescript>, and the code
tabs show the whole declaration found by name. About 100 tabs that were
cut off, shifted or showing other code now show the right declaration,
and a schema or snippet that can't be found fails the build.

The schema-to-page map that links table types to their pages is built
from the pages during the site build, so generate-schema-docs.ts goes,
along with generate-schema-metadata.ts, generate-type-formatting.ts and
SchemaMetadataLoader, whose output nothing read.

Closes #872
@github-actions github-actions Bot added website Issues related to the website dependencies Pull requests that update a dependency file typescript Issue or PR related to TypeScript tooling labels Nov 19, 2026
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Website Preview Deployed!

Preview your changes at: https://pr-1420-common-grants.agile6.workers.dev

Built from commit f463bb1

@SnowboardTechie SnowboardTechie changed the title fix(website): show the whole declaration in protocol docs code tabs docs(website): show the whole declaration in protocol docs code tabs Nov 19, 2026
… fields

- The dev server re-reads the TypeSpec, Python and TypeScript sources once
  per page render, so a source edit shows on reload; a production build
  still reads them once.
- Declarations shown together keep the blank lines the source has between
  them, so Python classes sit two blank lines apart.
- The Python tabs for the pagination and sorting models show their base
  class (PaginatedBase, SortBase), which holds the inherited fields.
- Drop code with no reader: the example file branch, the cache-clearing
  helper and an export; use the TypeSpec parser's line lookup and one
  shared recursive file listing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file typescript Issue or PR related to TypeScript tooling website Issues related to the website

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Website] Simplify protocol docs generation

1 participant