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 and filters #46

Closed
KittyGiraudel opened this issue Jul 5, 2014 · 5 comments
Closed

Add search and filters #46

KittyGiraudel opened this issue Jul 5, 2014 · 5 comments
Assignees
Labels
Milestone

Comments

@KittyGiraudel
Copy link
Member

Would be cool to be able to search and filter documented items.

@KittyGiraudel
Copy link
Member Author

This could be done completely client-side, within the DOM, but @valeriangalliat and I wished to have something a little more focused on data rather than presentation.

@KittyGiraudel KittyGiraudel added this to the 1.1 milestone Jul 5, 2014
@FWeinb
Copy link
Member

FWeinb commented Jul 5, 2014

I think exposing the whole data to the client side would be great.
So injecting the data using swig

<script>window.data = {{ data | json }}</script>

is easy.
Using http://lunrjs.com/ to index appropriate keys (like name, description).

@FWeinb
Copy link
Member

FWeinb commented Jul 6, 2014

After trying to injecting the whole data into the page I think that it is to much. Here is an DOM approach using fuse.js and injecting only item.context.type and item.context.name into the DOM.

Development is on branch add-search-fuzzy-dom
Unstyled showcase can be found here: http://0da9e3a.5minfork.com/examples/dist/

@KittyGiraudel
Copy link
Member Author

A word regarding inline-search (items get filtered and hidden/displayed as you're typing):

On paper, I like that. It does the job well since I automatically get rid of all the items I don't want as I'm typing in the search bar. That's what we have at Browserhacks and it's working pretty well.

There are 2 things I don't like with this system though:

  1. It involves some weird issues like empty sections whenever all items from a section are getting hidden.
  2. It works for single page documents, and get quickly annoying to deal with when we want to do something as simple as tabbing content (which I am planning to do).

I'd rather keep things simple: I type, I get suggestions, I pick one and get redirected to the selected item (anchor in our case).

@FWeinb
Copy link
Member

FWeinb commented Jul 18, 2014

Fixed by 06576f5

@FWeinb FWeinb closed this as completed Jul 18, 2014
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

2 participants