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

Add more things to index?

Open cormullion opened this issue 1 year ago • 3 comments

I’d like to improve the indexing of colorschemes at https://juliagraphics.github.io/ColorSchemes.jl/dev/catalogue/

so that people could search for the name of a colorscheme. The browser’s Find will work, but I think adding the colorscheme names to the document index would be good.

Currently the page is constructed mainly with Julia code (https://github.com/JuliaGraphics/ColorSchemes.jl/blob/38c4cdc3f5848645d7092e8128d98bb5d6385dc0/docs/src/catalogue.md?plain=1#L35) so extra indexing stuff could be added ?🤔

cormullion avatar Sep 27 '24 09:09 cormullion

So the request as I understand it is that you'd like the user to be able to search for, say, bamako100, and they'd find the relevant point in your catalogue, correct?

(I guess even nicer would be if that spot then had an anchor, so that we can directly jump to, say, https://juliagraphics.github.io/ColorSchemes.jl/dev/catalogue/#bamako100 and browser scrolls through it).

That sounds like a very good idea. How should this work from the perspective of a documentation author? My first naive thought would be to allow inserting a block like this in the code:

```
@label bamako100
```

which would take care of both (the name "label" is inspired by LaTeX \label, obviously alternative suggestions would be welcome). I guess there are situations where one wants a specific label that may not match the search text, then perhaps a two argument version could be admitted? And I guess it should be fine to insert two of multiple labels in the same spot:

```
@label "Law of quadratic reciprocity" quad-recipro
@label "Gauss Theorem"    # would produce label gauss-theorem just as with section headers
```

Thoughts?

fingolfin avatar Oct 28 '25 12:10 fingolfin

Issue #745 is related, it requests to "allow adding arbitrary anchors to be linked with @ref", and I guess the labels defined here could serve that purpose, too.

The syntax suggested there is [content](@id anchor-name) and that would also be fine with me. Likewise anchor versus label, both seem fine to me.

fingolfin avatar Oct 28 '25 13:10 fingolfin

that you'd like the user to be able to search for, say, bamako100, and they'd find the relevant point in your catalogue, correct?

Exactly.

As for names, it’s OK to use anything appropriate. I suspect professional indexers might use words like “term”, “keyword”, or “descriptor”.

cormullion avatar Oct 28 '25 16:10 cormullion