egoist / docute

📚 Effortless documentation, done right.
https://docute.egoist.dev
MIT License
3.8k stars 427 forks source link

Build a local search plugin #21

Open egoist opened 7 years ago

egoist commented 7 years ago

Issuehunt badges

Using the plugin API for searching: https://docute.org/plugin-api#apienablesearchoptions


IssueHunt Summary ### Backers (Total: $200.00) - [issuehunt issuehunt](https://issuehunt.io/u/issuehunt) ($200.00) ### Submitted pull Requests - [#261 Build a local search plugin](https://issuehunt.io/r/egoist/docute/pull/261) --- #### [Become a backer now!](https://issuehunt.io/r/egoist/docute/issues/21) #### [Or submit a pull request to get the deposits!](https://issuehunt.io/r/egoist/docute/issues/21) ### Tips - Checkout the [Issuehunt explorer](https://issuehunt.io/r/egoist/docute/) to discover more funded issues. - Need some help from other developers? [Add your repositories](https://issuehunt.io/r/new) on IssueHunt to raise funds. --- IssueHunt has been backed by the following sponsors. [Become a sponsor](https://issuehunt.io/membership/members)
Itherael commented 6 years ago

Any progress regarding this functionality? I want to migrate to docute, but I don't want to use Algolia 😩

phillbaker commented 6 years ago

This vue component might be a good example (or potential component to integrate) to offer this: https://github.com/shayneo/vue-fuse/

egoist commented 5 years ago

Now we have a plugin API for searching: https://docute.org/plugin-api#apienablesearchoptions

We just need to figure out how to create/store search-index.json

IssueHuntBot commented 5 years ago

@issuehunt has funded $200.00 to this issue.


janat08 commented 5 years ago

Given that this runs in browser might as well run it in memory. The files would have to be loaded from sidebar, parsed-https://github.com/markdown-it/markdown-it-, and then fed into a search library such as https://www.npmjs.com/package/lunr which takes objects and appears to return the whole tree made of object keys for a result. Ideally the link would be able to take you to that exact spot in text, or at least a paragraph, something a parser might not support like paragraph 1 after h3. When markdown component loads, do those link work via router or is it something browser supports with markdown?

janat08 commented 5 years ago

So is it okay if search material is compiled at runtime, instead of having search-index.json produced before then?

benkoska commented 5 years ago

Working on this. Can you please assign me?

benkoska commented 5 years ago

I created a pull request #261 that should close this.