Feat: Adapt the theme of the documentation page. #10427 (#12337)

### What problem does this PR solve?

Feat: Adapt the theme of the documentation page. #10427
### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-12-30 19:35:44 +08:00
committed by GitHub
parent 4705d07e11
commit 2fccf3924d
2 changed files with 13 additions and 23 deletions

View File

@ -1,3 +1,4 @@
import { useIsDarkTheme } from '@/components/theme-provider';
import { useSetModalState, useTranslate } from '@/hooks/common-hooks';
import { LangfuseCard } from '@/pages/user-setting/setting-model/langfuse';
import apiDoc from '@parent/docs/references/http_api_reference.md';
@ -28,6 +29,8 @@ const ApiContent = ({
const { handlePreview } = usePreviewChat(idKey);
const isDarkTheme = useIsDarkTheme();
return (
<div className="pb-2">
<Flex vertical gap={'middle'}>
@ -47,7 +50,10 @@ const ApiContent = ({
<div style={{ position: 'relative' }}>
<MarkdownToc content={apiDoc} />
</div>
<MarkdownPreview source={apiDoc}></MarkdownPreview>
<MarkdownPreview
source={apiDoc}
wrapperElement={{ 'data-color-mode': isDarkTheme ? 'dark' : 'light' }}
></MarkdownPreview>
</Flex>
{apiKeyVisible && (
<ChatApiKeyModal