Skip to content

Commit 1c8796a

Browse files
authored
docs(misc): update migration docs to use supported markdown syntax (#33563)
This PR cleans up the markdown files under `packages/`. We previously had to support Next.js docs and translate it for astro docs with proper markdown syntax. This applies to generators, executors, and migrations. Also removes the function to do the translation in astro app since it's no longer needed. ## Code block (migrations) <img width="1086" height="800" alt="Screenshot 2025-11-20 at 1 23 53 PM" src="https://github.com/user-attachments/assets/bd9acb9b-7960-4e41-9d26-22d29da6658e" /> ## Aside (generators) <img width="802" height="443" alt="Screenshot 2025-11-20 at 1 43 17 PM" src="https://github.com/user-attachments/assets/e2999821-8783-46ed-a984-2193f6f8eafa" />
1 parent 1eecf46 commit 1c8796a

143 files changed

Lines changed: 700 additions & 2046 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

astro-docs/src/plugins/utils/generate-plugin-markdown.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
type PluginItem,
88
type PluginMigrationItem,
99
} from './plugin-schema-parser';
10-
import { stripMarkdocTags } from './strip-markdoc-tags';
1110

1211
export function generateMigrationItem(name: string, item: any): string {
1312
const { config } = item;
@@ -34,7 +33,7 @@ export function generateMigrationItem(name: string, item: any): string {
3433
const maybeExampleMdFile = config.fullPath + '.md';
3534
if (existsSync(maybeExampleMdFile)) {
3635
const rawContent = readFileSync(maybeExampleMdFile, 'utf-8');
37-
markdown += `${stripMarkdocTags(rawContent)}\n\n`;
36+
markdown += `${rawContent}\n\n`;
3837
}
3938
}
4039

astro-docs/src/plugins/utils/get-schema-example-content.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { existsSync, readFileSync } from 'node:fs';
22
import { dirname, resolve as resolvePath } from 'node:path';
33
import { type PluginSchemaWithExamples } from './plugin-schema-parser';
4-
import { stripMarkdocTags } from './strip-markdoc-tags';
4+
55
const EXAMPLE_SCHEMA_KEY = 'examplesFile';
66

77
/**
@@ -61,14 +61,11 @@ export function getExampleForSchema(
6161
return null;
6262
}
6363

64-
// Strip Markdoc tags and transform to Starlight syntax
65-
const cleanedContent = stripMarkdocTags(content);
66-
6764
// If content already has headers, increase their level by 1 to nest under generator
68-
if (hasHeaders(cleanedContent)) {
69-
return cleanedContent.replace(/^(#{1,5})\s/gm, '#$1 ');
65+
if (hasHeaders(content)) {
66+
return content.replace(/^(#{1,5})\s/gm, '#$1 ');
7067
}
7168

7269
// Only add Examples header if there are no existing headers
73-
return `### Examples\n\n${cleanedContent}`;
70+
return `### Examples\n\n${content}`;
7471
}

astro-docs/src/plugins/utils/strip-markdoc-tags.spec.ts

Lines changed: 0 additions & 314 deletions
This file was deleted.

0 commit comments

Comments
 (0)