prettier / prettier

Prettier is an opinionated code formatter.
https://prettier.io
MIT License
49.26k stars 4.33k forks source link

Option names aren't indexed by the search on the site #8106

Open thorn0 opened 4 years ago

thorn0 commented 4 years ago

Steps to reproduce:

  1. Go to https://prettier.io
  2. In the search input in the header, enter: jsxSingleQuote

Actual result: nothing is found

Expected: a link to https://prettier.io/docs/en/options.html#jsx-quotes

mhchen commented 4 years ago

If you haven't found anyone to take this on yet, I wouldn't mind taking a look! FYI at first glance it looks a little involved, and like the contributor would have to open a pull request against this repo to update the docsearch configuration, which might require a contributor from here signing off on it.

thorn0 commented 4 years ago

@mhchen Thanks for willing to help. I think a simpler and probably overall better solution would be to add option names to headings on this page. I'm actually editing that page now to close #8044, so while I'm at it I'm going to try solving this issue too.

mhchen commented 4 years ago

Sounds good @thorn0. I'll look for something else to pick up

boyenn commented 4 years ago

Can remove help wanted

thorn0 commented 4 years ago

I don't know how to proceed here. Almost every option has two names: one for the CLI (kebab case) and one for the API and configuration files (camel case). I was going to put the API names to headings, e.g. jsxSingleQuote, but that would mean the options still won't be indexed by their CLI names. Putting both names to headings (e.g. jsxSingleQuote / --jsx-single-quote) looks too ugly.

boyenn commented 4 years ago

How about getting .post td added to text of https://github.com/algolia/docsearch-configs/blob/master/configs/prettier.json ?

Seems like it'd be pretty safe as far as other table usage goes, but if we don't trust that, I believe you can limit it per page.

boyenn commented 4 years ago

see also https://docsearch.algolia.com/docs/config-file/#using-custom-selectors-per-page