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

Allow bypassing the lvl0 #38

Closed
3 tasks
pixelastic opened this issue Jan 6, 2016 · 6 comments
Closed
3 tasks

Allow bypassing the lvl0 #38

pixelastic opened this issue Jan 6, 2016 · 6 comments

Comments

@pixelastic
Copy link
Contributor

For documentations that have only 1 or 2 levels, the default display adds too many constraints. We usually do not need the lvl0, and would want to start the hierarchy at the lvl1, and only display two columns without the horizontal bars.

Using default values for lvl0, we could easily set it to a hardcoded "Documentation" string, and then in the front end hide the bar using CSS.

But this will leave with with a lvl0 of Documentation that is searchable, so if a user searches for "Documentation", all the records would match.

So we need to provide a way to bypass completly the lvl0. The proposal is to allow a value of None on the lvl0, that will trigger a specific behavior.

  • lvl0 will be hardcoded to Documentation for all records
  • lvl0 will not be added to the ranking

In a second step, we will add a removeTitle option on docsearch.js that will automatically hide the horizontal bar. In the meantime, those default options will simply group all the results under the same header, but disallowing searching in it.

Checklist

  • Allow passing None to selectors.lvl0
  • Is the same as empty selector + default_value of "Documentation"
  • Removes lvl0 from all ranking
@pixelastic pixelastic added this to the v2.0 milestone Jan 6, 2016
@pixelastic pixelastic mentioned this issue Jan 6, 2016
15 tasks
@redox
Copy link
Contributor

redox commented Jan 6, 2016

In such case, I was also used to hide the left sidebar (with CSS overrides), what do you think?

@pixelastic
Copy link
Contributor Author

So no records are grouped, they are all on the same level, without separation nor grouping?

I never had to do that, but if this is needed then maybe we need to think of another API. Instead of a value of None, we might simply add an option of searchable: false to the selector?

So, to start the hierarchy at the level 2, we would have to do:

selectors: {
  lvl0: {
    selector: '',
    searchable: false
  },
  lvl1: {
    selector: '',
    searchable: false
  },
  lvl2: '#a .real selector'
}

This would simply put null for both lvl0 and lvl1 to all records, and never search into it. Maybe it would be safer to put a string value instead of null.

@redox
Copy link
Contributor

redox commented Jan 6, 2016

I never had to do that

For the record: https://secure.helpscout.net/conversation/153468099/4734/?folderId=696686

Final implementation: http://help.fastnotesapp.com/ (at that time, I even hided the headers but I've updated the crawler and reached out to propose him to show it again)

@pixelastic
Copy link
Contributor Author

Makes sense. I think we should not limit ourselves a special handling of the lvl0, but instead provide the searchable: false option on all selectors.

@maxiloc and @rcs: Any thoughts?

@ElPicador
Copy link
Contributor

I like the searchable: false option

@maxiloc
Copy link
Contributor

maxiloc commented Jan 15, 2016

Fixed with #45

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

No branches or pull requests

4 participants