npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vuepress-plugin-github-markdown

v1.0.3

Published

VuePress plugin for importing markdown files from Github

Downloads

11

Readme

vuepress-plugin-github-markdown

VuePress plugin for importing markdown from Github

Setup

Create Github App for Organization:

  1. Register new Github App
  • Please follow guide if you have questions.
  • Make sure to save the Private Key that is generated to your .env file GITHUB_PRIVATE_KEY.
    • May need to format the Private Key properly on single line for env file (The OSX script will format & save to clipboard for easy pasting):

      awk -v ORS='\\n' '1' github-app-name.2020-06-21.private-key.pem | pbcopy

    • Some deployment services (ie. Netlify) won't be able to parse the line breaks properly. When calling the env variable replace the line breaks like this: process.env.GITHUB_PRIVATE_KEY.replace(/\\n/gm, '\n').

  • Also save the App ID to your .env file GITHUB_APP_ID.
  1. Install Github App
  • Please follow guide for installation.
  • On the installation page of the app, make note of the Installation ID** at the end of the url. (ie. https://github.com/organizations/getnacelle/settings/installations/**9762656**). Save to your .env file GITHUB_INSTALLATION_ID

Installation:

npm install -D vuepress-plugin-github-markdown

Add to .vuepress/config:

  plugins: [
    [
      'vuepress-plugin-github-markdown',
      {
        appId: process.env.GITHUB_APP_ID,
        privateKey: process.env.GITHUB_PRIVATE_KEY.replace(/\\n/gm, '\n'),
        installationId: process.env.GITHUB_INSTALLATION_ID,
        files: [
          {
            path: '/nuxt/changelog.html',
            owner: 'getnacelle',
            repo: 'nacelle-nuxt-starter',
            githubFilePath: 'CHANGELOG.md',
            modifyContent(content) {
              // Append title to markdown
              return '# @nacelle/nacelle-nuxt-starter' + '\n' + content
            }
          }
        ]
      }
    ]
  ]

Plugin Options:

| Name | Param[Type] | Describe | | ---- | --------- | -------- | | appId | String | App ID for Github App | | privateKey | String | Private Key of Github App | | installationId | String | ID of Github App installation | | files | File[] | Array of file options for markdown files to import |

File Options:

| Name | Param[Type] | Describe | | ---- | --------- | -------- | | path | String | url path where the page will live in docs | | owner | String | github owner/organization | | repo | String | github repo name | | githubFilePath | String | the url to the raw markdown file | | modifyContent | (String): String | (optional) A function that can modify imported content if needed |

Link to Markdown File in Sidebar:

We can link to the markdown file by using a standard sidebar group in the config.js:

  {
    title: 'Changelog',
    collapsable: true,
    path: '/nuxt/changelog',
    sidebarDepth: 1,
    children: ['/nuxt/changelog'],
  },