# gatsby-transformer-markdown-references

> Transform markdown nodes to add the necesserary references for bi-directional links

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

## Install

```sh
npm install gatsby-transformer-markdown-references
pnpm add gatsby-transformer-markdown-references
yarn add gatsby-transformer-markdown-references
bun add gatsby-transformer-markdown-references
```

## Health

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

Positive: has types; no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.8 |
| Published | 2021-07-08 |
| First published | 2020-05-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 19.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 689 |
| Author | Mathieu Dutour |
| Maintainers | mathieudutour |
| Keywords | gatsby, transformer, markdown, references, bi-directional links |

## Links

- npm: https://www.npmjs.com/package/gatsby-transformer-markdown-references
- 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-transformer-markdown-references

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.8 (latest) — 2021-07-08
- 0.1.7 — 2021-07-08
- 0.1.6 — 2021-07-07
- 0.1.5 — 2020-07-07
- 0.1.4 — 2020-06-29
- 0.1.3 — 2020-06-29
- 0.1.2 — 2020-06-29
- 0.1.1 — 2020-06-29
- 0.1.0 — 2020-05-23

## README

# gatsby-transformer-markdown-references

Transformer plugin to extract references between markdown nodes. You can then use them to create bi-directional links.

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

## Install

```shell
npm install --save gatsby-transformer-markdown-references
```

## How to use

```javascript
// In your gatsby-config.js
module.exports = {
  plugins: [
    // after a markdown or Mdx transformer
    {
      resolve: `gatsby-transformer-markdown-references`,
      options: {
        types: ["Mdx"], // or ["MarkdownRemark"] (or both)
      },
    },
  ],
};
```

### Configuration options

**`types`** [Array<string>][optional]

The types of the nodes to transform. Defaults to `['Mdx']`

## How to query for references

Two types of references are available: `outboundReferences` and `inboundReferences`.

The fields will be created in your site's GraphQL schema on the nodes of types specified in the options.

```graphql
{
  allMdx {
    outboundReferences {
      ... on Mdx {
        id
        parent {
          id
        }
      }
    }
    inboundReferences {
      ... on Mdx {
        id
        parent {
          id
          ... on RoamPage {
            title
          }
        }
      }
    }
  }
}
```

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