Commit 89ca81d1 by Archer Committed by GitHub

fix: document deploy (#5867)

parent bf33f7af
import { createMDX } from 'fumadocs-mdx/next'; import { createMDX } from 'fumadocs-mdx/next';
const withMDX = createMDX({ const withMDX = createMDX();
mdxOptions: {
remarkPlugins: {
image: {
checkImageSize: false
}
}
}
});
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const config = { const config = {
......
...@@ -17,6 +17,8 @@ export const docs = defineDocs({ ...@@ -17,6 +17,8 @@ export const docs = defineDocs({
export default defineConfig({ export default defineConfig({
lastModifiedTime: 'git', lastModifiedTime: 'git',
mdxOptions: { mdxOptions: {
// MDX options remarkImageOptions: {
external: false
}
} }
}); });
...@@ -63,7 +63,7 @@ const strIsMdTable = (str: string) => { ...@@ -63,7 +63,7 @@ const strIsMdTable = (str: string) => {
return true; return true;
}; };
const markdownTableSplit = (props: SplitProps): SplitResponse => { const markdownTableSplit = (props: SplitProps): SplitResponse => {
let { text = '', chunkSize } = props; let { text = '', chunkSize, maxSize = defaultMaxChunkSize } = props;
// split by rows // split by rows
const splitText2Lines = text.split('\n').filter((line) => line.trim()); const splitText2Lines = text.split('\n').filter((line) => line.trim());
...@@ -93,7 +93,17 @@ ${mdSplitString} ...@@ -93,7 +93,17 @@ ${mdSplitString}
// Over size // Over size
if (chunkLength + nextLineLength > chunkSize) { if (chunkLength + nextLineLength > chunkSize) {
chunks.push(chunk); // 单行非常的长,直接分割
if (chunkLength > maxSize) {
const newChunks = commonSplit({
...props,
text: chunk
}).chunks;
chunks.push(...newChunks);
} else {
chunks.push(chunk);
}
chunk = defaultChunk; chunk = defaultChunk;
} }
chunk += `${splitText2Lines[i]}\n`; chunk += `${splitText2Lines[i]}\n`;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment