# gitbook-plugin-search-fetch

> gitbook search plugin

Latest version **0.1.1** (published 2019-03-11) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install gitbook-plugin-search-fetch
pnpm add gitbook-plugin-search-fetch
yarn add gitbook-plugin-search-fetch
bun add gitbook-plugin-search-fetch
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2019-03-11 |
| First published | 2019-03-11 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.8 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | zzbozheng |
| Maintainers | zzbo |

## Links

- npm: https://www.npmjs.com/package/gitbook-plugin-search-fetch
- Repository: https://github.com/zzbo/gitbook-plugin-search-fetch
- Homepage: https://github.com/zzbo/gitbook-plugin-search-fetch#readme
- Issues: https://github.com/zzbo/gitbook-plugin-search-fetch/issues
- npm.io page: https://npm.io/package/gitbook-plugin-search-fetch

## Dependencies (1)

- [html-entities](https://npm.io/package/html-entities.md) 1.2.0

## Recent versions

- 0.1.1 (latest) — 2019-03-11
- 0.1.0 — 2019-03-11

## README

# gitbook-plugin-search-fetch

A powerful search plugin for GitBook.

### Features

    * Allows you to pull search results from a remote server.
    * Support jsonp data type.

### Use this plugin

 Before use this plugin, you should disable the default search plugin first, 
 Here is a `book.json` configuration example:

```
{
    plugins: ["-lunr", "-search", "search-fetch"]
}
```
Run `gitbook serve`

> Note: Only gitbook >= 3.0.0 support

### Configure
```
{
    searchFetch: {
        url: 'http://yoursearchcgi.com/?q=', // required | your search cgi 
        dataType: 'jsonp', // option | default value: "json"
        jsonp: '', // option | default value: "callback"
        jsonpCallback: '' // option | default value: "
    }
    
}
```

### Expected return data format:
```
{
    "./": { // target page path
        "url": "./", // target page path
        "title": "your title",
        "keywords": "your keywords",
        "body": "your content"
    }
}
```

### Inspired by
* [gitbook-plugin-lunr](https://github.com/GitbookIO/plugin-lunr)
* [gitbook-plugin-search](https://github.com/GitbookIO/plugin-search)
* [gitbook-plugin-search-plus](https://github.com/lwdgit/gitbook-plugin-search-plus)
* [mark.js](https://github.com/julmot/mark.js)

---
_Source: https://npm.io/package/gitbook-plugin-search-fetch · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
