Add missing changesets

This commit is contained in:
Fuma Nama
2024-01-23 22:45:28 +08:00
parent bf538e0692
commit 2ea9437075
4 changed files with 75 additions and 20 deletions
+31
View File
@@ -0,0 +1,31 @@
---
'fumadocs-core': major
---
**Migrate to rehype-shikiji**
- Dropped support for inline code syntax highlighting
- Use notation-based word/line highlighting instead of meta string
Before:
````md
```ts /config/ {1}
const config = "Hello"
something.call(config)
```
````
After:
````md
```ts
// [!code word:config]
const config = "Hello" // [!code highlight]
something.call(config)
```
````
Read the docs of Shikiji for more information.
+27
View File
@@ -0,0 +1,27 @@
---
'fumadocs-ui': major
---
**Change usage of Code Block component**
The inner `pre` element is now separated from code block container, making it easier to customise.`
Before:
```tsx
import { CodeBlock, Pre } from 'fumadocs-ui/mdx/pre';
<Pre title={title} allowCopy {...props} />
```
After:
```tsx
import { CodeBlock, Pre } from 'fumadocs-ui/mdx/pre';
<CodeBlock title={title} allowCopy>
<Pre {...props} />
</CodeBlock>
```
+3 -2
View File
@@ -8,13 +8,14 @@ import { CodeBlock, Pre } from 'fumadocs-ui/mdx/pre';
import type { ReactNode } from 'react';
import { Wrapper } from '@/components/preview/wrapper';
import { AutoTypeTable } from './components/doc';
import { cn } from './utils/cn';
export function useMDXComponents(components: MDXComponents): MDXComponents {
return {
...defaultComponents,
pre: ({ ref: _ref, title, ...props }) => (
pre: ({ ref: _ref, title, className, ...props }) => (
<CodeBlock title={title}>
<Pre className="max-h-[400px]" {...props} />
<Pre className={cn('max-h-[400px]', className)} {...props} />
</CodeBlock>
),
AutoTypeTable,
+14 -18
View File
@@ -10,39 +10,35 @@ const { TOCItems, Breadcrumb, LastUpdate, Footer } = await import(
'./page.client'
);
type TableOfContentOptions = Partial<
Omit<TOCProps, 'items'> & {
enabled: boolean;
component: ReactNode;
}
>;
type BreadcrumbOptions = Partial<{
type TableOfContentOptions = Omit<TOCProps, 'items'> & {
enabled: boolean;
component: ReactNode;
}>;
};
type FooterOptions = Partial<
FooterProps & {
enabled: boolean;
component: ReactNode;
}
>;
interface BreadcrumbOptions {
enabled: boolean;
component: ReactNode;
}
interface FooterOptions extends FooterProps {
enabled: boolean;
component: ReactNode;
}
export interface DocsPageProps {
toc?: TableOfContents;
tableOfContent?: TableOfContentOptions;
tableOfContent?: Partial<TableOfContentOptions>;
/**
* Replace or disable breadcrumb
*/
breadcrumb?: BreadcrumbOptions;
breadcrumb?: Partial<BreadcrumbOptions>;
/**
* Footer navigation, you can disable it by passing `false`
*/
footer?: FooterOptions;
footer?: Partial<FooterOptions>;
lastUpdate?: Date | string | number;