Skip to content

Commit def3086

Browse files
committed
remove imports
1 parent a7ccdd1 commit def3086

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

docusaurus.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const { join, resolve } = require('node:path');
33
const clsx = require('clsx');
44
const { createApiPageMD, createInfoPageMD } = require('docusaurus-plugin-openapi-docs/lib/markdown');
55
const { remark } = require('remark');
6+
const mdxRemoveImports = require('remark-mdx-remove-imports');
67

78
const { config } = require('./apify-docs-theme');
89
const { collectSlugs } = require('./tools/utils/collectSlugs');
@@ -366,7 +367,9 @@ module.exports = {
366367
const strip = (await import('strip-markdown')).default; // ESM only
367368

368369
// Use remark to strip markdown and get plain text
369-
const processed = await remark().use(strip).process(result.content);
370+
const processed = await remark()
371+
.use(mdxRemoveImports).use(strip)
372+
.process(result.content);
370373
const contentText = String(processed).replace(/\s+/g, ' ').trim();
371374
// Extract the first sentence (ending with . ! or ?) even if it spans multiple lines
372375
const sentenceMatch = contentText.match(/^(.*?[.!?])\s/);

package-lock.json

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"patch-package": "^8.0.0",
6464
"path-browserify": "^1.0.1",
6565
"remark": "^15.0.1",
66+
"remark-mdx-remove-imports": "^1.6.22",
6667
"rimraf": "^6.0.0",
6768
"strip-markdown": "^6.0.0",
6869
"typescript": "5.9.2",

0 commit comments

Comments
 (0)