# noddity-linkifier

> Mediawiki-style internal links, for Noddity blogs

Latest version **3.0.0** (published 2017-01-31) · 0 weekly downloads

## Install

```sh
npm install noddity-linkifier
pnpm add noddity-linkifier
yarn add noddity-linkifier
bun add noddity-linkifier
```

## 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 | 3.0.0 |
| Published | 2017-01-31 |
| First published | 2014-05-17 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | TehShrike |
| Maintainers | tehshrike |
| Keywords | static, noddity, mediawiki |

## Links

- npm: https://www.npmjs.com/package/noddity-linkifier
- Repository: https://github.com/TehShrike/noddity-linkifier
- Homepage: https://github.com/TehShrike/noddity-linkifier#readme
- Issues: https://github.com/TehShrike/noddity-linkifier/issues
- npm.io page: https://npm.io/package/noddity-linkifier

## Dependencies (1)

- [make-object-an-emitter](https://npm.io/package/make-object-an-emitter.md) ~1.0.0

## Recent versions

- 3.0.0 (latest) — 2017-01-31
- 2.2.2 — 2016-11-12
- 2.2.1 — 2015-11-23
- 2.2.0 — 2015-10-13
- 2.1.0 — 2015-05-09
- 2.0.0 — 2014-07-02
- 1.0.0 — 2014-05-17

## README

[![Build Status](https://travis-ci.org/TehShrike/noddity-linkifier.svg)](https://travis-ci.org/TehShrike/noddity-linkifier)

Given an html document, turns the bracket-based link syntax into html links, in a manner very similar to MediaWiki's [Wikilinks](https://meta.wikimedia.org/wiki/Help:Link#Wikilinks).

Example
=======

```js

var Linkifier = require('.')
var linkify = new Linkifier('#/myposts/')

linkify('[[my-page.md]]') // => '<a href="#/myposts/my-page.md">my-page.md</a>'

linkify('[[super-awesome-post.md|CLICK HERE to read awesome things]] dawg!') // => '<a href="#/myposts/super-awesome-post.md">CLICK HERE to read awesome things</a> dawg!'


```


Usage
=====

Constructor(rootPath)
-----

Create yourself a linkifier object with a root path, like so:

	var Linkifier = require('noddity-linkifier')

	var linkify = new Linkifier('#/myposts/')

`linkify` is both a function, and an event emitter.

linkify(string)
------

Takes a string with html or whatever and returns a string with all of the links that aren't inside of `<code>` tags are replaced with html links.

Events
------

The linkifier object is an event emitter - it emits a 'link' event whenever a link is found and replaced.  The sole argument is the target page - the examples from the top of the readme would have each emitted a 'link' event with a single argument 'my-page.md' and 'super-awesome-post.md', respectively.

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