rspress icon indicating copy to clipboard operation
rspress copied to clipboard

[Feature][RuntimeComponent]: Support <Files />

Open SoonIter opened this issue 8 months ago • 1 comments

What problem does this feature solve?

Image

In order to better print file tree information

```sh
docs
├── en
│   ├── _meta.json // navigation bar level
│   └── guides
│       ├── _meta.json // sidebar level
│       ├── introduction.mdx
│       ├── install.mdx
│       └── advanced
│           ├── _meta.json // sidebar level
│           └── plugin-development.md
└── zh
    ├── _meta.json // navigation bar level
    └── guides
        ├── _meta.json // sidebar level
        ├── introduction.mdx
        ├── install.mdx
        └── advanced
            ├── _meta.json // sidebar level
            └── plugin-development.md
```

"shell script" code block is not for printing file tree, but it is used commonly in prism

This will cause this part of the code is very ugly when users switch to shiki, the best solution to this issue is to provide a component to meet this part of needs

What does the proposed API look like?

https://fumadocs.dev/docs/ui/components/files

import { File, Folder, Files } from 'rspress/theme';
import { File, Folder, Files } from '@rspress/theme-default';

SoonIter avatar May 13 '25 11:05 SoonIter

Similar to https://github.com/rspack-contrib/rspress-plugins/tree/main/packages/rspress-plugin-file-tree

JounQin avatar May 13 '25 13:05 JounQin