Skip to content

Commit 5840026

Browse files
authored
docs: display llms UI (#533)
1 parent 7cdaf9a commit 5840026

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

website/theme/index.tsx

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,37 @@
1-
import { Layout as BaseLayout } from '@rspress/core/theme';
1+
import {
2+
Layout as BaseLayout,
3+
getCustomMDXComponent as basicGetCustomMDXComponent,
4+
} from '@rspress/core/theme';
5+
import {
6+
LlmsContainer,
7+
LlmsCopyButton,
8+
LlmsViewOptions,
9+
} from '@rspress/plugin-llms/runtime';
210
import { NavIcon } from '@rstack-dev/doc-ui/nav-icon';
11+
312
import { HomeLayout } from './pages';
413
import './index.scss';
514

15+
export function getCustomMDXComponent() {
16+
const { h1: H1, ...mdxComponents } = basicGetCustomMDXComponent();
17+
18+
const MyH1 = ({ ...props }) => {
19+
return (
20+
<>
21+
<H1 {...props} />
22+
<LlmsContainer>
23+
<LlmsCopyButton />
24+
<LlmsViewOptions />
25+
</LlmsContainer>
26+
</>
27+
);
28+
};
29+
return {
30+
...mdxComponents,
31+
h1: MyH1,
32+
};
33+
}
34+
635
const Layout = () => {
736
return <BaseLayout beforeNavTitle={<NavIcon />} />;
837
};

0 commit comments

Comments
 (0)