Skip to content

Conversation

@Neway13
Copy link

@Neway13 Neway13 commented Jul 2, 2022

Q A
Bug fix? no
New feature? yes
Breaking changes? no
Deprecations? no
New tests added? not needed
Fixed tickets none
License MIT

Description

I added a feature to filter files and folders.

Sometimes we don't want certain files or folders displayed in the sidebar. It would look cleaner if we excluded them from the tree, such as the Image assets folders.

So I developed this feature. By configuring the glob patterns, users can exclude files or folders that they do not want to display. Use "," to separate multiple pattern.

Suppose my directory structure is as follows:
expolre

The following three expressions are configured:

  1. **/*t/temp to exclude the file or folder named temp in base folder
  2. **/*temp.md to exclude all files or folders whose names end with temp.md
  3. **/*.assets to exclude all files or folders whose names end with .assets

Use "," to separate multiple pattern: **/*t/temp,**/*temp.md,**/*.assets

config

Finally we will see the following structure in the sidebar:

tree

The minimatch module is used to parse glob patterns.

@Neway13 Neway13 marked this pull request as ready for review July 2, 2022 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant