Nonconformist Propaganda Machine

npm

Need private packages and team management tools?Check out npm Orgs. »

gatsby-remark-embed-github-wiki

1.0.1 • Public • Published

gatsby-remark-embed-github-wiki

NPM badge Travis badge

This plugin allows content authors to embed public GitHub wiki markdown.

Getting started

To embed a GitHub wiki page in your markdown/remark content, simply add an inline code block using the gh-wiki: protocol.

`gh-wiki:[<username>/repo/]<wiki_page>`

Where:

  • username, represents the github user or org to be accessed.
    Can be defaulted via configuration.
  • repo, is the name of the repo to be accessed.
  • wiki_page, is the name of of the wiki page, as specified in the URL bar: ex: Index-Copy for this page

Installation

npm i gatsby-remark-embed-github-wiki

Usage

// In your gatsby-config.js
{
  resolve: "gatsby-transformer-remark",
  options: {
    plugins: [
      {
        resolve: "gatsby-remark-embed-github-wiki",
        options: {
          // Optional: (both must be specified)
          username: 'visitinc',
          repo: 'visitinc.github.io'
        }
      }
    ]
  }
}

Notes

The order of the plugins only matters when used in conjunction with gatsby-remark-prismjs, because this plugin transforms the inline code blocks, so add gatsby-remark-embed-github-wiki somewhere above this plugin.

Any GitHub user can modify GitHub wikis, be careful when setting innerHTML based on wiki sources to prevent cross site scripting attacks.

License

MIT

install

npm i gatsby-remark-embed-github-wiki

Downloadsweekly downloads

10

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability