# keyword-linker

> Generate links for documentation from keywords.

Latest version **1.2.1** (published 2018-12-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install keyword-linker
pnpm add keyword-linker
yarn add keyword-linker
bun add keyword-linker
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2018-12-19 |
| First published | 2018-12-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 29 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Liupo WU |
| Maintainers | liupo |
| Keywords | link builder, keyword hyperlink |

## Links

- npm: https://www.npmjs.com/package/keyword-linker
- Repository: https://github.com/wuliupo/keyword-linker
- Homepage: https://github.com/wuliupo/keyword-linker#readme
- Issues: https://github.com/wuliupo/keyword-linker/issues
- npm.io page: https://npm.io/package/keyword-linker

## Recent versions

- 1.2.1 (latest) — 2018-12-19
- 1.2.0 — 2018-12-17
- 1.1.0 — 2018-12-17
- 1.0.0 — 2018-12-16

## README

# Add hyperlinks from keywords (关键词加超链接)

Generate links for documentation from given keywords. <http://github.com/wuliupo/keyword-linker>

## Usage（使用方法）

- ```npm install keyword-linker```
- Browser: ```<script src="./keyword-linker.js"></script>```
  - UI demo: <http://wuliupo.github.io/keyword-linker>
- Node.js: ```require('keyword-linker')```
  - [jsdom-demo.js](./node-demo/jsdom-demo.js) (depends on [jsdom](https://github.com/jsdom/jsdom))
  - [cheerio-demo.js](./node-demo/cheerio-demo.js) (depends on [cheerio](https://github.com/cheeriojs/cheerio))
- Import: ```import KeywordLinker from './keyword-linker.js'```

```js
// Prepare（准备参数）
var keywords = [ { text: '盘古大帝', priority: 10, max: 3 }, { text: '盘古', priority: 1, max: 3 } ];
var config = { replacement: '<a href="#KEYWORD">KEYWORD</a>', placeholder: 'KEYWORD', max: 10 };
var kl = new KeywordLinker(keywords, config);

// Render for a DOM (直接渲染网页内容)
kl.addLink2Dom(aDom);

// Render for a string (替换字符串)
var newContent = kl.addLink2String(content);
```

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