index.tsx 691 B

12345678910111213141516171819202122232425262728
  1. /**
  2. * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
  3. * SPDX-License-Identifier: MIT
  4. */
  5. import { LlmsContainer, LlmsCopyButton, LlmsViewOptions } from '@rspress/plugin-llms/runtime';
  6. import { getCustomMDXComponent as basicGetCustomMDXComponent } from '@rspress/core/theme';
  7. function getCustomMDXComponent() {
  8. const { h1: H1, ...components } = basicGetCustomMDXComponent();
  9. const MyH1 = ({ ...props }) => (
  10. <>
  11. <H1 {...props} />
  12. <LlmsContainer>
  13. <LlmsCopyButton />
  14. <LlmsViewOptions />
  15. </LlmsContainer>
  16. </>
  17. );
  18. return {
  19. ...components,
  20. h1: MyH1,
  21. };
  22. }
  23. export { getCustomMDXComponent };
  24. export * from '@rspress/core/theme';