joekrill / silverbullet-treeview

SilverBullet TreeView plug
MIT License
35 stars 9 forks source link

Add pageExcludeRegex #16

Closed djm2k closed 2 months ago

djm2k commented 3 months ago

This PR adds a new config option pageExcludeRegex; added to the README.md:

  # Regular Expression string to exclude pages from the tree
  # - Any page that is all-caps: "^[A-Z]+$"
  # - A specific set of pages: "^(?:SETTINGS|PLUGS|index|Library)$"
  # - Any path containing Hidden: "Hidden" e.g. test/Hidden/page1
  pageExcludeRegex: "^(?:SETTINGS|PLUGS|index|Library)$"

Closes #12.

mufeedali commented 2 months ago

I think somehow excluding notes with the #meta tag would be better

joekrill commented 1 month ago

I think somehow excluding notes with the #meta tag would be better

@mufeedali great idea. I just pushed an update that makes this possible: instead of just a single pageExcludeRegex option there is now an exclusions option that can take multiple exclusion rules. And in addition to a page name regex you can also exclude based on tag name or a custom space-script function.

treeview:
  exclusions:
  - type: "tags"
     tags: ["meta"]
  - type: "regex"
     rule: "^(?:SETTINGS|PLUGS|index|Library)$"

pageExcludeRegex still works, but shows a deprecation message in the console. The type: "regex" exclusion does the same exact thing now.