1
0
Fork 0

Update config-file.md

This commit is contained in:
Peter Villani 2018-09-03 12:25:01 +02:00 committed by GitHub
parent 93616895a6
commit 6b6da9589b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -199,11 +199,11 @@ Here, all documentation pages will use the selectors defined in
## `selectors`
This object contains all the CSS selectors that will be used to create the
record hierarchy. It can contains up to 6 levels (`lvl0`, `lvl1`, `lvl2`,
record hierarchy. It can contain up to 6 levels (`lvl0`, `lvl1`, `lvl2`,
`lvl3`, `lvl4`, `lvl5`) and `text`.
A default config would be to target the page `title` or `h1` as `lvl0`, the `h2`
as `lvl1` and `h3` as `lvl2` and `p` as `text`, but this is highly dependent on
as `lvl1`, `h3` as `lvl2`, and `p` as `text`, but this is highly dependent on
the markup.
The `text` key is mandatory, but we highly recommend setting also `lvl0`, `lvl1`
@ -241,7 +241,7 @@ Other special keys can be set, as documented below.
The default way of extracting content through selectors is to read the HTML
markup from top to bottom. This works well with semi-structured content, like a
hierarchy of headers. This breaks when the relevant information is not part of
the same flow. For example when the title is apart in a header or a sidebar.
the same flow. For example when the title is not part of a header or sidebar.
For that reason, you can set a selector as global, meaning that it will match on
the whole page, and will be the same for all records extracted on this page.
@ -275,7 +275,7 @@ If your selector might not match a valid element on the page, you can define a
### Removing unnecessary characters
Some documentations add special characters to headings, like `#` or ``. Those
Some documentation adds special characters to headings, like `#` or ``. Those
characters have a stylistic value but no meaning and shouldn't be indexed in the
search results.
@ -307,11 +307,11 @@ and it will be applied to all selectors.
CSS selectors are a clear and concise way to target elements of a page, but they
have a limitations. For example, you cannot go _up_ the cascade with CSS.
If you need a more powerful selector mecanism, you can write your selectors
If you need a more powerful selector mechanism, you can write your selectors
using XPath by setting `type: xpath`.
The following example will look for a `li.chapter.active.done` and then go up
two levels in the DOM until it found a `a`. The content of this `a` will then be
two levels in the DOM until it finds a `a`. The content of this `a` will then be
used as the value of the `lvl0` selector.
```json
@ -409,7 +409,7 @@ if it's a duplicate of another page, you should set this to `false`.
This expects an array of CSS selectors. Any element matching one of those
selectors will be removed from the page before any data is extracted from it.
This can be used to remove a table of content, a sidebar or a footer, to make
This can be used to remove a table of content, a sidebar, or a footer, to make
other selectors easier to write.
```json
@ -420,7 +420,7 @@ other selectors easier to write.
### `stop_urls` _Optional_
This an array of strings or regular expressions. Whenever the crawler is about
This is an array of strings or regular expressions. Whenever the crawler is about
to visit a link, it will first check if the link matches something in the array.
If it does, it will not follow the link. This should be used to restrict pages
the crawler should visit.
@ -458,7 +458,7 @@ Sitemaps can contain _alternative links_ for URLs. Those are other versions of
the same page, in a different language, or with a different URL. By default
DocSearch will ignore those URLs.
Set this to `true` if you want those other version to be crawled as well.
Set this to `true` if you want those other versions to be crawled as well.
```json
{
@ -480,7 +480,7 @@ crawled.
## JavaScript rendering
By default DocSearch expect websites to have server-side rendering, meaning that
By default DocSearch expects websites to have server-side rendering, meaning that
HTML source is returned directly by the server. If your content is generated by
the front-end, you have to tell DocSearch to emulate a browser through Selenium.