docs(explorer): update default config + new example (#493)
This commit is contained in:
		
							parent
							
								
									48452231d5
								
							
						
					
					
						commit
						dcdeae4e7b
					
				
					 1 changed files with 11 additions and 1 deletions
				
			
		| 
						 | 
					@ -29,7 +29,7 @@ Component.Explorer({
 | 
				
			||||||
  sortFn: (a, b) => {
 | 
					  sortFn: (a, b) => {
 | 
				
			||||||
    ... // default implementation shown later
 | 
					    ... // default implementation shown later
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  filterFn: undefined,
 | 
					  filterFn: filterFn: (node) => node.name !== "tags", // filters out 'tags' folder
 | 
				
			||||||
  mapFn: undefined,
 | 
					  mapFn: undefined,
 | 
				
			||||||
  // what order to apply functions in
 | 
					  // what order to apply functions in
 | 
				
			||||||
  order: ["filter", "map", "sort"],
 | 
					  order: ["filter", "map", "sort"],
 | 
				
			||||||
| 
						 | 
					@ -160,6 +160,16 @@ Component.Explorer({
 | 
				
			||||||
 | 
					
 | 
				
			||||||
You can customize this by changing the entries of the `omit` set. Simply add all folder or file names you want to remove.
 | 
					You can customize this by changing the entries of the `omit` set. Simply add all folder or file names you want to remove.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Show every element in explorer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					To override the default filter function that removes the `tags` folder from the explorer, you can set the filter function to `undefined`.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```ts title="quartz.layout.ts"
 | 
				
			||||||
 | 
					Component.Explorer({
 | 
				
			||||||
 | 
					  filterFn: undefined, // apply no filter function, every file and folder will visible
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Advanced examples
 | 
					## Advanced examples
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Add emoji prefix
 | 
					### Add emoji prefix
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue