Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add search to the documentation #659

Closed
Haroenv opened this issue Nov 7, 2017 · 2 comments
Closed

Add search to the documentation #659

Haroenv opened this issue Nov 7, 2017 · 2 comments
Labels

Comments

@Haroenv
Copy link

Haroenv commented Nov 7, 2017

Hey 👋 I just found out about pre-commit and it seems like a really useful tool. However I noticed that there are a lot of options, and it might be hard to find it.

I'm working at Algolia and we offer docsearch as a free service for open source projects. It basically crawls the documentation and makes it searchable, and you add an autocomplete to your page so people can search in it.

Let me know if you're interested!

@asottile
Copy link
Member

asottile commented Nov 7, 2017

If it's easy to add and adds a clear benefit I'd be open to adding it, if you'd like to get started on trying something like this the docs are hosted here

Note that we already had a discussion about search and decided it probably wasn't worth it because the docs are one page

I'm going to close this issue, please open one on the documentation project for consideration: https://github.com/pre-commit/pre-commit.github.io

Thanks for the issue!

@asottile asottile closed this as completed Nov 7, 2017
s-pace pushed a commit to algolia/docsearch-configs that referenced this issue Nov 7, 2017
@s-pace
Copy link

s-pace commented Nov 7, 2017

Glad to help.

Congratulations, your search is now ready!
I've successfully configured the underlying crawler and it will now run every 24h.

You're now a few steps away from having it working on your website:

  • Copy the following CSS/JS snippets and add them to your page
<!-- at the end of the HEAD -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
<!-- at the end of the BODY -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
<script type="text/javascript"> docsearch({
  apiKey: '5f052a6b9f5c2b81614512796afa7000',
  indexName: 'pre-commit',
  inputSelector: '### REPLACE ME ####',
  debug: false // Set debug to true if you want to inspect the dropdown
});
</script>

Feel free to get back to us if you have any issues or questions regarding the integration.
We'd also be happy to get your feedback and thoughts about DocSearch - so we can continue to improve it.

Let us know if you need anything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants