JuliaDocs / Documenter.jl

A documentation generator for Julia.
https://documenter.juliadocs.org
MIT License
810 stars 479 forks source link

Add support for 'Filter' in `@index` #1877

Open omlins opened 2 years ago

omlins commented 2 years ago

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?

mortenpi commented 2 years ago

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.

omlins commented 2 years ago

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...