refactor(docs-infra): extract only the visibleRegion

Previously we extracted the regions and only made the visible region visible on the page, but since there is not a need for the
non-visible code to be presented, we don't need to include it in the generated code snippets.

(cherry picked from commit 9b3b5fb4cf)
This commit is contained in:
Joey Perrott 2025-11-21 19:33:16 +00:00 committed by Pawel Kozlowski
parent e95d2e3a34
commit 76f784c340

View file

@ -24,8 +24,6 @@ export function extractRegions(token: CodeToken) {
if (!region) {
throw new Error(`Cannot find ${token.visibleRegion} in ${token.path}!`);
}
token.visibleLines = `[${region.ranges.map(
(range) => `[${range.from}, ${range.to ?? parsedRegions.totalLinesCount + 1}]`,
)}]`;
token.code = region.lines.join('\n');
}
}