emersonbottero / vitepress-plugin-search

Provide local search to your documentation site.
MIT License
240 stars 30 forks source link

Possibility to search also in h2 headers #18

Closed PeterPetrik closed 1 year ago

PeterPetrik commented 2 years ago

Would it be possible to search also in the h2 headers? I tried the plugin and it does great job looking in page title + content, but not in the headers itself.

emersonbottero commented 2 years ago

I'm changing the internal library used in this plugin and I'll add this also. Will leave It open until donne.

emersonbottero commented 2 years ago

Hi @PeterPetrik , could you try the last version?

PeterPetrik commented 2 years ago

Hi, unfortuntaly we are not yet using vitepress, waiting for the public release (we are still on vuepress1). Once we migrate, I will give it a try.

Nevertheless thanks for the fix

pdanpdan commented 1 year ago

To add on this, can you please change the parser to process levels 2-6 (to match h2-h6) It needs a #{2,6} in https://github.com/emersonbottero/vitepress-plugin-search/blob/74c5dda95db1a157353e732ea55fadee3bd86164/src/docs-builder.ts#L90 Maybe make it configurable from options?

emersonbottero commented 1 year ago

h3 to h6 dont use anchors.. I guess we can configure It in the vitepress , I'll take a look and see How It Works and then Sync It in the search results

emersonbottero commented 1 year ago

@pdanpdan , would it make sense to follow the level option as described in markdown-it

pdanpdan commented 1 year ago

Yes :)

emersonbottero commented 1 year ago

@PeterPetrik couldn't use the level options nothing changed.. could you try and confirm? If you also can't use it plz open a an issue in the vitepress repo.

PeterPetrik commented 1 year ago

Tested, it searches now in h2. thanks