Documenter.jl icon indicating copy to clipboard operation
Documenter.jl copied to clipboard

Add support for 'Filter' in `@index`

Open omlins opened this issue 2 years ago • 2 comments

A great feature of @autodocs is Filter. So, I can do for example:

```@autodocs
Modules = [CellArrays]
Order   = [:type]
Filter = t -> typeof(t) !== CellArray

It seems to me natural to list first what @autodocs will show. Thus, in analogy, I would be tempted to do the selection for @index just the same way as for @autodocs:

```@index
Modules = [CellArrays]
Order = [:type]
Filter = t -> typeof(t) !== CellArray

However, to my surprise Filter is not supported for @index. Is there any particular reason for this or could this be added?

omlins avatar Jul 14 '22 09:07 omlins

I presume it's because the index would usually apply to the whole page or manual. However, I don't see any harm in allowing optional custom filtering here.

mortenpi avatar Jul 14 '22 10:07 mortenpi

Thanks a lot @mortenpi ! The idea is to enable this kind of documentation pattern where content is presented in whichever custom categories are appropriate (not covered by Modules and Order): image

EDIT: in this example CellArrays.CellArray should not be listed in the index, but be filtered out using Filter...

omlins avatar Jul 14 '22 10:07 omlins