Fix linting errors
This commit is contained in:
parent
91fa78c315
commit
9c4d0cbb30
14 changed files with 64 additions and 51 deletions
|
|
@ -17,6 +17,8 @@ const lintConfig = {
|
|||
'lint-no-trailing-spaces', // No trailing spaces
|
||||
['lint-emphasis-marker', '_'], // Italic with _, bold with **
|
||||
['lint-list-item-indent', 'space'], // Indent list items with one space
|
||||
['lint-maximum-heading-length', 80], // Warn on heading that can be too long
|
||||
['lint-maximum-line-length', 120], // Warn on lines that are too long
|
||||
],
|
||||
};
|
||||
const fixConfig = {
|
||||
|
|
@ -28,7 +30,6 @@ const fixConfig = {
|
|||
plugins: {
|
||||
frontmatter: true,
|
||||
'reference-links': true,
|
||||
'word-wrap': true,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@
|
|||
"remark-preset-lint-markdown-style-guide": "^2.1.2",
|
||||
"remark-preset-lint-recommended": "^3.0.2",
|
||||
"remark-reference-links": "^4.0.2",
|
||||
"remark-word-wrap": "^2.0.2",
|
||||
"stylelint": "^9.3.0",
|
||||
"stylelint-csstree-validator": "^1.3.0",
|
||||
"tailwindcss": "^0.6.4"
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@
|
|||
REMARK_MODE=fix \
|
||||
remark \
|
||||
--quiet \
|
||||
--output ./src/updated.md \
|
||||
./src/test.md
|
||||
./src/*.md \
|
||||
--output
|
||||
|
|
|
|||
|
|
@ -32,8 +32,10 @@ The method is called with three arguments:
|
|||
|
||||
- `input`, a reference to the search `input` element. It comes with the `.open()`,
|
||||
`.close()`, `.getVal()` and `.setVal()` methods.
|
||||
|
||||
- `event`, the actual event triggering the selection. This can come from a click
|
||||
or a keyboard navigation.
|
||||
|
||||
- `suggestion`, the object representing the current selection.
|
||||
|
||||
```javascript
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ A DocSearch looks like this:
|
|||
}
|
||||
```
|
||||
|
||||
## ``index_name``
|
||||
## `index_name`
|
||||
|
||||
This is the name of the Algolia index where your records will be pushed. The
|
||||
`apiKey` we will share with you will be restricted to work on this index.
|
||||
|
|
@ -80,9 +80,9 @@ The following example will make it clearer:
|
|||
```
|
||||
|
||||
The beneficial side effect of using this syntax is that all records that will
|
||||
then be extracted from crawling `http://www.example.com/docs/en/latest` will have
|
||||
`lang: en` and `version: latest` added to it, allowing you to then filter based on
|
||||
those values.
|
||||
then be extracted from crawling `http://www.example.com/docs/en/latest` will
|
||||
have `lang: en` and `version: latest` added to it, allowing you to then filter
|
||||
based on those values.
|
||||
|
||||
The following example shows how you can filter results matching specifics
|
||||
language and version from the front-end
|
||||
|
|
@ -342,7 +342,9 @@ recommend changing it as the default settings are meant to work for all
|
|||
websites.
|
||||
|
||||
One use case would be to configure the `separatorsToIndex` setting. By default
|
||||
Algolia will consider all special character as a word separator. In some contexts, like for method names, you might want `_`, `/` or `#` to keep their meaning.
|
||||
Algolia will consider all special character as a word separator. In some
|
||||
contexts, like for method names, you might want `_`, `/` or `#` to keep their
|
||||
meaning.
|
||||
|
||||
```json
|
||||
{
|
||||
|
|
@ -354,7 +356,6 @@ Algolia will consider all special character as a word separator. In some context
|
|||
|
||||
Check the [Algolia documentation][2] for more information on the settings.
|
||||
|
||||
|
||||
### `min_indexed_level` _Optional_
|
||||
|
||||
The default value is `0`. By increasing it, you can chose to not index some
|
||||
|
|
@ -485,11 +486,11 @@ With the above config and the `sitemap.xml` below, both
|
|||
`http://www.example.com/docs/` and `http://www.example.com/docs/de/` will be
|
||||
crawled.
|
||||
|
||||
```
|
||||
<url>
|
||||
<loc>http://www.example.com/docs/</loc>
|
||||
<xhtml:link rel="alternate" hreflang="de" href="http://www.example.com/de/"/>
|
||||
</url>
|
||||
```html
|
||||
<url>
|
||||
<loc>http://www.example.com/docs/</loc>
|
||||
<xhtml:link rel="alternate" hreflang="de" href="http://www.example.com/de/"/>
|
||||
</url>
|
||||
```
|
||||
|
||||
## JavaScript rendering
|
||||
|
|
@ -547,4 +548,5 @@ DocSearch to index all your content.
|
|||
```
|
||||
|
||||
[1]: https://github.com/algolia/docsearch-configs/tree/master/configs
|
||||
|
||||
[2]: https://www.algolia.com/doc/api-reference/settings-api-parameters/
|
||||
|
|
|
|||
|
|
@ -27,5 +27,7 @@ open-source][3] and even packaged as a Docker image. Just grab it, and run it
|
|||
with your own credentials.
|
||||
|
||||
[1]: https://scrapy.org/
|
||||
|
||||
[2]: ./crawler-config.html
|
||||
|
||||
[3]: https://github.com/algolia/docsearch-scraper
|
||||
|
|
|
|||
|
|
@ -8,23 +8,22 @@ the `docsearch.js` library into your website as per the following example. Your
|
|||
`apiKey` and `indexName` credentials will be given to you as soon as we've
|
||||
created your config.
|
||||
|
||||
|
||||
```html
|
||||
<!-- Before the closing </head> -->
|
||||
<link rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/npm/docsearch.js@{{docSearchJSVersion}}/dist/cdn/docsearch.min.css"
|
||||
/>
|
||||
<link rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/npm/docsearch.js@{{docSearchJSVersion}}/dist/cdn/docsearch.min.css"
|
||||
/>
|
||||
|
||||
<!-- Before the closing </body> -->
|
||||
<script
|
||||
src="https://cdn.jsdelivr.net/npm/docsearch.js@{{docSearchJSVersion}}/dist/cdn/docsearch.min.js"></script>
|
||||
<script>
|
||||
docsearch({
|
||||
// Your apiKey and indexName will be given to you once
|
||||
<script
|
||||
src="https://cdn.jsdelivr.net/npm/docsearch.js@{{docSearchJSVersion}}/dist/cdn/docsearch.min.js"></script>
|
||||
<script>
|
||||
docsearch({
|
||||
// Your apiKey and indexName will be given to you once
|
||||
// we create your config
|
||||
apiKey: '<API_KEY>',
|
||||
indexName: '<INDEX_NAME>',
|
||||
// Replace inputSelector with a CSS selector
|
||||
// Replace inputSelector with a CSS selector
|
||||
// matching your search input
|
||||
inputSelector: '<YOUR_CSS_SELECTOR>',
|
||||
});
|
||||
|
|
@ -37,7 +36,7 @@ If you're eager to test DocSearch but don't have credentials of your own yet,
|
|||
you can use the one we use on this own website:
|
||||
|
||||
```javascript
|
||||
docsearch({
|
||||
docsearch({
|
||||
apiKey: '25626fae796133dc1e734c6bcaaeac3c',
|
||||
indexName: 'docsearch',
|
||||
});
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ question to us][1] directly.
|
|||
|
||||
Every day.
|
||||
|
||||
The exact time of day might vary each day, but we'll crawl your
|
||||
website at most every 24 hours. We will also trigger a manual crawling every time
|
||||
your config is updated.
|
||||
The exact time of day might vary each day, but we'll crawl your website at most
|
||||
every 24 hours. We will also trigger a manual crawling every time your config is
|
||||
updated.
|
||||
|
||||
### What do I need to install on my side?
|
||||
|
||||
|
|
@ -55,8 +55,8 @@ _If you don't have Analytics access, send us an email and we'll enable it._
|
|||
### Where is my data hosted?
|
||||
|
||||
All DocSearch data is hosted on Algolia's servers, with replication around the
|
||||
globe. You can find more details about the actual [server specs here][5], and more
|
||||
complete information in our [privacy policy][6].
|
||||
globe. You can find more details about the actual [server specs here][5], and
|
||||
more complete information in our [privacy policy][6].
|
||||
|
||||
### Can I use DocSearch on non-doc pages?
|
||||
|
||||
|
|
@ -99,21 +99,27 @@ as those starting with `http://`.
|
|||
}
|
||||
```
|
||||
|
||||
### My favorite project documentation does not use DocSearch. What can I do?
|
||||
### A documentation I like does not use DocSearch. What can I do?
|
||||
|
||||
We'd love to help!
|
||||
|
||||
If one of your favorite tool documentation is missing
|
||||
DocSearch, we encourage you to file an issue in their repository explaining how
|
||||
DocSearch could help. Feel free to ping `@docsearch` on GitHub in the issue as
|
||||
well, and we'll provide all the help we can.
|
||||
|
||||
If one of your favorite tool documentation is missing DocSearch, we encourage
|
||||
you to file an issue in their repository explaining how DocSearch could help.
|
||||
Feel free to ping `@docsearch` on GitHub in the issue as well, and we'll provide
|
||||
all the help we can.
|
||||
|
||||
[1]: mailto:docsearch@algolia.com
|
||||
|
||||
[2]: https://www.algolia.com/
|
||||
|
||||
[3]: https://www.algolia.com/pricing
|
||||
|
||||
[4]: https://www.algolia.com/pricing#community
|
||||
|
||||
[5]: https://www.algolia.com/doc/guides/infrastructure/servers/
|
||||
|
||||
[6]: https://www.algolia.com/policies/privacy
|
||||
|
||||
[7]: ./crawler-overview.html
|
||||
|
||||
[8]: https://www.algolia.com/doc/api-reference/
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ front-end.
|
|||
|
||||
<img src="./assets/docsearch-how-it-works.png" alt="How it works" class="mt-2"/>
|
||||
|
||||
|
||||
### 1. You apply
|
||||
|
||||
The first thing you'll need to do is to apply for DocSearch by filling the
|
||||
|
|
@ -49,6 +48,3 @@ All we ask is that you keep the "search by Algolia" logo next to your search
|
|||
results.
|
||||
|
||||
[1]: https://github.com/algolia/docsearch-configs/tree/master/configs
|
||||
[2]: https://github.com/algolia/docsearch-scraper
|
||||
[3]: https://github.com/algolia/docsearch-scraper
|
||||
[4]: https://www.sitemaps.org/
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ layout: two-columns
|
|||
title: Inside the engine
|
||||
---
|
||||
|
||||
This page will explain in more details how the crawler extracts content from your
|
||||
page, and how it ranks it in the results.
|
||||
This page will explain in more details how the crawler extracts content from
|
||||
your page, and how it ranks it in the results.
|
||||
|
||||
## Crawling
|
||||
|
||||
|
|
@ -36,8 +36,8 @@ overwrite your previous index.
|
|||
## Ranking records
|
||||
|
||||
Algolia always returns the most relevant results first, using a [tie-breaking
|
||||
approach][1]. DocSearch will first search for exact matches in your keywords then
|
||||
fallback to partial matches. Those results will then be ordered based, once
|
||||
approach][1]. DocSearch will first search for exact matches in your keywords
|
||||
then fallback to partial matches. Those results will then be ordered based, once
|
||||
again, on the page hierarchy, as extracted from the `selectors`.
|
||||
|
||||
The default strategy is to first look at the closest header of the matching
|
||||
|
|
@ -59,7 +59,4 @@ If you want to get fancy, you could even overwrite the default
|
|||
`customRanking` used by the index by using the `custom_settings` option of
|
||||
your config.
|
||||
|
||||
|
||||
[1]: https://www.algolia.com/doc/guides/ranking/ranking-formula/#tie-breaking-approach
|
||||
[2]: https://www.algolia.com/doc/guides/ranking/ranking-formula/#tie-breaking-approach
|
||||
[3]: https://www.algolia.com/doc/guides/ranking/custom-ranking/
|
||||
|
|
|
|||
|
|
@ -17,10 +17,17 @@ If you're a maintaining such a tool and would like to get added to the list, get
|
|||
[in touch with us][8]
|
||||
|
||||
[1]: https://docusaurus.io/
|
||||
|
||||
[2]: https://docusaurus.io/docs/en/search#docsNav
|
||||
|
||||
[3]: https://vuepress.vuejs.org/
|
||||
|
||||
[4]: https://vuepress.vuejs.org/default-theme-config/#algolia-search
|
||||
|
||||
[5]: https://docs.gitbook.com/
|
||||
|
||||
[6]: http://pkgdown.r-lib.org/index.html
|
||||
|
||||
[7]: http://pkgdown.r-lib.org/articles/pkgdown.html#search
|
||||
|
||||
[8]: mailto:docsearch@algolia.com
|
||||
|
|
|
|||
|
|
@ -99,8 +99,7 @@ against the indexed results.
|
|||
<img src="./assets/playground.png" alt="Playground" class="mt-2"/>
|
||||
|
||||
_Note that if the command fails (it can happen on non-Mac machines),
|
||||
you can get the same result by running a live server in the `
|
||||
./playground` subdirectory.\`_
|
||||
you can get the same result by running a live server in the `./playground` subdirectory.\`_
|
||||
|
||||
## Integration
|
||||
|
||||
|
|
|
|||
|
|
@ -23,5 +23,7 @@ you is to check that you're eligible (most tech projects are), and apply! After
|
|||
that, we'll share with you the JavaScript snippet needed to add DocSearch to
|
||||
your website. We just ask that you keep the "powered by Algolia" link displayed.
|
||||
|
||||
DocSearch is [one of our ways](https://opencollective.com/algolia) to give back
|
||||
DocSearch is [one of our ways][1] to give back
|
||||
to the Open-Source community for everything it did for us already.
|
||||
|
||||
[1]: https://opencollective.com/algolia
|
||||
|
|
|
|||
|
|
@ -55,4 +55,5 @@ following criteria:
|
|||
rendering if you can.
|
||||
|
||||
[1]: ./apply.html
|
||||
|
||||
[2]: ./integrations.html
|
||||
|
|
|
|||
Loading…
Reference in a new issue