Add collapse level to FileTree #2607
iskandersierra
started this conversation in
Feature Requests
Replies: 1 comment 3 replies
-
Thanks for the idea! I’m not 100% convinced a top-level attribute is the most helpful way to approach this. For example, I can totally imagine a situation where you want to collapse different directories at different depths and this would not really help there, for example you might have something like this where you’d like to collapse the top-level <FileTree>
- misc/
- files/
- i-want.to
- hide.md
- src/
- important/
- thing.js
</FileTree> To support that, I guess would require some kind of custom syntax per directory. Not super simple to come up with but we could think about it if other people have the same need. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What version of
starlight
are you using?0.28.3
What is your idea?
I would like a property
collapseLevel
onFileTree
to allow the starting tree to be collapsed to that level.Why is this feature necessary?
To document about project folder structure it would be nice to have the tree with enough levels to document about the project structure, but not to occupy too much space when first shown. A per folder way to do it would be too much in my opinion, but a global
collapseLevel
would be good enough for that.E.g.
collapseLevel=0
would show all the folders at first level collapsed,collapseLevel=1
would open the first-level folders, but the second level would be collapsed, and so on ...Do you have examples of this feature in other projects?
Would show as:
Participation
Beta Was this translation helpful? Give feedback.
All reactions