Add search and filters #46

Closed
HugoGiraudel opened this Issue Jul 5, 2014 · 5 comments

Comments

Projects
None yet
2 participants
@HugoGiraudel
Member

HugoGiraudel commented Jul 5, 2014

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

@HugoGiraudel

This comment has been minimized.

Show comment
Hide comment
@HugoGiraudel

HugoGiraudel Jul 5, 2014

Member

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.

Member

HugoGiraudel commented Jul 5, 2014

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.

@HugoGiraudel HugoGiraudel added this to the 1.1 milestone Jul 5, 2014

@HugoGiraudel HugoGiraudel added the 1.1 label Jul 5, 2014

@FWeinb

This comment has been minimized.

Show comment
Hide comment
@FWeinb

FWeinb Jul 5, 2014

Member

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).

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

This comment has been minimized.

Show comment
Hide comment
@FWeinb

FWeinb Jul 6, 2014

Member

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/

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/

@HugoGiraudel

This comment has been minimized.

Show comment
Hide comment
@HugoGiraudel

HugoGiraudel Jul 8, 2014

Member

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).

Member

HugoGiraudel commented Jul 8, 2014

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

This comment has been minimized.

Show comment
Hide comment
@FWeinb

FWeinb Jul 18, 2014

Member

Fixed by 06576f5

Member

FWeinb commented Jul 18, 2014

Fixed by 06576f5

@FWeinb FWeinb closed this Jul 18, 2014

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