# gatsby-remark-double-brackets-link

> Parse double brackets link in markdown

Latest version **0.1.11** (published 2021-07-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install gatsby-remark-double-brackets-link
pnpm add gatsby-remark-double-brackets-link
yarn add gatsby-remark-double-brackets-link
bun add gatsby-remark-double-brackets-link
```

## 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.11 |
| Published | 2021-07-08 |
| First published | 2020-05-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 689 |
| Author | Mathieu Dutour |
| Maintainers | mathieudutour |
| Keywords | gatsby, remark, double brackets, wikilinks |

## Links

- npm: https://www.npmjs.com/package/gatsby-remark-double-brackets-link
- Repository: https://github.com/mathieudutour/gatsby-digital-garden
- Homepage: https://github.com/mathieudutour/gatsby-digital-garden#readme
- Issues: https://github.com/mathieudutour/gatsby-digital-garden/issues
- npm.io page: https://npm.io/package/gatsby-remark-double-brackets-link

## Dependencies (2)

- [slugify](https://npm.io/package/slugify.md) ^1.5.3
- [unist-util-visit](https://npm.io/package/unist-util-visit.md) ^2.0.0

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 0.1.11 (latest) — 2021-07-08
- 0.1.10 — 2021-07-07
- 0.1.9 — 2021-07-07
- 0.1.8 — 2021-02-10
- 0.1.7 — 2020-09-17
- 0.1.6 — 2020-06-29
- 0.1.5 — 2020-05-16
- 0.1.4 — 2020-05-16
- 0.1.3 — 2020-05-15
- 0.1.2 — 2020-05-15
- 0.1.1 — 2020-05-15
- 0.1.0 — 2020-05-15

## README

# gatsby-remark-double-brackets-link

Transform `[[Link to page]]` into `[Link to page](titleToURL('Link to page'))`.

An example site for using this plugin is at [https://mathieudutour.github.io/gatsby-digital-garden/](https://mathieudutour.github.io/gatsby-digital-garden/)

## Installation

```bash
npm install gatsby-remark-double-brackets-link
```

## Usage

Add the plugin to your Gatsby config:

```js
{
  resolve: `gatsby-plugin-mdx`,
  options: {
    gatsbyRemarkPlugins: [
      {
        resolve: `gatsby-remark-double-brackets-link`,
      },
    ],
  },
}
```

### Resolving the URL

By default, the plugin will resolve the url with:

```js
(title: string) => {
  const segments = title.split('/')
  const slugifiedTitle = slugify(segments.pop() as string)
  return `${segments.join('/')}/${slugifiedTitle}`
};
```

You can override this behavior by passing a `titleToURLPath` option pointing to a JavaScript exporting a function receiving the title as argument and returning a string.

For example:

```js
// resolve-url.js
const slugify = require('slugify')
module.exports = (title) => `/${slugify(title)}`

// gatsby-config.js
{
  ...
  {
    resolve: `gatsby-plugin-mdx`,
    options: {
      gatsbyRemarkPlugins: [
        {
          resolve: `gatsby-remark-double-brackets-link`,
          options: {
            titleToURLPath: `${__dirname}/resolve-url.js`
          },
        }
      ],
    },
  }
  ...
}
```

By default, the plugin will keep the brackets in the link name. You can change this behavior by passing a `stripBrackets` options.

### WikiLinks

By default, the plugin will ignore Wiki style links (eg. `[[Internal link|With custom text]]`).

To parse them, pass `parseWikiLinks` as an option.

---
_Source: https://npm.io/package/gatsby-remark-double-brackets-link · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
